Hello everyone,
I have 2 static routes added from the Ipfire interface
I have a script that performs some checks and depending on the results, may sometimes have to restart the network interface with command line “/usr/local/bin/connscheduler reconnect”. The problem is that when the network interface restarts, the static routes disappear.
How could I, from my script, add the routes present in the file “/var/ipfire/main/routing” as ipfire does when adding static routes from the interface?
My Ipfire:
IPFire version
IPFire 2.27 (x86_64) - core171
Pakfire version
2.27-x86_64
Kernel version
5.15.71-ipfire #1 SMP Tue Oct 18 11:57:26 GMT 2022 x86_64 Intel(R) Atom™ CPU C3758 @ 2.20GHz GenuineIntel GNU/Linux
Hi @cfusco ,
Thanks for your answer.
I don’t want (need) restart all interface but only RED interface in my script (https://wiki.ipfire.org/configuration/network/connectionscheduler)
It seems that when the command "/usr/local/bin/connscheduler reconnect” runs…my static routes disappear
I’m looking for a way to integrate their re-creation by using the content of the file “/var/ipfire/main/routing” in my script.
Looking at the sources shows, that ‘/usr/local/bin/connscheduler reconnect’ starts also ‘/etc/rc.d/init.d/static-routes start’ ( which should reinstall the static routes ).
Therefore I assume there is some problem in your static routes definition.
Can you try to do the command /etc/rc.d/init.d/static-routes reload
from a console? Are there errors ( on the console and/or the syslogs )?
@tikok974 , what’s the contents of /var/ipfire/main/routing?
According to the source of /etc/rc.d/init.d/static-routes, invalid entries to this file are silently discarded/skipped.
static-routes does the ip route add command for all valid entries.
made a little little shell script ( modified static-routes to just reading the routing file and echoing the commands to be issued ); gives no errors, commands are as expected
invocation of static-routes reload ; when using IPs out my networks as gateway, no problems routes are installed
Very obscure. Just another thought: are the file modes of the routing file ok ( 0644 ), did you edit it ( how)?