Page MenuHomeVyOS Platform

ifconfig.py - apply interface config takes long
Closed, InvalidPublicFEATURE REQUEST

Description

wg interfaces have no up/down op status, but the interface script needs to call set_state(self, state) to execute ip link up wg.. which is an administrative link up, not an operational.

320         while self.get_state() != state:
    321             cnt += 1
    322             if cnt == 50:
    323                 print('Interface {} could not be brought up in time ...'.format(self._ifname))
    324                 break
    325 
    326             # sleep 250ms
    327             sleep(0.250)

Causes the delay, since the wg interface will allways have state unknown.

(up) wg0: <POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1420 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
vs
(down) wg0: <POINTOPOINT,NOARP> mtu 1420 qdisc noqueue state DOWN mode DEFAULT group default qlen 1000

vyos@wg02# commit
[ interfaces wireguard wg0 ]
Interface wg0 could not be brought up in time ...

Details

Difficulty level
Unknown (require assessment)
Version
-
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Bug (incorrect behavior)

Event Timeline

DEBUG/wg0    cmd 'ip link add dev wg0 type wireguard'
DEBUG/wg0    cmd 'ip addr add "10.100.100.1/32" dev "wg0"'
DEBUG/wg0    cmd 'ip addr add "2001:db8::1/128" dev "wg0"'
DEBUG/wg0    write '1420' > '/sys/class/net/wg0/mtu'
DEBUG/wg0    write 'wg0' > '/sys/class/net/wg0/ifalias'
DEBUG/wg0    cmd 'wg set wg0 listen-port 12345 fwmark 0 private-key /config/auth/wireguard/default/private.key peer G1aA2KkyFyC8xsCUeENvuIW8HC5yDxwi902nR20592Y=  preshared-key /dev/null  allowed-ips 0.0.0.0/0,::/0 endpoint 10.1.1.201:12345 persistent-keepalive 0'
DEBUG/wg0    cmd 'ip link set dev wg0 up'
DEBUG/wg0    read 'unknown' < '/sys/class/net/wg0/operstate'
DEBUG/wg0    read 'unknown' < '/sys/class/net/wg0/operstate'
[...]
Interface wg0 could not be brought up in time ...
hagbard claimed this task.

looks like i had an old version, newer iso doesn't show that issue.

erkin set Issue type to Bug (incorrect behavior).Aug 31 2021, 6:10 PM