Quote Originally Posted by Wolfgang_Bleim View Post

I need policy based routing at my server, but I don´t now the right place to make it persistent across reboots.

At this time we start a script (router.sh) after reboot. It works but it isn´t a clean solution.


ip route add dev eth1 src table rt2
ip route add default via dev eth1 table rt2
ip rule add from table rt2
ip rule add to table rt2

Where is the right place and the syntax to make it persistent clean? I try /etc/sysconfig/network/if-up.d/route.sh but it doesn´t work (maybe I use the wrong syntax)

I just added a route to a test SLES15 SP1 server via YaST and it created and populated /etc/sysconfig/network/ifroute-eth0 (where eth0 is the device I associated the route to so adjust accordingly) with the following format:

destination/netmaskCIDRnotation gateway - device
so for my test network with netmask and gateway for device eth0 it added

Code: - eth0