OpenWrt Forum Archive

Topic: [Solved] Use an OpenWRT router as a regular Ethernet bridge

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

Hi,

I need a regular Ethernet hub and found my old TPLink WR1043ND (v1) with OpenWRT lying in the garage, so I thought about using it for this purpose.

I found the dumbap and the bridgeap recipes in the docs and inspired from them. My goal is to have all the available Ethernet ports available, as a regular Ethernet hub (WAN or LAN, does not matter).


I ended up with the following /etc/config/network:

config interface lan
        option type     'bridge'
        option ifname   'eth0'  # Bridges vlan 1 and wan
        option proto    'dhcp'         # Change as appropriate

I use dhcp as my upstream router can provide my OpenWRT router an IP with dhcp. The OpenWRT router gets an IP assigned and has access to Internet. However, no other client from my OpenWRT router can contact (ping / get an IP from DHCP) the upstream router. They send DHCPDISCOVER but it seems it is never transmitted through OpenWRT router.

I disabled the built-in DHCP server from my OpenWRT router as well as any firewall.

What am I missing? Thanks!

(Last edited by phyks on 23 Jul 2017, 22:03)

phyks wrote:
        option ifname   'eth0'  # Bridges vlan 1 and wan

Shouldn't a bridge contain more than one interface?

I guess I missed something. It might be the issue here, but ifconfig only gives me br-lan and eth0, plus the wifi interface. What should the interfaces be?

Thanks

EDIT: Oh, your last post got me thinking and I managed to sort it out. Thanks!

In case it can be useful to anyone else, here is my final /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 globals 'globals'
    option ula_prefix 'fdf3:2cee:88e2::/48'

config interface 'lan'
    option ifname 'eth0.1'
    option force_link '1'
    option type 'bridge'
    option proto 'dhcp'

config interface 'lan6'
    option ifname '@lan'
    option proto 'dhcpv6'
    option reqprefix no

config switch
    option name 'switch0'
    option reset '1'
    option enable_vlan '1'

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

I was missing the switch part.

(Last edited by phyks on 23 Jul 2017, 22:02)

The discussion might have continued from here.