summaryrefslogtreecommitdiff
path: root/python/vyos/ifconfig/tunnel.py
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-04-05 23:23:14 +0200
committerChristian Poessinger <christian@poessinger.com>2021-04-05 23:23:14 +0200
commit44f766a7880e9264487e62f4aacc9f4f635219ed (patch)
treea518937a0c5fbd4891282cf0ef6b131dc9a99ea6 /python/vyos/ifconfig/tunnel.py
parentecf53662f75b2588977d449713f07d28bd0e24a6 (diff)
downloadvyos-1x-44f766a7880e9264487e62f4aacc9f4f635219ed.tar.gz
vyos-1x-44f766a7880e9264487e62f4aacc9f4f635219ed.zip
tunnel: T3030: move erspan type into regular tunnel interface
Instead of having a dedicated ERSPAN interface type, rather move the specifics into "interface tunnel". A migrator is not needed as there is yet no LTS release with this feature and this is considered experimental.
Diffstat (limited to 'python/vyos/ifconfig/tunnel.py')
-rw-r--r--python/vyos/ifconfig/tunnel.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/python/vyos/ifconfig/tunnel.py b/python/vyos/ifconfig/tunnel.py
index e5e1300b2..08854a3b0 100644
--- a/python/vyos/ifconfig/tunnel.py
+++ b/python/vyos/ifconfig/tunnel.py
@@ -63,6 +63,10 @@ class TunnelIf(Interface):
'parameters.ip.no_pmtu_discovery' : 'nopmtudisc',
'parameters.ip.tos' : 'tos',
'parameters.ip.ttl' : 'ttl',
+ 'parameters.erspan.direction' : 'erspan_dir',
+ 'parameters.erspan.hw_id' : 'erspan_hwid',
+ 'parameters.erspan.index' : 'erspan',
+ 'parameters.erspan.version' : 'erspan_ver',
}
mapping_ipv6 = {
'parameters.ipv6.encaplimit' : 'encaplimit',
@@ -113,8 +117,12 @@ class TunnelIf(Interface):
mapping = { **self.mapping, **self.mapping_ipv4 }
cmd = 'ip tunnel add {ifname} mode {encapsulation}'
- if self.iftype in ['gretap', 'ip6gretap']:
+ if self.iftype in ['gretap', 'ip6gretap', 'erspan', 'ip6erspan']:
cmd = 'ip link add name {ifname} type {encapsulation}'
+ # ERSPAN requires the serialisation of packets
+ if self.iftype in ['erspan', 'ip6erspan']:
+ cmd += ' seq'
+
for vyos_key, iproute2_key in mapping.items():
# dict_search will return an empty dict "{}" for valueless nodes like
# "parameters.nolearning" - thus we need to test the nodes existence
@@ -131,7 +139,7 @@ class TunnelIf(Interface):
def _change_options(self):
# gretap interfaces do not support changing any parameter
- if self.iftype in ['gretap', 'ip6gretap']:
+ if self.iftype in ['gretap', 'ip6gretap', 'erspan', 'ip6erspan']:
return
if self.config['encapsulation'] in ['ipip6', 'ip6ip6', 'ip6gre']: