Original issue https://forum.vyos.io/t/vxlan-doesnt-allow-for-setting-source-interface-on-unicast-configurations
Bug1
For VXLAN over ipv6 wee needs to add source-interface without declaring a multicast group
For example
vyos@r4-1.3# sudo ip link add vxlan11 type vxlan id 11 dstport 8472 ttl 16 local fe80::3 remote fe80::2 Error: Local interface required for link-local local/remote addresses. vyos@r4-1.3# sudo ip link add vxlan22 type vxlan id 22 dstport 8472 ttl 16 local fe80::3 remote fe80::2 dev eth0 [edit] vyos@r4-1.3#
VyOS config:
set interface vxlan vxlan0 vni 0 set interface vxlan vxlan0 source-address fe80::3 set interface vxlan vxlan0 remote fe80::2 set interface vxlan vxlan0 source-interface eth0 vyos@r4-1.3# commit WARNING: RFC7348 recommends VXLAN tunnels preserve a 1500 byte MTU VXLAN "vxlan0" is missing mandatory underlay multicastgroup or source interface for a multicast network. [[interfaces vxlan vxlan0]] failed
But source-interface not added in options separately without multicast group (in the checks)
https://github.com/vyos/vyos-1x/blob/d108943a8e165cbb5d233f2e1edf14383a453aa8/python/vyos/ifconfig/vxlan.py#L81-L89
In the test, I change these checks to
diff --git a/python/vyos/ifconfig/vxlan.py b/python/vyos/ifconfig/vxlan.py index 03c4d4db..2cff21f0 100644 --- a/python/vyos/ifconfig/vxlan.py +++ b/python/vyos/ifconfig/vxlan.py @@ -79,8 +79,9 @@ class VXLANIf(Interface): cmdline.append('remote') if self.config['group'] or self.config['source_interface']: - if self.config['group'] and self.config['source_interface']: + if self.config['group']: cmdline.append('group') + if self.config['source_interface']: cmdline.append('source_interface') else: ifname = self.config['ifname']
Bug2 Mtu
Interface created fine, but for ipv6 it is trying to set incorrect mtu parameter
vyos@r4-1.3# commit [ interfaces vxlan vxlan0 ] WARNING: RFC7348 recommends VXLAN tunnels preserve a 1500 byte MTU {'ifname': 'vxlan0', 'ip': {'arp_cache_timeout': '30'}, 'mtu': '1450', 'port': '8472', 'remote': 'fe80::2', 'source_address': 'fe80::3', 'source_interface': 'eth0', 'vni': '0'} DEBUG: Source detected DEBUG: Remote detected DEBUG: Source Interface detected DEBUG: ip link add vxlan0 type vxlan id 0 dstport 8472 ttl 16 local fe80::3 remote fe80::2 dev eth0 VyOS had an issue completing a command. Traceback (most recent call last): File "/usr/libexec/vyos/conf_mode/interfaces-vxlan.py", line 118, in <module> apply(c) File "/usr/libexec/vyos/conf_mode/interfaces-vxlan.py", line 108, in apply v.update(vxlan) File "/usr/lib/python3/dist-packages/vyos/ifconfig/interface.py", line 1199, in update self.set_mtu(config.get('mtu')) File "/usr/lib/python3/dist-packages/vyos/ifconfig/interface.py", line 359, in set_mtu return self.set_interface('mtu', mtu) File "/usr/lib/python3/dist-packages/vyos/ifconfig/control.py", line 184, in set_interface return self._set_command(self.config, name, value) File "/usr/lib/python3/dist-packages/vyos/ifconfig/control.py", line 109, in _set_command return self._command_set[name].get('format', lambda _: _)(self._cmd(cmd)) File "/usr/lib/python3/dist-packages/vyos/ifconfig/control.py", line 51, in _cmd return cmd(command, self.debug) File "/usr/lib/python3/dist-packages/vyos/util.py", line 161, in cmd raise OSError(code, feedback) FileNotFoundError: [Errno 2] failed to run command: ip link set dev vxlan0 mtu 1450 returned: exit code: 2 noteworthy: cmd 'ip link set dev vxlan0 mtu 1450' returned (out): returned (err): RTNETLINK answers: Invalid argument [[interfaces vxlan vxlan0]] failed
Manual addition:
vyos@r4-1.3# sudo ip link add vxlan44 type vxlan id 44 dstport 8472 ttl 16 local fe80::3 remote fe80::2 dev eth0 [edit] vyos@r4-1.3# sudo ip link set dev vxlan0 mtu 1450 RTNETLINK answers: Invalid argument [edit] vyos@r4-1.3# vyos@r4-1.3# sudo ip link set dev vxlan0 mtu 1430 [edit] vyos@r4-1.3#