summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-03-03 20:35:21 +0100
committerChristian Poessinger <christian@poessinger.com>2021-03-03 20:35:21 +0100
commitd4c40adfeac4686174388878520138b640884c45 (patch)
treefe80a962055f9e5025c4be7955effd84d1810fad /python
parent1442762a153df454dad2f282da21c745c13610ce (diff)
downloadvyos-1x-d4c40adfeac4686174388878520138b640884c45.tar.gz
vyos-1x-d4c40adfeac4686174388878520138b640884c45.zip
tunnel: T2966: add ip6gretap encapsulation support
Diffstat (limited to 'python')
-rw-r--r--python/vyos/configverify.py4
-rw-r--r--python/vyos/ifconfig/tunnel.py6
2 files changed, 5 insertions, 5 deletions
diff --git a/python/vyos/configverify.py b/python/vyos/configverify.py
index db3e7cc57..7cf2cb8f9 100644
--- a/python/vyos/configverify.py
+++ b/python/vyos/configverify.py
@@ -109,7 +109,7 @@ def verify_tunnel(config):
if {'source_address', 'dhcp_interface'} <= set(config):
raise ConfigError('Can not use both source-address and dhcp-interface')
- if config['encapsulation'] in ['ipip6', 'ip6ip6', 'ip6gre', 'ip6erspan']:
+ if config['encapsulation'] in ['ipip6', 'ip6ip6', 'ip6gre', 'ip6gretap', 'ip6erspan']:
error_ipv6 = 'Encapsulation mode requires IPv6'
if 'source_address' in config and not is_ipv6(config['source_address']):
raise ConfigError(f'{error_ipv6} source-address')
@@ -124,7 +124,7 @@ def verify_tunnel(config):
if 'remote' in config and not is_ipv4(config['remote']):
raise ConfigError(f'{error_ipv4} remote address')
- if config['encapsulation'] in ['sit', 'gretap']:
+ if config['encapsulation'] in ['sit', 'gretap', 'ip6gretap']:
if 'source_interface' in config:
encapsulation = config['encapsulation']
raise ConfigError(f'Option source-interface can not be used with ' \
diff --git a/python/vyos/ifconfig/tunnel.py b/python/vyos/ifconfig/tunnel.py
index b9d5ab983..439d88dbc 100644
--- a/python/vyos/ifconfig/tunnel.py
+++ b/python/vyos/ifconfig/tunnel.py
@@ -94,7 +94,7 @@ class TunnelIf(Interface):
super().__init__(ifname, **kargs)
# The gretap interface has the possibility to act as L2 bridge
- if self.iftype == 'gretap':
+ if self.iftype in ['gretap', 'ip6gretap']:
# no multicast, ttl or tos for gretap
self.definition = {
**TunnelIf.definition,
@@ -111,7 +111,7 @@ class TunnelIf(Interface):
mapping = { **self.mapping, **self.mapping_ipv4 }
cmd = 'ip tunnel add {ifname} mode {encapsulation}'
- if self.iftype == 'gretap':
+ if self.iftype in ['gretap', 'ip6gretap']:
cmd = 'ip link add name {ifname} type {encapsulation}'
for vyos_key, iproute2_key in mapping.items():
# dict_search will return an empty dict "{}" for valueless nodes like
@@ -129,7 +129,7 @@ class TunnelIf(Interface):
def _change_options(self):
# gretap interfaces do not support changing any parameter
- if self.iftype == 'gretap':
+ if self.iftype in ['gretap', 'ip6gretap']:
return
if self.config['encapsulation'] in ['ipip6', 'ip6ip6', 'ip6gre']: