Creating network bridge on boot
Tim Vaughan
talltim at gmail.com
Mon Oct 10 17:30:45 UTC 2005
I run OpenVPN on my Ubuntu server and bridge the VPN interfaces (one
per VPN). To do this, I manually create the bridge each time after
boot. This has worked ok so far but it's a hassle and means that if
the server ever gets reset (power failure etc.) I have to restore the
VPNs manually.
How can I create this bridge immediately after boot? The commands I
run are (all in a single executable file):
/sbin/modprobe tun
/sbin/modprobe bridge
openvpn --mktun --dev tap0
openvpn --mktun --dev tap1
openvpn --mktun --dev tap2
ifconfig eth0 down
route del default
brctl addbr br0
brctl addif br0 eth0
brctl addif br0 tap0
brctl addif br0 tap1
brctl addif br0 tap2
ifconfig eth0 0.0.0.0 promisc up
ifconfig tap0 0.0.0.0 promisc up
ifconfig tap1 0.0.0.0 promisc up
ifconfig tap2 0.0.0.0 promisc up
ifconfig br0 192.168.1.35 netmask 255.255.255.0 broadcast 192.168.1.255
Thanks,
Tim
More information about the ubuntu-users
mailing list