Results 1 to 2 of 2

Thread: make ip route and ip rule permanent on SLES15 SP1

  1. make ip route and ip rule permanent on SLES15 SP1

    Hi

    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.

    router.sh:

    ip route add 10.10.20.0/24 dev eth1 src 10.10.20.10 table rt2
    ip route add default via 10.10.20.1 dev eth1 table rt2
    ip rule add from 10.10.20.10/32 table rt2
    ip rule add to 10.10.20.10/32 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)

    thx
    Wolfgang

  2. #2

    Re: make ip route and ip rule permanent on SLES15 SP1

    Quote Originally Posted by Wolfgang_Bleim View Post
    Hi

    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.

    router.sh:

    ip route add 10.10.20.0/24 dev eth1 src 10.10.20.10 table rt2
    ip route add default via 10.10.20.1 dev eth1 table rt2
    ip rule add from 10.10.20.10/32 table rt2
    ip rule add to 10.10.20.10/32 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)

    thx
    Wolfgang
    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:

    Code:
    destination/netmaskCIDRnotation gateway - device
    so for my test network 192.168.1.0 with netmask 255.255.255.0 and gateway 192.168.1.254 for device eth0 it added

    Code:
    192.168.1.0/24 192.168.1.254 - eth0
    HTH.
    Simon
    SUSE Knowledge Partner
    ------------------------------------------------------------------------
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below. Thanks.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •