diff options
author | Christian Poessinger <christian@poessinger.com> | 2021-01-12 18:18:51 +0100 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2021-01-12 18:19:41 +0100 |
commit | 09cb9ca80113455b738151a3a8d465fd3998ab21 (patch) | |
tree | 7dabffe501f6d1c120ef721906304d41d590b150 /python/vyos | |
parent | bf68f26c2af3f9a6cd023d538a951a29f3c6d18e (diff) | |
download | vyos-1x-09cb9ca80113455b738151a3a8d465fd3998ab21.tar.gz vyos-1x-09cb9ca80113455b738151a3a8d465fd3998ab21.zip |
tunnel: T3205: bugfix gre-bridge interfaces
(cherry picked from commit 138e7a95c21fb2928182847693e366644be6e945)
Diffstat (limited to 'python/vyos')
-rw-r--r-- | python/vyos/ifconfig/tunnel.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/python/vyos/ifconfig/tunnel.py b/python/vyos/ifconfig/tunnel.py index 00dc36420..1af4f8e72 100644 --- a/python/vyos/ifconfig/tunnel.py +++ b/python/vyos/ifconfig/tunnel.py @@ -63,21 +63,21 @@ class _Tunnel(Interface): }, }} + _create_cmd = 'ip tunnel add {ifname} mode {type}' + def __init__(self, ifname, **config): self.config = deepcopy(config) if config else {} super().__init__(ifname, **config) def _create(self): - create = 'ip tunnel add {ifname} mode {type}' - # 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]]) - self._cmd('{} {}'.format(create.format(**self.config), options)) + self._cmd('{} {}'.format(self._create_cmd.format(**self.config), options)) self.set_admin_state('down') def change_options(self): - change = 'ip tunnel cha {ifname} mode {type}' + change = 'ip tunnel change {ifname} mode {type}' # add " option-name option-name-value ..." for all options set options = " ".join(["{} {}".format(k, self.config[k]) @@ -164,6 +164,11 @@ class GRETapIf(_Tunnel): default = {'type': 'gretap'} options = ['local', 'remote', 'ttl',] + _create_cmd = 'ip link add name {ifname} type {type}' + + def change_options(self): + pass + class IP6GREIf(_Tunnel): """ IP6Gre: IPv6 Support for Generic Routing Encapsulation (GRE) |