Bridging wan and 1 lan port

I am using firmware version latest one, dir 853 A3, which is the best way to bridge wan and one lan port? since i am looking for switch option and vlan... its missing on my router

Please connect to your OpenWrt device using ssh and copy the output of the following commands and post it here using the "Preformatted text </> " button:
grafik
Remember to redact passwords, MAC addresses and any public IP addresses you may have:

ubus call system board
cat /etc/config/network

This will only work if your ISP provides multiple IP addresses (or if you're already behind a standard router).

Start by adding the wan port to br-lan like this:

config device
        option name 'br-lan'
        option type 'bridge'
        list ports 'lan1'
        list ports 'lan2'
        list ports 'lan3'
        list ports 'lan4'
        list ports 'wan'

Then create two bridge VLANs:

config bridge-vlan
        option device 'br-lan'
        option vlan '1'
        list ports 'lan1:u*'
        list ports 'lan2:u*'
        list ports 'lan3:u*'

config bridge-vlan
        option device 'br-lan'
        option vlan '2'
        list ports 'lan4:u*'
        list ports 'wan:u*'

Edit the lan to use br-lan.1 like this:

config interface 'lan'
        option device 'br-lan.1'
        option proto 'static'
        option ipaddr '192.168.2.1'
        option netmask '255.255.255.0'
        option ip6assign '60'

And finally edit the wan to use br-lan.2. Also, you must remove the bridge lines. It will look like this:

config interface 'wan'
        option device 'br-lan.2'
        option proto 'dhcp'
        option metric '20'
        option peerdns '0'
        list dns '1.1.1.1'
        list dns '1.0.0.1'

config interface 'wan6'
        option device 'br-lan.2'
        option proto 'dhcpv6'
        option type 'bridge'

Restart and then port lan4 will be bridged with the upstream connection. You can use the same concepts to select any other port, instead, just adapt as needed.

Keep in mind, though, that if the ISP only allows a single IP address, this solution will not work as expected... only one device (the router we're adjusting now or the other router) will get an IP from the ISP.

The other solution is to simply use policy based routing instead of trying to setup two routers like this.

1 Like