diff options
author | Christian Poessinger <christian@poessinger.com> | 2021-01-15 17:20:44 +0100 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2021-01-15 17:20:44 +0100 |
commit | 2ae13c35257f73a9870ec655d55427ad30d6efdb (patch) | |
tree | 01df442136f97487143fa016065d7eed7a25f1d3 | |
parent | 9c810c6e68b161d1bf01ad5533ed7ebe4ebc0ae6 (diff) | |
parent | 0a7fc50a5aa686552ceb787349f953ea1e0ebd1a (diff) | |
download | vyos-1x-2ae13c35257f73a9870ec655d55427ad30d6efdb.tar.gz vyos-1x-2ae13c35257f73a9870ec655d55427ad30d6efdb.zip |
Merge branch 'T3173' of https://github.com/sever-sever/vyos-1x into pmtu
* 'T3173' of https://github.com/sever-sever/vyos-1x:
tunnel: T3173: Add nopmtudisc parameter for tunnels conf-mode
-rw-r--r-- | interface-definitions/interfaces-tunnel.xml.in | 19 | ||||
-rwxr-xr-x | src/conf_mode/interfaces-tunnel.py | 6 |
2 files changed, 25 insertions, 0 deletions
diff --git a/interface-definitions/interfaces-tunnel.xml.in b/interface-definitions/interfaces-tunnel.xml.in index 3a4db6f09..273aa648e 100644 --- a/interface-definitions/interfaces-tunnel.xml.in +++ b/interface-definitions/interfaces-tunnel.xml.in @@ -177,6 +177,25 @@ <help>IPv4 specific tunnel parameters</help> </properties> <children> + <leafNode name="pmtu-discovery"> + <properties> + <help>Path MTU Discovery parameters</help> + <completionHelp> + <list>disable enable</list> + </completionHelp> + <valueHelp> + <format>disable</format> + <description>Disable Path MTU Discovery for tunnel</description> + </valueHelp> + <valueHelp> + <format>enable</format> + <description>Enable Path MTU Discovery for tunnel (by default)</description> + </valueHelp> + <constraint> + <regex>^(disable|enable)$</regex> + </constraint> + </properties> + </leafNode> <leafNode name="ttl"> <properties> <help>Time to live field</help> 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', |