diff options
-rw-r--r-- | sysconfig.txt | 28 | ||||
-rwxr-xr-x | sysconfig/network-scripts/ifup-routes | 14 |
2 files changed, 17 insertions, 25 deletions
diff --git a/sysconfig.txt b/sysconfig.txt index 933f9c7f..49ace959 100644 --- a/sysconfig.txt +++ b/sysconfig.txt @@ -258,26 +258,6 @@ Files in /etc/sysconfig net.ipv4.ip_always_defrag setting in /etc/sysctl.conf. It is no longer valid for 2.4 kernels. -/etc/sysconfig/static-routes: - - Contains lines of the form: - - <device> host|net <arguments to route command> - - <device> may be a device name to have the route brought up and - down with the device, or "any" to have the correct devices calculated - at run time. - - For example: - - eth0 host 192.168.2.2 eth0 - - adds a host route through eth0 to 192.168.2.2, while - - any net 192.168.2.0 netmask 255.255.255.0 ppp0 - - adds a network route to the 192.168.2.0 network through ppp0. - /etc/sysconfig/static-routes-ipv6: Contains lines of the form: @@ -776,3 +756,11 @@ Files in /etc/sysconfig/network-scripts/ up /etc/resolv.conf from the version dhcpcd dropped in /etc/dhcpc/resolv.conf +/etc/sysconfig/network-scripts/route-<interface-name> + + Contains lines that are arguments to "/sbin/ip route add" + For example: + + 192.168.2.0/24 dev ppp0 + + adds a network route to the 192.168.2.0 network through ppp0. diff --git a/sysconfig/network-scripts/ifup-routes b/sysconfig/network-scripts/ifup-routes index f6734375..912c9bba 100755 --- a/sysconfig/network-scripts/ifup-routes +++ b/sysconfig/network-scripts/ifup-routes @@ -6,12 +6,20 @@ if [ -z "$1" ]; then exit 1 fi +# Older format +if [ -f "/etc/sysconfig/network-scripts/route-$1" ]; then + while read line; do + /sbin/ip route add $line + done < "/etc/sysconfig/network-scripts/route-$1" +fi + +# Red Hat network configuration format + CONFIG="/etc/sysconfig/networking/devices/$1.route" [ -f $CONFIG ] || exit 0 . $CONFIG -# Red Hat network configuration format routenum=0 while [ "x$(eval echo '$'ADDRESS$routenum)x" != "xx" ]; do @@ -25,7 +33,3 @@ while [ "x$(eval echo '$'ADDRESS$routenum)x" != "xx" ]; do routenum=$(($routenum+1)) done -# Older format -while read line; do - /sbin/ip route add $line -done < "/etc/sysconfig/network-scripts/route-$1" |