]> git.pld-linux.org Git - projects/rc-scripts.git/blobdiff - rc.d/init.d/network
- removed references to IPV*_FORWARDING
[projects/rc-scripts.git] / rc.d / init.d / network
index ea1f54366bec09cef0259689de81fea830a92e00..6ef9fa37afdc2fc8877f6885f4a6ca73b40dff89 100644 (file)
@@ -8,7 +8,7 @@
 #
 # probe:       true
 
-# $Id: network,v 1.48 2001/07/05 15:56:33 baggins Exp $
+# $Id: network,v 1.58 2002/12/17 14:01:10 baggins Exp $
 
 PATH=/sbin:/usr/sbin:/bin:/usr/bin
 
@@ -17,7 +17,7 @@ NLS_DOMAIN="rc-scripts"
 
 # Source function library.
 . /etc/rc.d/init.d/functions
-. /etc/sysconfig/network-scripts/.functions
+. /etc/sysconfig/network-scripts/functions.network
 
 if [ ! -f /etc/sysconfig/network ]; then
        nls "%s is missing. Can't continue." "/etc/sysconfig/network"
@@ -48,26 +48,24 @@ fi
 # initialize networking:
 # - check IPv4, IPv6, IPX can be handled by system
 # - setup default IPv{4,6} interfaces policy like:
-#   - forwarding,
 #   - spoofig protection,
 #   - icmp echo ignore broadcasts,
 # - setup lo interface
 network_init()
 {
+# Modprobe needed devices
+modprobe_net
+
 # Kernel network parameters
 run_cmd "Setting network parameters" sysctl -p /etc/sysctl.conf
 
 # Set UP loopback interface
 set_up_loopback
 
-# Modprobe needed devices
-modprobe_net
-
 # Setup configuration
-setup_forwarding on
 setup_nat on
 setup_routes on
-
+setup_ip_rules on
 # Setup IPX
 if is_yes "$IPX"; then
        if [ -n $IPXAUTOPRIMARY ] ; then
@@ -76,7 +74,7 @@ if is_yes "$IPX"; then
                else
                        IPXAUTOPRIMARY="off"
                fi
-               /usr/bin/ipx_configure --auto_primary=$IPXAUTOPRIMARY
+               /sbin/ipx_configure --auto_primary=$IPXAUTOPRIMARY
        fi
        if [ -n $IPXAUTOFRAME ] ; then
                if is_yes "$IPXAUTOFRAME"; then
@@ -84,10 +82,10 @@ if is_yes "$IPX"; then
                else
                        IPXAUTOFRAME="off"
                fi
-               /usr/bin/ipx_configure --auto_interface=$IPXAUTOFRAME
+               /sbin/ipx_configure --auto_interface=$IPXAUTOFRAME
        fi
        if [ -n "$IPXINTERNALNETNUM" -a "$IPXINTERNALNETNUM" != "0" ]; then
-               /usr/bin/ipx_internal_net add $IPXINTERNALNETNUM $IPXINTERNALNODENUM
+               /sbin/ipx_internal_net add $IPXINTERNALNETNUM $IPXINTERNALNODENUM
        fi
 fi
 }
@@ -106,27 +104,33 @@ static_arp
 # - down lo interface.
 network_deinit()
 {
-setup_forwarding off
 setup_routes off
+setup_ip_rules off
 
 # Set down NAT rules
 setup_nat off
-
 # Set DOWN loopback interface
 set_down_loopback
 }
 
 # find all the interfaces besides loopback.
 # ignore aliases, alternative configurations, and editor backup files
-interfaces=$((cd /etc/sysconfig/interfaces && ls -1 ifcfg* | \
-       egrep -v '(ifcfg-lo|:)' | egrep 'ifcfg-[a-z0-9]+$' | \
-       awk ' { gsub(/ifcfg-/,NIL); print $0 } ') 2> /dev/null)
-interfaces_boot=$((cd /etc/sysconfig/interfaces && ls -1 ifcfg* | \
-       egrep -v '(ifcfg-lo|ifcfg-sit|ifcfg-atm|ifcfg-lec|ifcfg-nas|:)' | egrep 'ifcfg-[a-z0-9\.]+$' | \
-       xargs egrep -l "ONBOOT=[^n][^o]" | \
+interfaces_boot=$((
+       . /etc/rc.d/init.d/functions; \
+       cd /etc/sysconfig/interfaces && ls -1 ifcfg* | \
+       egrep -v '(ifcfg-lo|ifcfg-sit|ifcfg-atm|ifcfg-lec|ifcfg-nas|:)' | \
+       egrep 'ifcfg-[a-z0-9\.]+$' | \
+       for i in `cat`; do \
+           ONBOOT=""; . /etc/sysconfig/interfaces/"$i"; is_yes "$ONBOOT" && echo "$i"; \
+       done | \
        awk ' { gsub(/ifcfg-/,NIL); print $0 } ') 2> /dev/null)
-interfaces_sit_boot=$((cd /etc/sysconfig/interfaces && ls -1 ifcfg-sit* | \
-       egrep 'ifcfg-[a-z0-9]+$' | xargs egrep -l "ONBOOT=[^n][^o]" | \
+interfaces_sit_boot=$((
+       . /etc/rc.d/init.d/functions; \
+       cd /etc/sysconfig/interfaces && ls -1 ifcfg-sit* | \
+       egrep 'ifcfg-[a-z0-9]+$' | \
+       for i in `cat`; do \
+           ONBOOT=""; . /etc/sysconfig/interfaces/"$i"; is_yes "$ONBOOT" && echo "$i"; \
+       done | \
        awk ' { gsub(/ifcfg-/,NIL); print $0 } ') 2> /dev/null)
 tunnels=$((cd /etc/sysconfig/interfaces && ls -1 tnlcfg-* | \
        xargs egrep -l "ONBOOT=[^n][^o]" | \
@@ -141,10 +145,6 @@ case "$1" in
                run_cmd -a "$(nls 'Bringing up interface') $i" /sbin/ifup $i boot
        done
 
-       for i in $(find_ldap_interfaces) ; do
-               run_cmd -a "$(nls 'Bringing up interface from LDAP') $i" /sbin/ifup $i boot
-       done
-
        for i in $tunnels; do
                run_cmd -a "$(nls 'Setting tunnel') $i" /sbin/tnlup $i boot
                run_cmd -a "$(nls 'Bringing up tunnel interface') $i" /sbin/ifup tnlcfg-$i boot
@@ -179,10 +179,6 @@ case "$1" in
                run_cmd -a "$(nls 'Removing tunnel') $i" /sbin/tnldown $i boot
        done
 
-       for i in $(find_ldap_interfaces) ; do
-               run_cmd -a "$(nls 'Shutting down interface from LDAP') $i" /sbin/ifdown $i boot
-       done
-
        for i in $interfaces_sit_boot $interfaces_boot ; do
                run_cmd -a "$(nls 'Shutting down interface') $i" /sbin/ifdown $i boot
        done
This page took 0.027643 seconds and 4 git commands to generate.