summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2023-02-23 20:21:48 +0100
committerGitHub <noreply@github.com>2023-02-23 20:21:48 +0100
commitaa693e13db22ef0388bb5a1e6f9256b4edaa146f (patch)
treeb35c98166c44b78e4fbdf8a4e6a2e4bd134faa5e
parent22d1d865358198fc7d1847499162a629105fe6ba (diff)
parent05d0f593bbfe9c85c690f6e4cddfb257a835906e (diff)
downloadvyos-1x-aa693e13db22ef0388bb5a1e6f9256b4edaa146f.tar.gz
vyos-1x-aa693e13db22ef0388bb5a1e6f9256b4edaa146f.zip
Merge pull request #1843 from sever-sever/T5007-eq
T5007: Fix multicast implementation for the tunnel interfaces
-rw-r--r--python/vyos/ifconfig/tunnel.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/python/vyos/ifconfig/tunnel.py b/python/vyos/ifconfig/tunnel.py
index 5258a2cb1..f776240a1 100644
--- a/python/vyos/ifconfig/tunnel.py
+++ b/python/vyos/ifconfig/tunnel.py
@@ -162,6 +162,15 @@ class TunnelIf(Interface):
""" Get a synthetic MAC address. """
return self.get_mac_synthetic()
+ def set_multicast(self):
+ """ Set multicast """
+ if self.config.get('multicast', 'disable') == 'enable':
+ cmd = 'ip link set dev {ifname} multicast on'
+ else:
+ cmd = 'ip link set dev {ifname} multicast off'
+
+ self._cmd(cmd.format(**self.config))
+
def update(self, config):
""" General helper function which works on a dictionary retrived by
get_config_dict(). It's main intention is to consolidate the scattered
@@ -170,5 +179,8 @@ class TunnelIf(Interface):
# Adjust iproute2 tunnel parameters if necessary
self._change_options()
+ # Add multicast
+ self.set_multicast()
+
# call base class first
super().update(config)