aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2002-11-12 06:42:07 +0000
committerBill Nottingham <notting@redhat.com>2002-11-12 06:42:07 +0000
commit8db687d270a970287933e4abcfbb85b80ad37c8f (patch)
tree1bdc4561c4c09f91b365703ddfb61f473835cc97
parentac078c4974e30a741ae26bf451c7b2c025eb4494 (diff)
downloadinitscripts-8db687d270a970287933e4abcfbb85b80ad37c8f.tar
initscripts-8db687d270a970287933e4abcfbb85b80ad37c8f.tar.gz
initscripts-8db687d270a970287933e4abcfbb85b80ad37c8f.tar.bz2
initscripts-8db687d270a970287933e4abcfbb85b80ad37c8f.tar.xz
initscripts-8db687d270a970287933e4abcfbb85b80ad37c8f.zip
fix static route brokenness (#74317, #74320, #76619, #75604)
-rw-r--r--sysconfig.txt28
-rwxr-xr-xsysconfig/network-scripts/ifup-routes14
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"