Page MenuHomeVyOS Platform

Trying to create more than one tunnel of the same type to the same address causes unhandled exception
Closed, ResolvedPublicBUG

Description

If you create, say, a GRE tunnel between 192.0.2.1 and 203.0.113.1, then try to create another one with the same protocol and endpoints, the commit failure is quite unexpected.

vyos@r1# commit
[ interfaces tunnel tun11 ]
VyOS had an issue completing a command.

...

Traceback (most recent call last):
  File "/usr/libexec/vyos/conf_mode/interfaces-tunnel.py", line 195, in <module>
    apply(c)
  File "/usr/libexec/vyos/conf_mode/interfaces-tunnel.py", line 185, in apply
    tun = TunnelIf(**tunnel)
  File "/usr/lib/python3/dist-packages/vyos/ifconfig/tunnel.py", line 109, in __init__
    super().__init__(ifname, **kargs)
  File "/usr/lib/python3/dist-packages/vyos/ifconfig/interface.py", line 318, in __init__
    self._create()
  File "/usr/lib/python3/dist-packages/vyos/ifconfig/tunnel.py", line 134, in _create
    self._cmd(cmd.format(**self.config))
  File "/usr/lib/python3/dist-packages/vyos/ifconfig/control.py", line 52, in _cmd
    return cmd(command, self.debug)
  File "/usr/lib/python3/dist-packages/vyos/util.py", line 161, in cmd
    raise OSError(code, feedback)
PermissionError: [Errno 1] failed to run command: ip tunnel add tun11 mode ip6gre local 2001:db8:1::1 remote 2001:db8:1::2 tos inherit ttl 64 encaplimit 4 flowlabel inherit hoplimit 64 tclass inherit
returned: 
exit code: 1

noteworthy:
cmd 'ip tunnel add tun11 mode ip6gre local 2001:db8:1::1 remote 2001:db8:1::2 tos inherit ttl 64 encaplimit 4 flowlabel inherit hoplimit 64 tclass inherit'
returned (out):

returned (err):
add tunnel "ip6gre0" failed: No buffer space available

[[interfaces tunnel tun11]] failed
Commit failed
[edit interfaces]

Such configs are certainly invalid, but we need to do something about the error message.

Details

Difficulty level
Unknown (require assessment)
Version
1.3.2
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Perfectly compatible
Issue type
Bug (incorrect behavior)

Related Objects

Mentioned In
1.3.4

Event Timeline

Viacheslav claimed this task.
Viacheslav added a subscriber: Viacheslav.

Fixed VyOS 1.3-stable-202308240442

set interfaces tunnel tun1 encapsulation 'gre'
set interfaces tunnel tun1 remote '203.0.113.254'
set interfaces tunnel tun1 source-address '203.0.113.1'

set interfaces tunnel tun2 encapsulation 'gre'
set interfaces tunnel tun2 remote '203.0.113.254'
set interfaces tunnel tun2 source-address '203.0.113.1'

commit

vyos@r1# commit
[ interfaces tunnel tun1 ]
Missing required "ip key" parameter when running more then one GRE based
tunnel on the same source-interface/source-address

[[interfaces tunnel tun1]] failed
[ interfaces tunnel tun2 ]
Missing required "ip key" parameter when running more then one GRE based
tunnel on the same source-interface/source-address

[[interfaces tunnel tun2]] failed
Commit failed
[edit]
vyos@r1#