#!/bin/sh # # /etc/rc.d/net: start/stop network # IF="eth0" IP="192.168.1.100/24" GW="192.168.1.1" case $1 in start) # loopback /sbin/ip addr add 127.0.0.1/8 dev lo broadcast + scope host /sbin/ip link set lo up # ethernet #/sbin/ip addr add $IP dev $IF broadcast + #/sbin/ip link set $IF up # default route #/sbin/ip route add default via $GW ;; stop) #/sbin/ip route del default #/sbin/ip link set $IF down #/sbin/ip addr del $IP dev $IF /sbin/ip link set lo down /sbin/ip addr del 127.0.0.1/8 dev lo ;; restart) $0 stop $0 start ;; *) echo "usage: $0 [start|stop|restart]" ;; esac # End of file