If I use the command "route add -net x.y.z.t netmask a.b.c.d ... ethx",
the route is added only until next reboot.
Is there a way ( via setup or other ) to add PERMANENTLY a route ?
Solution
Add the 'route' command to the /rc/rc_user script.
For FREESCO 027 this script has a start and a stop section, see comments:
- Code: Select all
echo -n "Starting rc_user... "
# Add commands here you want to execute when booting. Use the fork
# command to launch programs which normally stay in the foreground.
route add -net x.y.z.t netmask a.b.c.d ... ethx
- Code: Select all
echo -n "Stopping rc_user... "
# Add commands here you want to execute when shutting down or rebooting.
# Be careful not to use any commands which wait for user input.
route del x.y.z.t
For FREESCO 03x, the script has a switch statement, with clearly indicated start) and stop) sections:
- Code: Select all
start) echo -n "Starting rc_user... "
# Add commands here you want to execute when starting
# the router.
# Use the fork command to launch programs which normally stay
# in the foreground.
# This part is called after all rc_* files.
route add -net x.y.z.t netmask a.b.c.d ... ethx
=
;;
stop) echo -n "Stopping rc_user... "
# Add commands here you want to execute when restarting,
# shutting down or rebooting.
# Be careful not to use any commands which wait for user input.
# This part is called before all rc_* files.
route del x.y.z.t
=
;;
Add you command(s) before the equal sign (=) and make sure to leave the double semi colons (;;) in place!
Always use a linux compatible editor (like edit, joe, vi, teddy, mc, etc.) to make changes, never a DOS/Windoze editor, since a DOS/Windoze editor will add ^M characters (CARRIAGE RETURN) at the end of each line, making the script unusable!
