From 0a7fc50a5aa686552ceb787349f953ea1e0ebd1a Mon Sep 17 00:00:00 2001 From: sever-sever Date: Sun, 10 Jan 2021 16:35:09 +0000 Subject: tunnel: T3173: Add nopmtudisc parameter for tunnels conf-mode --- src/conf_mode/interfaces-tunnel.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/conf_mode/interfaces-tunnel.py b/src/conf_mode/interfaces-tunnel.py index ffeb57784..f79405388 100755 --- a/src/conf_mode/interfaces-tunnel.py +++ b/src/conf_mode/interfaces-tunnel.py @@ -126,6 +126,11 @@ def verify(tunnel): if 'source_interface' in tunnel: verify_interface_exists(tunnel['source_interface']) + # ttl != 0 and nopmtudisc are incompatible + if 'pmtu_discovery' in tunnel['parameters']['ip']: + if 'disable' in tunnel['parameters']['ip']['pmtu_discovery'] and "0" not in tunnel['parameters']['ip']['ttl']: + raise ConfigError('ip ttl should be set to "0" with option "pmtu-discovery disable"') + def generate(tunnel): return None @@ -164,6 +169,7 @@ def apply(tunnel): 'local_ip' : 'local', 'remote_ip' : 'remote', 'source_interface' : 'dev', + 'parameters.ip.pmtu_discovery' : 'pmtud', 'parameters.ip.ttl' : 'ttl', 'parameters.ip.tos' : 'tos', 'parameters.ip.key' : 'key', -- cgit v1.2.3