#!/bin/sh BRIDGE="yes" BRIDGEDEV="br-net0" IPLOCAL="192.168.2.254/24" IPBROAD="192.168.2.255" #/sbin/ifconfig $1 212.17.55.62/28 if [ ${BRIDGE} = "yes" ] ; then if ! brctl showmacs $BRIDGEDEV > /dev/null 2>&1 ; then brctl addbr $BRIDGEDEV brctl setbridgeprio $BRIDGEDEV 5000 brctl setfd $BRIDGEDEV 15 brctl sethello $BRIDGEDEV 2 brctl setmaxage $BRIDGEDEV 20 brctl stp $BRIDGEDEV on #brctl addif $BRIDGEDEV eth0 ip li set dev $BRIDGEDEV up ip address add $IPLOCAL broadcast $IPBROAD \ dev $BRIDGEDEV fi brctl addif $BRIDGEDEV $1 ip link set dev $1 up else ip li set dev $1 up ip address add $IPLOCAL broadcast $IPBROAD dev $1 fi