Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

A section like this should be pretty close to what you want. REF

auto br0
iface br0 inet static
        pre-up openvpn --mktun --dev br0
        post-down openvpn --rmtun --dev br0
        bridge_ports br0 eth0
        address 192.168.8.4
        netmask 255.255.255.0
        gateway 192.168.8.1
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.