Page MenuHomeVyOS Platform

l2tpv3 error on IPv6 local-ip
Closed, ResolvedPublicBUG

Description

Hi,

It is unclear, but the auto complete allows the usage of IPv6 onto L2TPv3 and commiting does not give any errors. However after that the interface is broken and does not come online. As a result i cannot delete it afterwords:

[ interfaces l2tpv3 l2tpeth1010 ]
RTNETLINK answers: No such device
RTNETLINK answers: No such device

delete [ interfaces l2tpv3 l2tpeth1010 ] failed
Commit failed

to reproduce, us the example from manual and replace local/remote IP's with IPv6.

Details

Difficulty level
Unknown (require assessment)
Version
1.2.0-rolling+201908030337
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)

Event Timeline

syncer triaged this task as Low priority.
syncer edited projects, added VyOS 1.3 Equuleus; removed VyOS 1.2 Crux.

Hello @kruisdraad . I trying to reproduce this issue, but without success. Tunnel works.

set interfaces l2tpv3 l2tpeth1010 address '192.168.37.2/27'
set interfaces l2tpv3 l2tpeth1010 encapsulation 'ip'
set interfaces l2tpv3 l2tpeth1010 local-ip '2001:db8::2'
set interfaces l2tpv3 l2tpeth1010 peer-session-id '100'
set interfaces l2tpv3 l2tpeth1010 peer-tunnel-id '200'
set interfaces l2tpv3 l2tpeth1010 remote-ip '2001:db8::1'
set interfaces l2tpv3 l2tpeth1010 session-id '100'
set interfaces l2tpv3 l2tpeth1010 tunnel-id '200'

Can you provide show log tail 100 after creating l2tpv3?

@Dmitry

set interfaces ethernet eth1 address 2001:db8::2/64
set interfaces l2tpv3 l2tpeth1010 address '192.168.37.2/27'
set interfaces l2tpv3 l2tpeth1010 encapsulation 'ip'
set interfaces l2tpv3 l2tpeth1010 local-ip '2001:db8::2'
set interfaces l2tpv3 l2tpeth1010 peer-session-id '100'
set interfaces l2tpv3 l2tpeth1010 peer-tunnel-id '200'
set interfaces l2tpv3 l2tpeth1010 remote-ip '2001:db8::1'
set interfaces l2tpv3 l2tpeth1010 session-id '100'
set interfaces l2tpv3 l2tpeth1010 tunnel-id '200'

Commit

vyos@r4-roll# commit
[ interfaces l2tpv3 l2tpeth1010 ]
VyOS had an issue completing a command.

Report Time:      2020-10-19 21:03:30
Image Version:    VyOS 1.3-rolling-202010190146
Release Train:    equuleus

Built by:         autobuild@vyos.net
Built on:         Mon 19 Oct 2020 01:46 UTC
Build UUID:       7a4c54f4-5473-4e2c-b436-f0641444086c
Build Commit ID:  

Architecture:     x86_64
Boot via:         installed image
System type:      KVM guest

Hardware vendor:  QEMU
Hardware model:   Standard PC (Q35 + ICH9, 2009)
Hardware S/N:     
Hardware UUID:    43066a70-5576-4aaf-a84b-d76da37856e1

Traceback (most recent call last):
  File "/usr/libexec/vyos/conf_mode/interfaces-l2tpv3.py", line 130, in <module>
    apply(c)
  File "/usr/libexec/vyos/conf_mode/interfaces-l2tpv3.py", line 119, in apply
    l = L2TPv3If(l2tpv3['ifname'], **conf)
  File "/usr/lib/python3/dist-packages/vyos/ifconfig/interface.py", line 259, in __init__
    self._create()
  File "/usr/lib/python3/dist-packages/vyos/ifconfig/l2tpv3.py", line 62, in _create
    self._cmd(cmd.format(**self.config))
  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 179, in cmd
    raise OSError(code, feedback)
FileNotFoundError: [Errno 2] failed to run command: ip l2tp add tunnel tunnel_id 200 peer_tunnel_id 200 udp_sport 5000 udp_dport 5000 encap ip local 2001:db8::2 remote 2001:db8::1
returned: 
exit code: 2

noteworthy:
cmd 'ip l2tp add tunnel tunnel_id 200 peer_tunnel_id 200 udp_sport 5000 udp_dport 5000 encap ip local 2001:db8::2 remote 2001:db8::1'
returned (out):

returned (err):
RTNETLINK answers: Cannot assign requested address

[[interfaces l2tpv3 l2tpeth1010]] failed
Commit failed
[edit]
vyos@r4-roll#

