Page MenuHomePhabricator

l2tpv3 instance not reconfigured when changing session-id or tunnel-id parameters
Closed, ResolvedPublic


When I delete or change configuration of a l2tpv3 interface, it is not applied to the linux interface.

For instance, if I want to change l2tpv3 parameters, I have to

  1. delete the interface (delete interface l2tpv3 l2tpethxx) then commit
  2. delete interface at linux level (ip l2tp del tunnel tunnel_id xx)
  3. Recreate the l2tpv3 interface with the new parameters.

Otherwhise the old linux l2tpv3 interface is left configured and the GUI is in an incorrect state (complain about the interface already exist...).

L2tpv3 configuration used:
set interfaces l2tpv3 l2tpeth1 bridge-group bridge 'br1'
set interfaces l2tpv3 l2tpeth1 destination-port '5001'
set interfaces l2tpv3 l2tpeth1 encapsulation 'udp'
set interfaces l2tpv3 l2tpeth1 local-ip 'xxxx'
set interfaces l2tpv3 l2tpeth1 mtu '1500'
set interfaces l2tpv3 l2tpeth1 peer-session-id '100'
set interfaces l2tpv3 l2tpeth1 peer-tunnel-id '1'
set interfaces l2tpv3 l2tpeth1 remote-ip 'xxxx'
set interfaces l2tpv3 l2tpeth1 session-id '100'
set interfaces l2tpv3 l2tpeth1 source-port '5001'
set interfaces l2tpv3 l2tpeth1 tunnel-id '1'


Difficulty level
Normal (likely a few hours)
thomas.courbon renamed this task from l2tpv3 instace not reconfigurer when changing parameters to l2tpv3 instance not reconfigured when changing parameters .

@dmbaturin @EwaldvanGeffen @UnicronNL
can we maybe automate this to produce workaround?

More explanation about the bug.

When the parameter are changed and commited. Nothing is done on the l2tpv3 interface (Example : change remote-ip parameter. Then check result with 'linux sudo ip l2tp show tunnel')

Then logical workaround would be to delete and recreate the interface.
But in this case the delete command is not effective.
And commiting the "recreate" is rejected because the l2tpv3 interface exists.

BTW are there any page that helps to understand the vyos template system ?


@thomas.courbon I think we fixed a similar bug before, but it seems the fix wasn't quite complete...

If you want to work on it, check out and
Template syntax is somewhat fragile, but you can usually find another command that does what you want and see how it's done there.

The L2TPv3 templates are in the vyatta-cfg-system submodule,

thomas.courbon added a comment.EditedDec 5 2016, 11:55 AM

Hi thanks for the links.

I don't have a lab platform to test right now. But I think there are 3 typos that explain the bug in nodes.def line 51 and 54:

if [ -n "$VAR(./tunnel-id@/)" ] && [ -n "$VAR(./session-id@/)" ] ; then
  ip l2tp del session $VAR(./tunnel-id/@) session_id $VAR(./session-id/@)

With ./tunnel-id@/ and ./tunnel-id/@. Same for session-id.

syncer assigned this task to UnicronNL.Aug 21 2017, 2:47 AM
syncer changed the edit policy from "Public (No Login Required)" to "Custom Policy".
syncer edited projects, added VyOS 1.1.x (1.1.8); removed VyOS 1.1.x.
syncer edited subscribers, added: Maintainers; removed: syncer, VyOS 1.1.x, dmbaturin, UnicronNL.
This comment was removed by syncer.

@UnicronNL can we fix and include this in 1.1.8 ?

dmbaturin closed this task as Resolved.Oct 12 2017, 5:51 AM

Well spotted! Fixed the typos.

dmbaturin renamed this task from l2tpv3 instance not reconfigured when changing parameters to l2tpv3 instance not reconfigured when changing session-id or tunnel-id parameters .Oct 12 2017, 5:53 AM