Managing Communication |
#connect tap device to the bridge brctl addif br0 tap${i}
#null ip address of tap device ifconfig tap${i} 0.0.0.0 promisc up
i=`expr $i + 1`
if [ $i
fi done
#null ip address of internal interface ifconfig $iface 0.0.0.0 promisc up
#enable bridge ip
ifconfig br0 $IPADDR netmask $NETMASK broadcast $BROADCAST
ipf=/proc/sys/net/ipv4/ip_forward
#enable IP forwarding echo 1 > $ipf
echo “ip forwarding enabled to” cat $ipf
}
stop() {
echo “shutdown openvpn bridge.” ifcfg_vpn
i=`expr 0` while : do
#disconnect tap device from the bridge brctl delif br0 tap${i}
openvpn
i=`expr $i + 1`
if [ $i
fi done
brctl delif br0 $iface brctl delbr br0 ifconfig br0 down
ifconfig $iface $IPADDR netmask $NETMASK broadcast $BROADCAST killall
}
case “$1” in start)
start
;;
stop) stop
;;
restart) stop start
;;
*) |
|
echo “Usage: $0 [startstoprestart]” | |
exit 1 |
|
esac |
|
exit 0 | end |
Create link symbols to enable this script at boot time:
#ln
#ln