The second commit works without errors.

dmbaturin set Is it a breaking change? to Unspecified (possibly destroys the router).

Config to reproduce in 1.4

set interfaces ethernet eth1 address 2001:db8::2/64
set interfaces l2tpv3 l2tpeth1010 address '192.168.37.2/27'
set interfaces l2tpv3 l2tpeth1010 encapsulation 'ip'
set interfaces l2tpv3 l2tpeth1010 source-address 2001:db8::2
set interfaces l2tpv3 l2tpeth1010 peer-session-id '100'
set interfaces l2tpv3 l2tpeth1010 peer-tunnel-id '200'
set interfaces l2tpv3 l2tpeth1010 remote 2001:db8::1
set interfaces l2tpv3 l2tpeth1010 session-id '100'
set interfaces l2tpv3 l2tpeth1010 tunnel-id '200'

commit

Traceback (most recent call last):
  File "/usr/libexec/vyos/conf_mode/interfaces-l2tpv3.py", line 105, in <module>
    apply(c)
  File "/usr/libexec/vyos/conf_mode/interfaces-l2tpv3.py", line 94, in apply
    l = L2TPv3If(**l2tpv3)
  File "/usr/lib/python3/dist-packages/vyos/ifconfig/interface.py", line 264, in __init__
    self._create()
  File "/usr/lib/python3/dist-packages/vyos/ifconfig/l2tpv3.py", line 46, in _create
    self._cmd(cmd.format(**self.config))
  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 l2tp add tunnel tunnel_id 200 peer_tunnel_id 200 udp_sport 5000 udp_dport 5000 encap ip local 2001:db8::2 remote 2001:db8::1
returned: 
exit code: 2

noteworthy:
cmd 'ip l2tp add tunnel tunnel_id 200 peer_tunnel_id 200 udp_sport 5000 udp_dport 5000 encap ip local 2001:db8::2 remote 2001:db8::1'
returned (out):

returned (err):
RTNETLINK answers: Cannot assign requested address

[[interfaces l2tpv3 l2tpeth1010]] failed
Commit failed
[edit]

It tries to add l2tp address before the ipv6 address was assigned on interface eth1.

vyos@r1-roll# sudo ip l2tp add tunnel tunnel_id 200 peer_tunnel_id 200 udp_sport 5000 udp_dport 5000 encap ip local 2001:db8::2 remote 2001:db8::1
RTNETLINK answers: Cannot assign requested address
[edit]
vyos@r1-roll# sudo ip a add 2001:db8::2/64 dev eth1
[edit]
vyos@r1-roll# sudo ip l2tp add tunnel tunnel_id 200 peer_tunnel_id 200 udp_sport 5000 udp_dport 5000 encap ip local 2001:db8::2 remote 2001:db8::1
[edit]
vyos@r1-roll#

it should be timeout ~1.8 sec between adding ipv6 address and create l2tp interface

root@r4-1:/home/vyos# sudo ip addr add "2001:db8::2/64" dev "eth1"
root@r4-1:/home/vyos# sudo ip l2tp add tunnel tunnel_id 200 peer_tunnel_id 200 udp_sport 5000 udp_dport 5000 encap ip local 2001:db8::2 remote 2001:db8::1
RTNETLINK answers: Cannot assign requested address
root@r4-1:/home/vyos#

Timeout 1.8

root@r4-1:/home/vyos# sudo ip addr add "2001:db8::2/64" dev "eth1"
root@r4-1:/home/vyos# sleep 1.8
root@r4-1:/home/vyos# sudo ip l2tp add tunnel tunnel_id 200 peer_tunnel_id 200 udp_sport 5000 udp_dport 5000 encap ip local 2001:db8::2 remote 2001:db8::1
root@r4-1:/home/vyos#

Timeout 1.5

root@r4-1:/home/vyos# sudo ip addr add "2001:db8::2/64" dev "eth1"
root@r4-1:/home/vyos# sleep 1.5
root@r4-1:/home/vyos# sudo ip l2tp add tunnel tunnel_id 200 peer_tunnel_id 200 udp_sport 5000 udp_dport 5000 encap ip local 2001:db8::2 remote 2001:db8::1
RTNETLINK answers: Cannot assign requested address
root@r4-1:/home/vyos# 
root@r4-1:/home/vyos#

Using timeouts is a pretty bad idea as they vary on the host CPU or utilisation of a hypervisor.

The underlay interface should rather be polled using a busy waiting loop which will work on all architectures/clock speeds or host CPU utilisation.