What's new

Correct Script To Use For Changing Routes?

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

HarryMuscle

Senior Member
What script would be the correct place for changing the IP routes on the router? There are two scripts (firewall-start and nat-start) for modifying iptables rules but there doesn't seem to be one for changing routes. My gut would say to put it in nat-start since that gets called after firewall-start so there's a better chance that the router has completed doing everything it was going to do to the routes (the idea being to not touch the routes until the router is done with them) but I'm not sure that reasoning is correct or if maybe there's an earlier or better script to put routes related code.

Thanks,
Harry
 
What script would be the correct place for changing the IP routes on the router? There are two scripts (firewall-start and nat-start) for modifying iptables rules but there doesn't seem to be one for changing routes. My gut would say to put it in nat-start since that gets called after firewall-start so there's a better chance that the router has completed doing everything it was going to do to the routes (the idea being to not touch the routes until the router is done with them) but I'm not sure that reasoning is correct or if maybe there's an earlier or better script to put routes related code.

Thanks,
Harry
How about adding routes when the relevant interface starts? So wan routes go into wan-start, wireguard client routes in wgclient-start aso? natuarally added routes should be removed in the -stop hook script as well.
 

Similar threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top