#!/bin/sh # # example for starting/stopping the network case "$1" in start) # bring up ifaces echo "Bringing up lo" /sbin/ifconfig lo 127.0.0.1 echo "Bringing up eth0" /sbin/ifconfig eth0 a.b.c.x netmask m1.m2.m3.m4 # now for the routing echo "Setting up route table" /sbin/route add default gw a.b.c.y echo "Enabling ipv4 forwarding" echo 1 > /proc/sys/net/ipv4/ip_forward ;; stop) # stop the interfaces echo "Bringing down eth0" ifconfig eth0 down echo "Bringing down lo" /sbin/ifconfig lo down ;; *) echo "Usage $0: start|stop" exit 1 ;; esac