#!/bin/sh
#
#bridge Starts Bridge
case "$1" in
start)
echo "Starting bridge: "
# Network interface up
/sbin/ifconfig eth0 0.0.0.0
/sbin/ifconfig eth1 0.0.0.0
# Bridge interface up
/usr/local/bin/brctl addbr br0
/usr/local/bin/brctl addif br0 eth0
/usr/local/bin/brctl addif br0 eth1
/sbin/ifconfig br0 192.168.0.5 up
;;
stop)
echo "Shutting down bridge: "
# Bridge interface down
/sbin/ifconfig br0 down
# Bridge interface delete
/usr/local/bin/brctl delif br0 eth0
/usr/local/bin/brctl delif br0 eth1
/usr/local/bin/brctl delbr br0
# Network interface down
/sbin/ifconfig eth0 down
/sbin/ifconfig eth1 down
;;
status)
/usr/local/bin/brctl showstp br0
;;
restart)
stop
start
;;
*)
echo "Usage: $0 {start|stop|status|restart}"
exit 1
esac
exit 0
|