diff options
author | Yuxiang Zhu <vfreex@gmail.com> | 2022-11-21 01:02:54 +0800 |
---|---|---|
committer | Yuxiang Zhu <vfreex@gmail.com> | 2022-11-21 15:47:17 +0800 |
commit | cca7ec3efbf66a9ca6005352133528c4286c2be9 (patch) | |
tree | 095a25eb42da50159b24eca3f916160dbb0ddf93 /smoketest/scripts/cli/test_service_dhcp-server.py | |
parent | da5bff2e835a14997d7b176670376cbd8d1221ef (diff) | |
download | vyos-1x-cca7ec3efbf66a9ca6005352133528c4286c2be9.tar.gz vyos-1x-cca7ec3efbf66a9ca6005352133528c4286c2be9.zip |
T4832: dhcp: Add IPv6-only dhcp option support (RFC 8925)
Clients supporting this DHCP option (DHCP option 108, RFC 8925) will
disable its IPv4 network stack for configured number of seconds
and operate in IPv6-only mode.
This option is known to work on iOS 15+ and macOS 12.0.1+.
Example command:
```sh
set service dhcp-server shared-network-name LAN6 subnet 192.168.64.0/24 ipv6-only-preferred 0
```
Diffstat (limited to 'smoketest/scripts/cli/test_service_dhcp-server.py')
-rwxr-xr-x | smoketest/scripts/cli/test_service_dhcp-server.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/smoketest/scripts/cli/test_service_dhcp-server.py b/smoketest/scripts/cli/test_service_dhcp-server.py index 9c9d6d9f1..1f6dc823f 100755 --- a/smoketest/scripts/cli/test_service_dhcp-server.py +++ b/smoketest/scripts/cli/test_service_dhcp-server.py @@ -112,6 +112,7 @@ class TestServiceDHCPServer(VyOSUnitTestSHIM.TestCase): bootfile_server = '192.0.2.1' wpad = 'http://wpad.vyos.io/foo/bar' server_identifier = bootfile_server + ipv6_only_preferred = 300 pool = base_path + ['shared-network-name', shared_net_name, 'subnet', subnet] # we use the first subnet IP address as default gateway @@ -132,6 +133,7 @@ class TestServiceDHCPServer(VyOSUnitTestSHIM.TestCase): self.cli_set(pool + ['server-identifier', server_identifier]) self.cli_set(pool + ['static-route', '10.0.0.0/24', 'next-hop', '192.0.2.1']) + self.cli_set(pool + ['ipv6-only-preferred', ipv6_only_preferred]) # check validate() - No DHCP address range or active static-mapping set with self.assertRaises(ConfigSessionError): @@ -169,6 +171,7 @@ class TestServiceDHCPServer(VyOSUnitTestSHIM.TestCase): self.assertIn(f'max-lease-time 86400;', config) self.assertIn(f'range {range_0_start} {range_0_stop};', config) self.assertIn(f'set shared-networkname = "{shared_net_name}";', config) + self.assertIn(f'option rfc8925-ipv6-only-preferred {ipv6_only_preferred};', config) # weird syntax for those static routes self.assertIn(f'option rfc3442-static-route 24,10,0,0,192,0,2,1, 0,192,0,2,1;', config) |