I am using this script to create a bridge for openvpn:
#!/bin/bash br="br0" tap="tap0" eth="eth0" eth_ip="192.168.8.4" eth_netmask="255.255.255.0" eth_broadcast="192.168.8.255" for t in $tap; do openvpn --mktun --dev $t done brctl addbr $br brctl addif $br $eth for t in $tap; do brctl addif $br $t done for t in $tap; do ifconfig $t 0.0.0.0 promisc up done ifconfig $eth 0.0.0.0 promisc up ifconfig $br $eth_ip netmask $eth_netmask broadcast $eth_broadcast route add default gw 192.168.8.1
I have made this script run as an upstart job on ubuntu. The upstart job will wait untill the "eth0" interface comes up (it would already have an ip which the
network/interfaces script assigned it). But when the above script runs, the eth0 interface goes down, loses it's ip and it gets added to the bridge. So instead of using the above script as an upsatrt job, I want to add it into
network/interfaces script. How can it be done?