OpenWrt Forum Archive

Topic: configure wan port as additional lan port

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

I have a TP-Link 1043ND accesspoint and don't use it as router, but I want to use the WAN port as a LAN port, how do I modify my configuration to achieve this ?

I use Backfire 10.03

Below my 'network' configuration :

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

config 'interface' 'lan'
        option 'ifname' 'eth0.1'
        option 'type' 'bridge'
        option 'proto' 'static'
        option 'netmask' '255.255.255.0'
        option 'ipaddr' '192.168.1.2'
        option 'defaultroute' '0'
        option 'peerdns' '0'
        option 'gateway' '192.168.1.1'
        option 'dns' '192.168.1.1'

config 'interface' 'wan'
        option 'ifname' 'eth0.2'
        option 'type' 'bridge'
        option 'defaultroute' '0'
        option 'peerdns' '0'
        option 'proto' 'none'

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

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

config 'switch_vlan'
        option 'device' 'rtl8366rb'
        option 'vlan' '2'
        option 'ports' '0 5t'

uci del network.wan
uci set network.lan.ifname='eth0.1 eth0.2'
uci commit
/etc/init.d/network restart
aport wrote:
uci del network.wan
uci set network.lan.ifname='eth0.1 eth0.2'
uci commit
/etc/init.d/network restart

Bridging has less performance than vlan.

I set vlan1 and vlan2 as below when I want to use the WAN port as LAN.

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

config 'switch_vlan'
        option 'device' 'rtl8366rb'
        option 'vlan' '2'
        option 'ports' '5t'
playdude wrote:

I set vlan1 and vlan2 as below when I want to use the WAN port as LAN.

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

config 'switch_vlan'
        option 'device' 'rtl8366rb'
        option 'vlan' '2'
        option 'ports' '5t'

You can drop the second switch_vlan, as well as wan interface definition.

You should also be able do the following, this should (in theory) slightly increase the maximum throughput to/from your box:

...

config 'interface' 'lan'
        option 'ifname' 'eth0'
        option 'type' 'bridge'
        option 'proto' 'static'
        option 'netmask' '255.255.255.0'
        option 'ipaddr' '192.168.1.2'
        option 'defaultroute' '0'
        option 'peerdns' '0'
        option 'gateway' '192.168.1.1'
        option 'dns' '192.168.1.1'

...

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

...

This disables VLAN tagging entirely and configures the realtek as a "dumb" switch. This should reduce the cpu overhead of processing packets.

The discussion might have continued from here.