summaryrefslogtreecommitdiff
path: root/src/conf_mode/dns_forwarding.py
diff options
context:
space:
mode:
authorViacheslav Hletenko <v.gletenko@vyos.io>2022-07-04 18:16:06 +0000
committerChristian Poessinger <christian@poessinger.com>2022-07-07 12:09:42 +0200
commit1577dc53f144d8a7c4438ca98a574102bea14c6b (patch)
tree37763e27fc7445e9058e40937cad2d0cb2d8a57c /src/conf_mode/dns_forwarding.py
parentf315714d0c680ad80a79dcdac21576407794dcd1 (diff)
downloadvyos-1x-1577dc53f144d8a7c4438ca98a574102bea14c6b.tar.gz
vyos-1x-1577dc53f144d8a7c4438ca98a574102bea14c6b.zip
dns: T4509: Add dns64-prefix option
rfc6147: DNS Extensions for Network Address Translation from IPv6 Clients to IPv4 Servers set service dns forwarding dns64-prefix 2001:db8:aabb::/96 (cherry picked from commit 2bdf4798570222b57af2de2f0b443529abdc3feb)
Diffstat (limited to 'src/conf_mode/dns_forwarding.py')
-rwxr-xr-xsrc/conf_mode/dns_forwarding.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/conf_mode/dns_forwarding.py b/src/conf_mode/dns_forwarding.py
index bc3821f61..997f839b2 100755
--- a/src/conf_mode/dns_forwarding.py
+++ b/src/conf_mode/dns_forwarding.py
@@ -83,6 +83,12 @@ def verify(dns):
if 'server' not in dns['domain'][domain]:
raise ConfigError(f'No server configured for domain {domain}!')
+ if 'dns64_prefix' in dns:
+ dns_prefix = dns['dns64_prefix'].split('/')[1]
+ # RFC 6147 requires prefix /96
+ if int(dns_prefix) != 96:
+ raise ConfigError('DNS forwarding "dns64-prefix" must be /96')
+
if 'system' in dns:
if not 'system_name_server' in dns:
print('Warning: No "system name-server" configured')