1

I run Debian 8 and need to bridge a tap interface tap0 to eth0 (trying to setup an OpenVPN server). I use the standard bridging script from OpenVPN help page:

#!/bin/sh

# Define Bridge Interface
br="br0"

# Define list of TAP interfaces to be bridged,
# for example tap="tap0 tap1 tap2".
tap="tap0"

# Define physical ethernet interface to be bridged
# with TAP interface(s) above.
eth="eth0"
eth_ip="192.168.0.140"
eth_netmask="255.255.255.0"
eth_broadcast="192.168.0.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

where 192.168.0.140 is the IP address reserved to this server by the router's DHCP. The router (192.168.0.1) is used to access the Internet.

When I run the script everything seems fine from inside the LAN. However, all the ports that were forwarded in the router to 192.168.0.140 suddenly stop answering.

I've noticed that router's DHCP uses MAC address to identify server, and that br0 has a different MAC than eth0. So I added

ifconfig $br hw ether d0:50:99:3b:4e:ff

at the end of the bridging script to make the br0 have the same MAC as eth0. And it actually does assign the 'correct' MAC to br0, but, unfortunately, doesn't solve the problem.

The problem seems to be in the router itself, because the server still can be accessed from LAN.

1 Answer 1

0

Alright, the answer is pretty simple. When the bridge goes up, the route for default gateway disappears. So

route add default gw 192.168.0.1 br0

works as a charm.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .