summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorsever-sever <v.gletenko@vyos.io>2021-01-10 16:35:09 +0000
committersever-sever <v.gletenko@vyos.io>2021-01-10 16:35:09 +0000
commit0a7fc50a5aa686552ceb787349f953ea1e0ebd1a (patch)
tree3ca74f8fc67a7ecd649b7c4bb5e95bbc3c1e6119 /python
parentef6d9333c9b985bef6ca662bcae56044cded76a1 (diff)
downloadvyos-1x-0a7fc50a5aa686552ceb787349f953ea1e0ebd1a.tar.gz
vyos-1x-0a7fc50a5aa686552ceb787349f953ea1e0ebd1a.zip
tunnel: T3173: Add nopmtudisc parameter for tunnels conf-mode
Diffstat (limited to 'python')
-rw-r--r--python/vyos/ifconfig/tunnel.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/python/vyos/ifconfig/tunnel.py b/python/vyos/ifconfig/tunnel.py
index 00dc36420..8ecb59755 100644
--- a/python/vyos/ifconfig/tunnel.py
+++ b/python/vyos/ifconfig/tunnel.py
@@ -72,16 +72,22 @@ class _Tunnel(Interface):
# add " option-name option-name-value ..." for all options set
options = " ".join(["{} {}".format(k, self.config[k])
- for k in self.options if k in self.config and self.config[k]])
+ for k in self.options if k in self.config and self.config[k] and k is not 'pmtud'])
self._cmd('{} {}'.format(create.format(**self.config), options))
self.set_admin_state('down')
def change_options(self):
- change = 'ip tunnel cha {ifname} mode {type}'
+ change = 'ip tunnel cha {ifname} mode {type} pmtudisc'
# add " option-name option-name-value ..." for all options set
+ # option 'pmtud' doesn't has any value like 'ttl' or 'key' (ip tunnel cha tunX [no]pmtudisc)
options = " ".join(["{} {}".format(k, self.config[k])
- for k in self.options if k in self.config and self.config[k]])
+ for k in self.options if k in self.config and self.config[k] and k is not 'pmtud'])
+
+ # set interfaces tunnel tunX parameters ip pmtu-discovery disable
+ if 'disable' in self.config['pmtud']:
+ change = 'ip tunnel cha {ifname} mode {type} nopmtudisc'
+
self._cmd('{} {}'.format(change.format(**self.config), options))
@classmethod
@@ -142,7 +148,7 @@ class GREIf(_Tunnel):
"""
default = {'type': 'gre'}
- options = ['local', 'remote', 'dev', 'ttl', 'tos', 'key']
+ options = ['local', 'remote', 'dev', 'ttl', 'tos', 'key', 'pmtud']
# GreTap also called GRE Bridge
class GRETapIf(_Tunnel):