This document explains how to use the --ipv6-only-mgmt flag to configure virtual testbeds with IPv6-only management networks.
The --ipv6-only-mgmt flag allows you to configure a virtual DUT (Device Under Test) with IPv6-only management network settings, including:
- IPv6 management IP address (using
ansible_hostv6from inventory) - IPv6 NTP servers
- IPv6 DNS servers
- IPv6 TACACS servers (using PTF container's IPv6 address)
- IPv6 syslog servers
- IPv6 SNMP servers
- IPv6 management routes
To deploy a virtual testbed with IPv6-only management configuration:
Generate Minigraph
Generate minigraph for IPv6 only management address is only required for Virtual testbed.
./testbed-cli.sh [-t testbed-file] [-m inventory] gen-mg <testbed-name> <inventory> <vault-password-file> --ipv6-only-mgmtDeploy Minigraph
./testbed-cli.sh deploy-mg <testbed-name> <inventory> <vault-password-file> --ipv6-only-mgmt-
Deploy minigraph with IPv6-only management:
./testbed-cli.sh deploy-mg vms-sn2700-t0 lab ~/.password --ipv6-only-mgmt -
Generate and deploy minigraph with IPv6-only management for virtual testbed:
# generate minigraph ./testbed-cli.sh -t vtestbed.yaml -m veos_vtb gen-mg vms-kvm-t0 veos_vtb ~/.password --ipv6-only-mgmt # deploy minigraph ./testbed-cli.sh -t vtestbed.yaml -m veos_vtb deploy-mg vms-kvm-t0 veos_vtb ~/.password --ipv6-only-mgmt
-
Test minigraph with IPv6-only management:
./testbed-cli.sh -t vtestbed.yaml -m veos_vtb test-mg vms-kvm-t0 veos_vtb ~/.password --ipv6-only-mgmt
The testbed must have ptf_ipv6 defined in the testbed.yaml file:
- conf-name: vms-sn2700-t0
group-name: vms1-3
topo: t0
ptf_image_name: docker-ptf
ptf: ptf_vms1-3
ptf_ip: 10.255.0.180/24
ptf_ipv6: 2001:db8:1::10/64 # Required for IPv6-only management
server: server_1
vm_base: VM0100
dut:
- str-msn2700-01
inv_name: labThe device should have ansible_hostv6 defined in the inventory file:
str-msn2700-01:
ansible_host: 10.250.0.101
ansible_hostv6: fc00:2::101
mgmt_subnet_mask_length: 24IPv6 service configurations are defined in:
group_vars/lab/ipv6.yml- For lab inventorygroup_vars/sonic/ipv6.yml- For lab inventory (depending on the inventory group)group_vars/vm_host/ipv6.yml- For vm_host inventory
For virtual testbeds, we use the following IPv6 addressing:
| Network Purpose | IPv6 Prefix | Notes |
|---|---|---|
| Management Network | fc00:2::/64 |
ULA prefix for DUT management |
| PTF Backplane | fc0a::/64 |
Defined in vm_host/main.yml |
| Local Server | fc00:1::/64 |
ULA for syslog, SNMP |
| Google DNS | 2001:4860:4860::/64 |
Public DNS servers |
When --ipv6-only-mgmt is used, the following services use IPv6:
| Service | IPv6 Address | Notes |
|---|---|---|
| NTP | fec0::ffff:afa:2 |
Local testbed NTP server (primary) |
| NTP | 2001:4860:4806:: |
Google IPv6 NTP (fallback) |
| TACACS | PTF's ptf_ipv6 |
From testbed.yaml |
| Syslog | fec0::1 |
Testbed gateway |
| SNMP | fec0::1 |
Testbed gateway |
- The DUT's management IP uses
ansible_hostv6instead ofansible_host - The subnet mask length defaults to
/64 - IPv6 management routes are configured for proper connectivity
When using PTF TACACS servers (default behavior):
- IPv4 mode: Uses testbed's
ptf_ip - IPv6 mode: Uses testbed's
ptf_ipv6(with CIDR notation stripped)
The TACACS server runs on the PTF container, which must have IPv6 connectivity to the DUT.
Ensure the PTF container has IPv6 configured:
- The
ptf_ipv6address from testbed.yaml or vtestbed.yaml is assigned to the PTF container - The TACACS server on PTF must listen on the IPv6 address
- Verify IPv6 connectivity between DUT and PTF
For IPv6-only management networks, external NTP servers may not be reachable. A local NTP server running on the testbed host provides reliable time synchronization.
The NTP server runs as a Docker container connected to the management bridge (br1):
cd ansible/
./setup-ntp-server.sh startThis will:
- Build the Chrony NTP server Docker image
- Create a macvlan network attached to br1
- Start the container with both IPv4 and IPv6 addresses
| Protocol | Address | Notes |
|---|---|---|
| IPv4 | 10.250.0.2 |
For IPv4 management networks |
| IPv6 | fec0::ffff:afa:2 |
For IPv6-only management networks |
# Check status
./setup-ntp-server.sh status
# Stop the server
./setup-ntp-server.sh stop
# Restart the server
./setup-ntp-server.sh restart
# Test connectivity
./setup-ntp-server.sh test
# Full cleanup (remove container, network, and image)
./setup-ntp-server.sh cleanOn the DUT, verify NTP is working:
# Check NTP status
show ntp
# Or using chronyc
chronyc sources
chronyc trackingThe local NTP server is configured as the primary NTP source in:
group_vars/sonic/ipv6.yml- For DUTsgroup_vars/lab/ipv6.yml- For lab devicesgroup_vars/vm_host/ipv6.yml- For VM hostshost_vars/STR-ACS-VSERV-01.yml- Server-specific config
Error: IPv6-only management mode requested but ptf_ipv6 is not configured in testbed file
Solution: Add ptf_ipv6 to your testbed entry in testbed.yaml
Issue: Minigraph uses default IPv6 address
Solution: Add ansible_hostv6 to the device entry in the inventory file
Issue: Playbook fails waiting for DUT after loading minigraph
Solution:
- Verify IPv6 routing is configured on the management network
- Check that the server/PTF can reach the DUT's IPv6 management address
- Ensure the management switch/bridge supports IPv6
Issue: NTP or other services fail after IPv6 transition
Solution:
- Verify the IPv6 service addresses are reachable from the DUT
- Check firewall rules allow IPv6 traffic
- Ensure forced management routes include necessary IPv6 prefixes
Issue: DUT cannot sync time with local NTP server
Solution:
- Verify the NTP server is running:
./setup-ntp-server.sh status
- Check network connectivity from DUT:
# On DUT ping6 fec0::ffff:afa:2 - Verify the macvlan network is attached to br1:
docker network inspect sonic-mgmt-ntp-net
- Check chrony configuration inside container:
docker exec sonic-mgmt-ntp chronyc tracking
When running tests against a DUT configured with IPv6-only management, you must tell the test framework to use IPv6 addresses.
Use the -6 flag to enable IPv6-only management mode:
./run_tests.sh -6 -n vms-kvm-t0 -d vlab-01 -c bgp/test_bgp_fact.py -f vtestbed.yaml -i ../ansible/veos_vtbUse the --ipv6_only_mgmt option:
pytest --ipv6_only_mgmt --testbed vms-kvm-t0 --testbed_file vtestbed.yaml --inventory ../ansible/veos_vtb --host-pattern vlab-01 bgp/test_bgp_fact.pyWhen enabled, the test framework will:
- Use
ansible_hostv6as the DUT management IP instead ofansible_host - Skip IPv4 management connectivity sanity checks
- Use
ping6for management reachability tests
- The
--ipv6_only_mgmt/-6flag only affects test execution, not deployment - The DUT must already be configured with IPv6 management (via
deploy-mg --ipv6-only-mgmt) - Ensure
ansible_hostv6is defined in the inventory for all DUTs
To switch back to IPv4 management, simply run deploy-mg without the --ipv6-only-mgmt flag:
./testbed-cli.sh deploy-mg vms-sn2700-t0 lab ~/.passwordThis will regenerate and deploy a minigraph with IPv4-only management configuration.