You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm noticing a very weird situation with frr.service and networking.service.
There is a reason why frr.service should boot before the networking.service and before network.target which is triggered by networking.service?
My case: I have a lot of interfaces (67 of them) that needs to be prepared, like lo0, lo1 .. etc done via dummy.
My configuration has a default route in GRT which is using set src. And each time I'm rebooting the router, this default route is marked as r - rejected.
After troubleshooting the kernel messages using debug on FRR I found this:
Trying to find out why this happens only on boot, I've did a trace of ifupdown-ng on boot and I've compared the times with FRRouting service.
And this is the chain of events on booting:
2025-02-22T01:34:42.243481+02:00 R02 frrinit.sh[6807]: [6807|staticd] sending configuration
2025-02-22T01:34:59.396812+02:00 R02 networking[5561]: ifup: acquiring lock on /run/ifstate.lo0.lock
2025-02-22T01:34:59.396859+02:00 R02 networking[5561]: ifup: changing state of interface lo0 to 'up'
2025-02-22T01:34:59.396896+02:00 R02 networking[5561]: ifupdown: lo0: attempting to run link executor for phase create
2025-02-22T01:34:59.398237+02:00 R02 networking[10237]: + [ dummy = dummy ]
2025-02-22T01:34:59.398284+02:00 R02 networking[10237]: + [ ! -d /sys/module/dummy ]
2025-02-22T01:34:59.398320+02:00 R02 networking[10237]: + [ -z ]
2025-02-22T01:34:59.398369+02:00 R02 networking[10237]: + [ -d /sys/class/net/lo0 ]
2025-02-22T01:34:59.398405+02:00 R02 networking[10237]: + ip link add lo0 type dummy
2025-02-22T01:34:59.399855+02:00 R02 networking[5561]: ifupdown: lo0: attempting to run multi-loopback executor for phase create
2025-02-22T01:34:59.401118+02:00 R02 networking[10240]: + [ dummy = multi-loopback ]
2025-02-22T01:34:59.401237+02:00 R02 networking[5561]: ifupdown: lo0: attempting to run link executor for phase pre-up
2025-02-22T01:34:59.402437+02:00 R02 networking[5561]: ifupdown: lo0: attempting to run multi-loopback executor for phase pre-up
2025-02-22T01:34:59.405298+02:00 R02 networking[5561]: ifupdown: lo0: attempting to run link executor for phase up
2025-02-22T01:34:59.406410+02:00 R02 networking[10252]: + IF_LINK_OPTIONS=
2025-02-22T01:34:59.406442+02:00 R02 networking[10252]: + [ -n ]
2025-02-22T01:34:59.406479+02:00 R02 networking[10252]: + [ -n ]
2025-02-22T01:34:59.406500+02:00 R02 networking[10252]: + ip link set up dev lo0
2025-02-22T01:34:59.407524+02:00 R02 networking[10252]: + [ ]
2025-02-22T01:34:59.407724+02:00 R02 networking[5561]: ifupdown: lo0: attempting to run multi-loopback executor for phase up
2025-02-22T01:34:59.409032+02:00 R02 networking[10255]: + ip link set up dev lo0
2025-02-22T01:34:59.410145+02:00 R02 networking[10255]: + [ ]
2025-02-22T01:34:59.424585+02:00 R02 networking[5561]: ifupdown: lo0: attempting to run link executor for phase post-up
2025-02-22T01:34:59.425936+02:00 R02 networking[5561]: ifupdown: lo0: attempting to run multi-loopback executor for phase post-up
2025-02-22T01:34:59.692430+02:00 R02 systemd[1]: Reached target network.target - Network.
If the interface lo0 is not present in the system at the moment when FRRouting is starting, even it has the configuration for the interface or is done in networking, is completely useless, because lo0 is not present in the OS.
In my case, the system is an Intel(R) Xeon(R) CPU E5-2687W v2 @ 3.40GHz with 2x SATA SSD.
The system has 67 interfaces: teaming, bridges, vlans, VRRP interfaces.
On a VM on my PC Ryzen 5900X I wasn't able to reproduce because the CPU is much faster than E5-2687W, even with 1 core.
The logs on Ryzen 5900X VM looks like this:
2025-02-22T01:31:14.486427+01:00 EasyOS systemd[1]: Starting frr.service - FRRouting...
2025-02-22T01:31:14.486448+01:00 EasyOS systemd[1]: Starting networking.service - ifupdown-ng networking initialization...
2025-02-22T01:31:14.497917+01:00 EasyOS networking[568]: ifupdown: mgmt: attempting to run link executor for phase depend
2025-02-22T01:31:14.497932+01:00 EasyOS networking[568]: ifupdown: mgmt: attempting to run vrf executor for phase depend
2025-02-22T01:31:14.498092+01:00 EasyOS networking[568]: ifupdown: lo0: attempting to run link executor for phase depend
2025-02-22T01:31:14.498106+01:00 EasyOS networking[568]: ifupdown: lo0: attempting to run multi-loopback executor for phase depend
2025-02-22T01:31:14.498121+01:00 EasyOS frrinit.sh[552]: Starting watchfrr with command: ' /usr/lib/frr/watchfrr -d zebra mgmtd bgpd ospfd ospf6d isisd pimd pim6d ldpd nhrpd eigrpd pbrd staticd bfdd vrrpd pathd'.
2025-02-22T01:31:14.674511+01:00 EasyOS networking[852]: + echo mgmt
2025-02-22T01:31:14.695651+01:00 EasyOS networking[568]: ifupdown: mgmt: attempting to run link executor for phase depend
2025-02-22T01:31:14.699295+01:00 EasyOS networking[568]: ifupdown: mgmt: attempting to run vrf executor for phase depend
2025-02-22T01:31:14.766569+01:00 EasyOS networking[947]: + echo mgmt
2025-02-22T01:31:14.790955+01:00 EasyOS networking[568]: ifupdown: mgmt: attempting to run link executor for phase depend
2025-02-22T01:31:14.791537+01:00 EasyOS networking[568]: ifupdown: mgmt: attempting to run vrf executor for phase depend
2025-02-22T01:31:14.800494+01:00 EasyOS networking[980]: + echo mgmt
2025-02-22T01:31:14.819933+01:00 EasyOS networking[568]: ifupdown: mgmt: attempting to run link executor for phase depend
2025-02-22T01:31:14.821674+01:00 EasyOS networking[568]: ifupdown: mgmt: attempting to run vrf executor for phase depend
2025-02-22T01:31:15.157514+01:00 EasyOS frrinit.sh[1316]: [1316|mgmtd] sending configuration
2025-02-22T01:31:15.158487+01:00 EasyOS frrinit.sh[1317]: [1317|zebra] sending configuration
2025-02-22T01:31:15.227313+01:00 EasyOS networking[568]: ifup: acquiring lock on /run/ifstate.lo0.lock
2025-02-22T01:31:15.227519+01:00 EasyOS networking[568]: ifup: changing state of interface lo0 to 'up'
2025-02-22T01:31:15.227554+01:00 EasyOS networking[568]: ifupdown: lo0: attempting to run link executor for phase create
2025-02-22T01:31:15.240524+01:00 EasyOS frrinit.sh[1374]: [1374|staticd] sending configuration
2025-02-22T01:31:15.243151+01:00 EasyOS networking[1371]: + [ -d /sys/class/net/lo0 ]
2025-02-22T01:31:15.243162+01:00 EasyOS networking[1371]: + ip link add lo0 type dummy
2025-02-22T01:31:15.250714+01:00 EasyOS networking[568]: ifupdown: lo0: attempting to run multi-loopback executor for phase create
2025-02-22T01:31:15.250732+01:00 EasyOS networking[568]: ifupdown: lo0: attempting to run link executor for phase pre-up
2025-02-22T01:31:15.255483+01:00 EasyOS networking[568]: ifupdown: lo0: attempting to run multi-loopback executor for phase pre-up
2025-02-22T01:31:15.255501+01:00 EasyOS networking[568]: ifupdown: lo0: attempting to run link executor for phase up
2025-02-22T01:31:15.255654+01:00 EasyOS networking[1384]: + ip link set up dev lo0
2025-02-22T01:31:15.273529+01:00 EasyOS networking[568]: ifupdown: lo0: attempting to run multi-loopback executor for phase up
2025-02-22T01:31:15.280363+01:00 EasyOS networking[568]: ifupdown: lo0: attempting to run link executor for phase post-up
2025-02-22T01:31:15.281444+01:00 EasyOS networking[568]: ifupdown: lo0: attempting to run multi-loopback executor for phase post-up
2025-02-22T01:31:15.575654+01:00 EasyOS staticd[1220]: [VTVCM-Y2NW3] Configuration Read in Took: 00:00:00
2025-02-22T01:31:15.575700+01:00 EasyOS staticd[1220]: [G6NKK-8C6DV] end_config: VTY:0x56095d3ebab0, pending SET-CFG: 0
2025-02-22T01:31:15.601495+01:00 EasyOS frrinit.sh[1317]: [1317|zebra] done
2025-02-22T01:31:15.771420+01:00 EasyOS frrinit.sh[1374]: [1374|staticd] done
2025-02-22T01:31:16.853505+01:00 EasyOS staticd[1220]: [GH3PB-C7X4Y] Static Route to 0.0.0.0/0 not installed currently because dependent config not fully available
2025-02-22T01:31:16.853553+01:00 EasyOS staticd[1220]: [GH3PB-C7X4Y] Static Route to ::/0 not installed currently because dependent config not fully available
2025-02-22T01:31:16.853569+01:00 EasyOS staticd[1220]: [GH3PB-C7X4Y] Static Route to 0.0.0.0/0 not installed currently because dependent config not fully available
2025-02-22T01:31:16.853581+01:00 EasyOS staticd[1220]: [GH3PB-C7X4Y] Static Route to ::/0 not installed currently because dependent config not fully available
2025-02-22T01:31:16.977965+01:00 EasyOS frrinit.sh[1316]: [1316|mgmtd] done
2025-02-22T01:31:18.471452+01:00 EasyOS networking[568]: ifupdown: changing state of dependent interface mgmt (of lan0.2) to up
2025-02-22T01:31:18.471486+01:00 EasyOS networking[568]: ifupdown: mgmt: attempting to run link executor for phase create
2025-02-22T01:31:18.472875+01:00 EasyOS networking[568]: ifupdown: mgmt: attempting to run vrf executor for phase create
2025-02-22T01:31:18.475413+01:00 EasyOS networking[3378]: + /sbin/ip link add mgmt type vrf table 1040
2025-02-22T01:31:18.494045+01:00 EasyOS kernel: mgmt: entered allmulticast mode
2025-02-22T01:31:18.494910+01:00 EasyOS networking[568]: ifupdown: mgmt: attempting to run link executor for phase pre-up
2025-02-22T01:31:18.496811+01:00 EasyOS networking[568]: ifupdown: mgmt: attempting to run vrf executor for phase pre-up
2025-02-22T01:31:18.499095+01:00 EasyOS networking[568]: ifupdown: mgmt: attempting to run link executor for phase up
2025-02-22T01:31:18.500791+01:00 EasyOS networking[3395]: + ip link set up dev mgmt
2025-02-22T01:31:18.501076+01:00 EasyOS networking[568]: ifupdown: mgmt: attempting to run vrf executor for phase up
2025-02-22T01:31:18.503429+01:00 EasyOS networking[568]: ifupdown: mgmt: attempting to run link executor for phase post-up
2025-02-22T01:31:18.504225+01:00 EasyOS networking[568]: ifupdown: mgmt: attempting to run vrf executor for phase post-up
2025-02-22T01:31:18.533318+01:00 EasyOS networking[3415]: + VRRP_VRF=mgmt
2025-02-22T01:31:19.574160+01:00 EasyOS networking[3415]: + [ -n mgmt ]
2025-02-22T01:31:19.574184+01:00 EasyOS networking[3415]: + ip link set v1ac9e641-02-4 master mgmt
2025-02-22T01:31:19.586534+01:00 EasyOS networking[3415]: + ip link set v1ac9e641-02-6 master mgmt
2025-02-22T01:31:19.603368+01:00 EasyOS systemd[1]: Started frr.service - FRRouting.
2025-02-22T01:31:19.611922+01:00 EasyOS networking[3451]: + [ -n mgmt ]
2025-02-22T01:31:19.611950+01:00 EasyOS networking[3451]: + /sbin/ip link set lan0.2 master mgmt
2025-02-22T01:31:21.948026+01:00 EasyOS networking[568]: ifupdown: skipping dependent interface mgmt (of lan0.16) -- already configured
2025-02-22T01:31:21.972571+01:00 EasyOS networking[3637]: + VRRP_VRF=mgmt
2025-02-22T01:31:23.022444+01:00 EasyOS networking[3637]: + [ -n mgmt ]
2025-02-22T01:31:23.022469+01:00 EasyOS networking[3637]: + ip link set v37560454-10-4 master mgmt
2025-02-22T01:31:23.040880+01:00 EasyOS networking[3637]: + ip link set v37560454-10-6 master mgmt
2025-02-22T01:31:23.064936+01:00 EasyOS networking[3672]: + [ -n mgmt ]
2025-02-22T01:31:23.064959+01:00 EasyOS networking[3672]: + /sbin/ip link set lan0.16 master mgmt
2025-02-22T01:31:23.089936+01:00 EasyOS networking[568]: ifupdown: skipping dependent interface mgmt (of lan0.17) -- already configured
2025-02-22T01:31:23.111082+01:00 EasyOS networking[3698]: + VRRP_VRF=mgmt
2025-02-22T01:31:24.167565+01:00 EasyOS networking[3698]: + [ -n mgmt ]
2025-02-22T01:31:24.167584+01:00 EasyOS networking[3698]: + ip link set ve54fc588-11-4 master mgmt
2025-02-22T01:31:24.186922+01:00 EasyOS networking[3698]: + ip link set ve54fc588-11-6 master mgmt
2025-02-22T01:31:24.207037+01:00 EasyOS networking[3738]: + [ -n mgmt ]
2025-02-22T01:31:24.207749+01:00 EasyOS networking[3738]: + /sbin/ip link set lan0.17 master mgmt
2025-02-22T01:31:28.012658+01:00 EasyOS networking[568]: ifup: acquiring lock on /run/ifstate.mgmt.lock
2025-02-22T01:31:28.012666+01:00 EasyOS networking[568]: ifup: skipping auto interface mgmt (already configured), use --force to force configuration
2025-02-22T01:31:28.015144+01:00 EasyOS systemd[1]: Finished networking.service - ifupdown-ng networking initialization.
Expected behavior
I believe frr.service should start after networking.service finished.
Actual behavior
Service frr.service is starting before networking.service and because can happen to not have all interfaces ready before staticd is booting, all routes with set src will fail if the source IP is configured on one of the interfaces which networking.service must complete the task.
Additional context
In systemd the network.target is described as following:
network.target:
This unit is supposed to indicate when network functionality is available, but it is only very weakly defined what that is supposed to mean. However, the following should apply at minimum:
At start-up, any configured synthetic network devices (i.e. not physical ones that require hardware to show up and be probed, but virtual ones like bridge devices and similar which are created programmatically) that do not depend on any underlying hardware should be allocated by the time this target is reached. It is not necessary for these interfaces to also have completed IP level configuration by the time network.target is reached.
At shutdown, a unit that is ordered after network.target will be stopped before the network — to whatever level it might be set up by then — is shut down. It is hence useful when writing service files that require network access on shutdown, which should order themselves after this target, but not pull it in. Also see Running Services After the Network Is Up for more information.
It must emphasized that at start-up there's no guarantee that hardware-based devices have shown up by the time this target is reached, or even acquired complete IP configuration. For that purpose use network-online.target as described above.
Checklist
I have searched the open issues for this bug.
I have not included sensitive information in this report.
The text was updated successfully, but these errors were encountered:
EasyNetDev
changed the title
frr.service starts before networking is fully booted
frr.service starts before networking is fully booted and breaks set src for static routes if source IP is on an interface not configured
Feb 22, 2025
Description
Hello,
I'm noticing a very weird situation with
frr.service
and networking.service.There is a reason why
frr.service
should boot before thenetworking.service
and beforenetwork.target
which is triggered bynetworking.service
?/usr/lib/systemd/system/frr.service:
My case: I have a lot of interfaces (67 of them) that needs to be prepared, like
lo0
,lo1
.. etc done viadummy
.My configuration has a default route in GRT which is using
set src
. And each time I'm rebooting the router, this default route is marked asr - rejected
.After troubleshooting the kernel messages using debug on FRR I found this:
Trying to find out why this happens only on boot, I've did a trace of ifupdown-ng on boot and I've compared the times with FRRouting service.
And this is the chain of events on booting:
If the interface
lo0
is not present in the system at the moment when FRRouting is starting, even it has the configuration for the interface or is done in networking, is completely useless, becauselo0
is not present in the OS.Version
How to reproduce
In my case, the system is an Intel(R) Xeon(R) CPU E5-2687W v2 @ 3.40GHz with 2x SATA SSD.
The system has 67 interfaces: teaming, bridges, vlans, VRRP interfaces.
On a VM on my PC Ryzen 5900X I wasn't able to reproduce because the CPU is much faster than E5-2687W, even with 1 core.
The logs on Ryzen 5900X VM looks like this:
Expected behavior
I believe
frr.service
should start after networking.service finished.Actual behavior
Service
frr.service
is starting beforenetworking.service
and because can happen to not have all interfaces ready before staticd is booting, all routes withset src
will fail if the source IP is configured on one of the interfaces which networking.service must complete the task.Additional context
In systemd the network.target is described as following:
network.target:
Checklist
The text was updated successfully, but these errors were encountered: