Hi all,

To start with - I want to bridge tap0 interface (which is created by openvpn server), with eth0 (which is my lan interface).

I've compiled bridge-utils, loaded bridge.ko and tun.ko modules with no errors.

Then I want to run a simple .sh that worked perfectly for me on my VirtualBox Ubuntu,

Code:
#!/bin/bash

#################################
# Set up Ethernet bridge on Linux
# Requires: bridge-utils
#################################

# 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="172.16.1.3"
eth_netmask="255.255.255.0"
eth_broadcast="172.16.1.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
On my NAS box this scripts goes to:

Code:
ifconfig $eth 0.0.0.0 promisc up
and I'm losing connection to my box.

I've added echo to script, and the last one is seen before
Code:
ifconfig $eth 0.0.0.0 promisc up
Also did dmesg to a file (since this is nas box - the only way to see console - remote ssh)

Code:
br0: Dropping NETIF_F_UFO since no NETIF_F_HW_CSUM feature. * * * * * * * * * * 
device eth0 entered promiscuous mode * * * * * * * * * * * * * * * * * * * * * *
device tap0 entered promiscuous mode * * * * * * * * * * * * * * * * * * * * * *
br0: port 2(tap0) entering learning state * * * * * * * * * * * * * * * * * * * 
br0: port 1(eth0) entering learning state * * * * * * * * * * * * * * * * * * * 
device br0 entered promiscuous mode * * * * * * * * * * * * * * * * * * * * * * 
br0: topology change detected, propagating * * * * * * * * * * * * * * * * * * *
br0: port 2(tap0) entering forwarding state * * * * * * * * * * * * * * * * * * 
br0: topology change detected, propagating * * * * * * * * * * * * * * * * * * *
br0: port 1(eth0) entering forwarding state
Looks like everything is okay in dmesg.

ifconfig br0 shows 172.16.1.3 with netmask 255.255.255.0

Before script execution I did:
Code:
echo 1 > /proc/sys/net/ipv4/ip_forward
and also (but there were no rules there):
Code:
iptables -F
I've tried adding rules for br0 and tap0.. no success

What I am doing wrong?
Sitting with this problem for several weeks already.

Thanks!