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:18:51 +0100 |
commit | 138e7a95c21fb2928182847693e366644be6e945 (patch) | |
tree | be757de3631c1544be7d00f2d16b2604d18caf11 /python/vyos/ifconfig/tunnel.py | |
parent | 7b45f5afb718233f99635b86421130c7d3a920ae (diff) | |
download | vyos-1x-138e7a95c21fb2928182847693e366644be6e945.tar.gz vyos-1x-138e7a95c21fb2928182847693e366644be6e945.zip |
tunnel: T3205: bugfix gre-bridge interfaces
Diffstat (limited to 'python/vyos/ifconfig/tunnel.py')
-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) |