diff options
| author | Marius Lindvall <marius@varden.info> | 2026-01-01 23:17:09 +0100 |
|---|---|---|
| committer | Marius Lindvall <marius@varden.info> | 2026-01-01 23:17:09 +0100 |
| commit | 4cbeda405f44541bd0934ae74538d84c47333756 (patch) | |
| tree | 7dd1542ca27da6a71a1ebad552cc128a46137491 | |
| parent | 76830afc8703a3f9f6be7500cb92aa9b6e255425 (diff) | |
| download | vyos-1x-4cbeda405f44541bd0934ae74538d84c47333756.tar.gz vyos-1x-4cbeda405f44541bd0934ae74538d84c47333756.zip | |
router-advert: T8140: add captive portal support (RFC 8910)
Add support for captive portal identification in IPv6 router adverts as
defined in RFC 8910. The value is a quoted URL pointing to an RFC
8908-compliant API endpoint.
| -rw-r--r-- | data/templates/router-advert/radvd.conf.j2 | 3 | ||||
| -rw-r--r-- | interface-definitions/service_router-advert.xml.in | 1 | ||||
| -rwxr-xr-x | smoketest/scripts/cli/test_service_router-advert.py | 11 |
3 files changed, 15 insertions, 0 deletions
diff --git a/data/templates/router-advert/radvd.conf.j2 b/data/templates/router-advert/radvd.conf.j2 index 34f8e1f6d..15febd0dd 100644 --- a/data/templates/router-advert/radvd.conf.j2 +++ b/data/templates/router-advert/radvd.conf.j2 @@ -4,6 +4,9 @@ {% for iface, iface_config in interface.items() %} interface {{ iface }} { IgnoreIfMissing on; +{% if iface_config.captive_portal is vyos_defined %} + AdvCaptivePortalAPI "{{ iface_config.captive_portal }}"; +{% endif %} {% if iface_config.default_preference is vyos_defined %} AdvDefaultPreference {{ iface_config.default_preference }}; {% endif %} diff --git a/interface-definitions/service_router-advert.xml.in b/interface-definitions/service_router-advert.xml.in index 7f96cdb19..dc7164abc 100644 --- a/interface-definitions/service_router-advert.xml.in +++ b/interface-definitions/service_router-advert.xml.in @@ -16,6 +16,7 @@ </completionHelp> </properties> <children> + #include <include/dhcp/captive-portal.xml.i> <leafNode name="hop-limit"> <properties> <help>Set Hop Count field of the IP header for outgoing packets</help> diff --git a/smoketest/scripts/cli/test_service_router-advert.py b/smoketest/scripts/cli/test_service_router-advert.py index b44d0d6c6..54133b5c7 100755 --- a/smoketest/scripts/cli/test_service_router-advert.py +++ b/smoketest/scripts/cli/test_service_router-advert.py @@ -224,6 +224,17 @@ class TestServiceRADVD(VyOSUnitTestSHIM.TestCase): self.assertIn(tmp, config) self.assertIn('AdvValidLifetime 65528;', config) # default + def test_captive_portal(self): + captive_portal = 'https://example.com/api/capport.json' + + self.cli_set(base_path + ['captive-portal', captive_portal]) + # commit changes + self.cli_commit() + + # Verify generated configuration + tmp = get_config_value('AdvCaptivePortalAPI') + self.assertEqual(tmp, f'"{captive_portal}"') + def test_advsendadvert_advintervalopt(self): ra_src = ['fe80::1', 'fe80::2'] |
