diff options
author | Viacheslav Hletenko <v.gletenko@vyos.io> | 2022-07-04 18:16:06 +0000 |
---|---|---|
committer | Viacheslav Hletenko <v.gletenko@vyos.io> | 2022-07-05 10:05:44 +0000 |
commit | 2bdf4798570222b57af2de2f0b443529abdc3feb (patch) | |
tree | 6c6415598e41eb0686a9d0fc0225b631ab867935 /src/conf_mode/dns_forwarding.py | |
parent | 7a09c9d4b3d74fd0c953f9f097ffecf4af8683d3 (diff) | |
download | vyos-1x-2bdf4798570222b57af2de2f0b443529abdc3feb.tar.gz vyos-1x-2bdf4798570222b57af2de2f0b443529abdc3feb.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
Diffstat (limited to 'src/conf_mode/dns_forwarding.py')
-rwxr-xr-x | src/conf_mode/dns_forwarding.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/conf_mode/dns_forwarding.py b/src/conf_mode/dns_forwarding.py index 41023c135..a96183b04 100755 --- a/src/conf_mode/dns_forwarding.py +++ b/src/conf_mode/dns_forwarding.py @@ -266,6 +266,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 ('authoritative_zone_errors' in dns) and dns['authoritative_zone_errors']: for error in dns['authoritative_zone_errors']: print(error) |