3 # network Bring up/down networking
5 # chkconfig: 2345 10 90
6 # description: Activates/Deactivates all network interfaces configured to \
10 # Source function library.
11 . /etc/rc.d/init.d/functions
12 . /etc/rc.d/init.d/functions.network
14 [ ! -f /etc/sysconfig/network ] && exit 0
16 . /etc/sysconfig/network
18 # Check that networking is up.
19 [ "${NETWORKING}" == "no" -o "${NETWORKING}" == "" ] && exit 0
21 [ -x /sbin/ifconfig ] || exit 0
24 # initialize networking:
25 # - check IPv4, IPv6, IPX can be handled by system
26 # - setup default IPv{4,6} interfaces policy like:
28 # - spoofig protection,
29 # - icmp echo ignore broadcasts,
30 # - setup lo interface
33 [ -f /etc/sysconfig/interfaces/ifcfg-lo ] && /sbin/ifup lo boot
38 # deinitialize networking
39 # - down lo interface.
42 [ -f /etc/sysconfig/interfaces/ifcfg-lo ] && /sbin/ifdown lo boot
46 interfaces="`cd /etc/sysconfig/interfaces && ls -1 ifcfg-* | grep -v ifcfg-lo | xargs 2> /dev/null`"
47 tunnels="`cd /etc/sysconfig/interfaces && ls -1 tnlcfg-* | xargs 2> /dev/null`"
49 # See how we were called.
54 [ -f /etc/sysconfig/interfaces/$i ] && /sbin/tnlup $i boot
56 for i in $interfaces; do
57 [ -f $i ] && /sbin/ifup $i boot
59 touch /var/lock/subsys/network
62 for i in $interfaces; do
63 [ -f $i ] && /sbin/ifdown $i boot
66 [ -f /etc/sysconfig/interfaces/$i ] && /sbin/tnldown $i boot
69 rm -f /var/lock/subsys/network
72 echo "Configured devices:"
75 echo "Currently active devices:"
76 echo `/sbin/ifconfig | grep ^[a-z] | awk '{print $1}'`
83 echo "Usage: network {start|stop|restart|status}"