OpenWrt Forum Archive

Topic: Problems with bridge and vlan

The content of this topic has been archived on 31 Mar 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi,

I have a problem with D-Link DIR-825 and bridging.

I Have a normal interface, with static ip (eth0) and i can normally add a vlan, eth0.5 for example and add them to separate bridges. But only the bridge containing the "normal" interface works. And if i remove that bridge, the vlan-bridge or bridges start to work normally. So where's the problem?

My plan was to use one bridge to untagged traffic between lan and wlan and the other bridge for tagged management traffic.

(Last edited by john.steel on 29 Sep 2010, 07:32)

john.steel wrote:

Hi,

I have a problem with D-Link DIR-825 and bridging.

I Have a normal interface, with static ip (eth0) and i can normally add a vlan, eth0.5 for example and add them to separate bridges. But only the bridge containing the "normal" interface works. And if i remove that bridge, the vlan-bridge or bridges start to work normally. So where's the problem?

My plan was to use one bridge to untagged traffic between lan and wlan and the other bridge for tagged management traffic.

You cannot  assign IP to a bridged interface.

This does will NOT work:

ifconfig eth0.1 192.168.10.1
brctrl addbr br1 eth0.1

You should not assign ip to the interfaces included in a bridge:

ifconfig eth0.1 0.0.0.0
brctrl addbr br1 eth0.1
ifconfig br1 192.168.10.1

Also, if eth0 is part of another bridge, you cannot use the tagged traffic of this interface. You must use the tagged traffic of the bridge:

brctrl addbr br0  eth0
brctrl addbr br1 br0.1
ifconfig br1 192.168.10.1

If you have one bridge containing the "parent" interface, e.g. br-lan over eth0 and another bridge containign a vlan interface, e.g. br-vlan over eth0.1, the bridge containing the parent will eat all frames, also the tagged ones, thus the bridge over the vlan iface sees no traffic.

You can try to make the vlan interface on top of the bridge, e.g. br-lan over eth0 and then vconfig add br-lan 1 to get a br-lan.1 .

No i've managed to create two vlans and they both work when tagging is used.

root@OpenWrt:~# brctl show
bridge name    bridge id        STP enabled    interfaces
br-vlan10        8000.0018e7d418b8    no        eth0.10
br-vlan1        8000.0018e7d418b8    no        eth0.1

but the problem is that they only work when tagged interfaces is used. If i chance ports (t/not t) from /etc/config/network, it doesn't change anything

root@OpenWrt:/# cat etc/config/network 

config 'interface' 'loopback'
    option 'ifname' 'lo'
    option 'proto' 'static'
    option 'ipaddr' '127.0.0.1'
    option 'netmask' '255.0.0.0'

config 'interface' 'vlan10'
    option 'type' 'bridge'
    option 'proto' 'static'
    option 'ipaddr' '10.250.250.2'
    option 'netmask' '255.255.0.0'
    option 'defaultroute' '0'
    option 'peerdns' '0'
    option 'ifname' 'eth0.10'

config 'interface' 'vlan0'
    option 'type' 'bridge'
    option 'proto' 'static'
    option 'ipaddr' '192.168.1.100'
    option 'netmask' '255.255.0.0'
    option 'defaultroute' '0'
    option 'peerdns' '0'
    option 'ifname' 'eth0.1'
    option 'stp' '0'
    

config 'switch'
    option 'name' 'rtl8366s'
    option 'reset' '1'
    option 'vlan' '1'

config 'switch_vlan'
    option 'device' 'rtl8366s'
    option 'vlan' '10'
    
    option 'ports' '0t 1t 2t 3t 4t 5t'

config 'switch_vlan'

##this should work untagged but it doesn't. conection can be created only with vid 1

    option 'device' 'rtl8366s'
    option 'vlan' '1'
    option 'ports' '0 1 2 3 4 5t'

What can i do? How can i configure ports of another vlan to work with untagged traffic?

(Last edited by john.steel on 30 Sep 2010, 12:28)

I tried making a vlan interface on top of bridge br-lan by doing vconfig add br-lan 1, but not able to find it in ifconfig. Though running the vconfig command again shows file exists. How to check the interface and whether it is being made or not.? Also how to use it?

Anirudh: Please create a new topic describing your issue. The previous posts by john.steel & co have nothing to do with your issue, they are nearly 7 years old...

The discussion might have continued from here.