Page MenuHomeVyOS Platform

VXLAN not accept ipv6 and source-interface options and mtu bug
Closed, ResolvedPublicBUG

Description

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#

Details

Version
VyOS 1.3.0-rc5
Is it a breaking change?
Unspecified (possibly destroys the router)

Event Timeline

PR for 1.3 https://github.com/vyos/vyos-1x/pull/925
PR for 1.4 https://github.com/vyos/vyos-1x/pull/926

vyos@r4-1.3# set interface vxlan vxlan0 vni 0
[edit]
vyos@r4-1.3# set interface vxlan vxlan0 source-address fe80::3
[edit]
vyos@r4-1.3# set interface vxlan vxlan0 remote fe80::2
[edit]
vyos@r4-1.3# set interface vxlan vxlan0 source-interface eth0
[edit]
vyos@r4-1.3# commit
[ interfaces vxlan vxlan0 ]
WARNING: RFC7348 recommends VXLAN tunnels preserve a 1500 byte MTU

[edit]
vyos@r4-1.3# sudo ip -d link show dev vxlan0
19: vxlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1430 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/ether 1e:37:2f:98:ea:b2 brd ff:ff:ff:ff:ff:ff promiscuity 0 minmtu 68 maxmtu 65535 
    vxlan id 0 remote fe80::2 local fe80::3 dev eth0 srcport 0 0 dstport 8472 ttl 16 ageing 300 udpcsum noudp6zerocsumtx noudp6zerocsumrx addrgenmode none numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535 
[edit]

@c-po It seems doesn't work

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

Commit

vyos@r5-1.3-myb# commit
WARNING: RFC7348 recommends VXLAN tunnels preserve a 1500 byte MTU

Underlaying device MTU is to small (1500 bytes) for VXLAN overhead (70 bytes!)

[[interfaces vxlan vxlan0]] failed
Commit failed
[edit]
vyos@r5-1.3-myb# 
[edit]
vyos@r5-1.3-myb# run show ver

Version:          VyOS None
Release Train:    equuleus

Built by:         Viacheslav Hletenko
Built on:         Tue 20 Jul 2021 06:57 UTC
Build UUID:       d1b85175-21f8-46e6-8bae-4e21ae753761
Build Commit ID:  414f931a3d4035

Now installing mtu is a required parameter?

Also, the bug still present, fix for which I sent above in diff

vyos@r5-1.3-myb# compare 
[edit interfaces]
+vxlan vxlan0 {
+    mtu 1430
+    remote fe80::2
+    source-address fe80::3
+    source-interface eth0
+    vni 0
+}
[edit]
vyos@r5-1.3-myb# 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
Commit failed
[edit]
vyos@r5-1.3-myb#

PR https://github.com/vyos/vyos-1x/pull/933

vyos@r4-1.3# set interfaces vxlan vxlan0 mtu '1430'
[edit]
vyos@r4-1.3# set interfaces vxlan vxlan0 remote 'fe80::2'
[edit]
vyos@r4-1.3# set interfaces vxlan vxlan0 source-address 'fe80::3'
[edit]
vyos@r4-1.3# set interfaces vxlan vxlan0 source-interface 'eth0'
[edit]
vyos@r4-1.3# set interfaces vxlan vxlan0 vni '0'
[edit]
vyos@r4-1.3# commit
[ interfaces vxlan vxlan0 ]
WARNING: RFC7348 recommends VXLAN tunnels preserve a 1500 byte MTU

[edit]
vyos@r4-1.3# sudo ip -d link show dev vxlan0
5: vxlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1430 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/ether 6e:a4:2b:c2:ee:1c brd ff:ff:ff:ff:ff:ff promiscuity 0 minmtu 68 maxmtu 65535 
    vxlan id 0 remote fe80::2 local fe80::3 dev eth0 srcport 0 0 dstport 8472 ttl 16 ageing 300 udpcsum noudp6zerocsumtx noudp6zerocsumrx addrgenmode none numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535 
[edit]
vyos@r4-1.3#
Viacheslav changed the task status from Open to Needs testing.Jul 23 2021, 9:01 AM
Viacheslav claimed this task.