Page MenuHomeVyOS Platform

Some custom sysctl parameters can't be applied bug
Closed, ResolvedPublicBUG

Description

Some sysctl custom parameters can't be applied in one commit.
For example, if the tunnel interface does not exist yet.
1.3:

set interfaces ethernet eth1 address '203.0.113.1/24'

set interfaces tunnel tun0 address '100.64.0.1/30'
set interfaces tunnel tun0 encapsulation gretap
set interfaces tunnel tun0 source-address '203.0.113.1'
set interfaces tunnel tun0 mtu '1500'
set interfaces tunnel tun0 multicast 'enable'
set interfaces tunnel tun0 parameters ip ttl '64'
set interfaces tunnel tun0 remote '203.0.113.2'
set system sysctl custom net.ipv4.conf.tun0.accept_local value '1'

[email protected]# commit
[ system sysctl custom net.ipv4.conf.tun0.accept_local value 1 ]
Use of uninitialized value $ovalue in string ne at /opt/vyatta/sbin/vyatta_update_sysctl.pl line 65.
sysctl: cannot stat /proc/sys/net/ipv4/conf/tun0/accept_local: No such file or directory
exec of /sbin/sysctl failed: '/sbin/sysctl -w net.ipv4.conf.tun0.accept_local="1" 2>&1> /dev/null' at /opt/vyatta/sbin/vyatta_update_sysctl.pl line 69.

[[system sysctl custom net.ipv4.conf.tun0.accept_local value]] failed
Commit failed
[edit]
[email protected]#

1.4:

set interfaces ethernet eth1 address '203.0.113.1/24'
set interfaces tunnel tun0 address '100.64.0.1/30'
set interfaces tunnel tun0 encapsulation gretap
set interfaces tunnel tun0 source-address '203.0.113.1'
set interfaces tunnel tun0 mtu '1500'
set interfaces tunnel tun0 multicast 'enable'
set interfaces tunnel tun0 parameters ip ttl '64'
set interfaces tunnel tun0 remote '203.0.113.2'
set system sysctl parameter net.ipv4.conf.tun0.accept_local value '1'

vyos@r1-roll# set system sysctl parameter net.ipv4.conf.tun0.accept_local value '1'

  
  
  
  Invalid value
  Value validation failed
  Set failed

[edit]

Details

Difficulty level
Easy (less than an hour)
Version
VyOS 1.3-beta-202109080342, VyOS 1.4-rolling-202109061053
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Unspecified (please specify)

Event Timeline

Viacheslav changed Version from VyOS 1.3-beta-202109080342 to VyOS 1.3-beta-202109080342, VyOS 1.4-rolling-202109061053.
Viacheslav updated the task description. (Show Details)

That would only work if accept_local will be added as proper CLI node on the tunnel interface, or use set system sysctl parameter net.ipv4.conf.default.accept_local value '1'

see also T3195

I think it should check this parameter per commit and it is a bug with validation as we don't have a tunnel interface yet
But after commit it will be valid value

Viacheslav claimed this task.

Fixed in 1.3.5

vyos@r1# set interfaces ethernet eth1 address '203.0.113.1/24'
[edit]
vyos@r1# 
[edit]
vyos@r1# set interfaces tunnel tun0 address '100.64.0.1/30'
[edit]
vyos@r1# set interfaces tunnel tun0 encapsulation gretap
[edit]
vyos@r1# set interfaces tunnel tun0 source-address '203.0.113.1'
[edit]
vyos@r1# set interfaces tunnel tun0 mtu '1500'
[edit]
vyos@r1# set interfaces tunnel tun0 multicast 'enable'
[edit]
vyos@r1# set interfaces tunnel tun0 parameters ip ttl '64'
[edit]
vyos@r1# set interfaces tunnel tun0 remote '203.0.113.2'
[edit]
vyos@r1# set system sysctl custom net.ipv4.conf.tun0.accept_local value '1'
[edit]
vyos@r1# commit
[edit]
vyos@r1# sudo sysctl net.ipv4.conf.tun0.accept_local
net.ipv4.conf.tun0.accept_local = 1
[edit]
vyos@r1#