Page 1 of 1

permanent static route

Posted: Sun Sep 22, 2019 7:40 pm
by ikookmaar
Can anyone tell me how to make a static route (back to my VPN client through the LAN adress of the VPN router) permanent on the Toon?
I did a # route add -net 10.0.8.0 netmask 255.255.255.0 gw 192.168.1.3
This works fine, but where or how should I add it to make it survive reboots?
B.T.W. it should not affect my default gateway (since that is a seperate device with another address)
Thanks...!

Re: permanent static route

Posted: Mon Sep 23, 2019 1:46 am
by ikookmaar
Think I just fixed it by adding to /etc/network/interfaces (at the bottom of the section # Wireless LAN interface:

Code: Select all

post-up route add -net 10.0.8.0 netmask 255.255.255.0 gw 192.168.1.3
and by restarting the network after that:

Code: Select all

# ifdown wlan0 && ifup wlan0
test it:

Code: Select all

# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 wlan0
10.0.8.0 192.168.1.3 255.255.255.0 UG 0 0 0 wlan0
0.0.0.0 192.168.1.1 0.0.0.0 UG 10 0 0 wlan0
[/code]

Re: permanent static route

Posted: Mon Sep 23, 2019 10:34 am
by TheHogNL
That file will most probably be overwritten by Toon apps at next reboot or network change.
See also viewtopic.php?f=102&t=12347&hilit=static&start=15

You need to add the route using another startup file, or add it to the udhcpd startup files