]> git.pld-linux.org Git - projects/rc-scripts.git/commitdiff
- support for "any/none" routes in /etc/sysconfig/statig routes
authorJacek Konieczny <jajcus@pld-linux.org>
Thu, 30 Dec 1999 12:09:45 +0000 (12:09 +0000)
committerJacek Konieczny <jajcus@pld-linux.org>
Thu, 30 Dec 1999 12:09:45 +0000 (12:09 +0000)
  --- these may be used for unreachable or blackhole routes

svn-id: @624

rc.d/init.d/functions.network
rc.d/init.d/network

index a1c673dc4a09d95dc4564bf06d7eb301a4ed29b4..5525da90206c3145c929941547a48146922da5e6 100755 (executable)
@@ -1,6 +1,6 @@
 #
-# $Id: functions.network,v 1.33 1999/12/15 18:41:07 misiek Exp $
-#
+# $Id: functions.network,v 1.34 1999/12/30 12:09:45 jajcus Exp $
+# vi:syntax=sh
 # This is not a shell script; it provides functions to network scripts
 # that source it.
 
@@ -274,17 +274,35 @@ if [ "$IPV4_ANTI_SPOOFING" != "default" -a -n "$IPV4_ANTI_SPOOFING" ] || \
 fi
 }
 
+#
+# following function sets up routes not associated to any device
+# eg. unreachable or blackhole routes
+# (c) 1999 Jacek Konieczny <jajcus@pld.org.pl>
+#
+setup_routes(){
+
+       if [ -f /etc/sysconfig/static-routes ]; then
+               if [ $1 = "on" ] ; then
+                       egrep "^(none)|(any)[[:blank:]]" /etc/sysconfig/static-routes | while read device args; do
+                               /sbin/ip route add $args
+                       done
+               else
+                       egrep "^(none)|(any)[[:blank:]]" /etc/sysconfig/static-routes | while read device args; do
+                               /sbin/ip route del $args 2>/dev/null
+                       done
+               fi
+       fi
+}
+
 # Add ONLY IPv4 address (IPv6 address is added automaticly)
 set_up_loopback()
 {
 ip link set dev lo up arp on
 ip addr add 127.0.0.1/8 dev lo
-ip route add 127.0.0.0/8 dev lo scope link
 }
 
 set_down_loopback()
 {
-ip route flush dev lo
 ip addr flush dev lo
 ip link set dev lo down
 }
@@ -385,3 +403,5 @@ done
 echo $MASK
 return
 }
+
+
index 4b3fc622cd642406c5abe877f877daa7a6cc4a73..2745cc58f8625569a3db917c1a4a1f0359841039 100644 (file)
@@ -8,7 +8,7 @@
 #
 # probe:       true
 
-# $Id: network,v 1.29 1999/12/15 18:41:07 misiek Exp $
+# $Id: network,v 1.30 1999/12/30 12:09:45 jajcus Exp $
 
 # NLS
 NLS_DOMAIN="rc-scripts"
@@ -52,6 +52,7 @@ proc_networking start
 
 # Setup NAT rules
 setup_nat on
+setup_routes on
 }
 
 network_postinit()
@@ -66,6 +67,7 @@ static_arp
 # - down lo interface.
 network_deinit()
 {
+setup_routes off
 # Set down NAT rules
 setup_nat off
 
This page took 0.186935 seconds and 4 git commands to generate.