Flexible use of Wan and Lan ports

Hi, can some one point me to the right documentation. I have a couple of routers I would like to play with the config on (Netgear 3400 v1 and TL-WR1043). I am not sure if these are a matter of VLAN config, Switch config and-or bridge config. I am having a hard time getting to the right documention. There are several projects I want to try.

  1. Using the Wan port as an additional Lan port and using the physical lan ports + the wan port as a switch.
  2. sepperating out the Lan ports for differnt purposes and being on different networks:
    2.1 I would like to use MWan3 to have a back up internet config and use one of the Lan ports as an additional Wan interface. How can I do this.
    2.2 I have a VPN off to foreign land and I would like to have one of the Lan ports 'sit' in this in the sense that all the traffic to and from it goes over the VPN. It may have its own subnet if this simplifies things, it will be Natted over the VPN. If possible it can talk to other hosts on the Lan although this las point is not so important.
    2.3 More complex. One port on the Lan is part of a switch with the Wan interface so that the host on that port gets an IP from the up stream router, but the other ports function as a normal Lan, then taking this further combine this with 2.1.
    2.4 reverse to normal. the Wan port is the Lan as only one physical connection is needed and the Lan ports act as a switch and Wan side interface so that mutiple boxes connceted to the 'Lan' interfaces get IPs from the up stream router.
    2.5 mix and match some or all of the above.
    2.6 second Wlan which is routed off via the VPN.

I have been google and searching without much sucess. I am not sure if the Lan ports configuration is a VLan issue or a switch configuration issues or whether in fact it depends on the hardware and its capabilities, hence I detail the above hardware. But I would like to understand in detail.



If they are all connected to the same eth port on the cpu, you can just assign them all in the same vlan.
If they are in different, you could bridge the interfaces.

Create a new vlan and assign one of the lan ports to this vlan. Then create a new uci interface on the newly created physical interface.

I would use a rule and a static route.

Again wan vlan and assign this port in the wan vlan.

Generally speaking, the rest of your questions are answered already. You just need to understand what vlans are, how they work, the difference in tagged/untagged, how they apply on OpenWrt, then lay down your plan and implement it.

1 Like
  • Browse to Network > Switch and change WAN port's VLAN from 2 to 1.
  • Save and Apply

Create another interface with VLAN (e.g. eth0.3) and add it to the switch config. Depending on 2.1, 2.2, etc. depends on what further config you need. Then firewall appropriately.

If I understand 2.4, you would do the reverse of question 1 (change all ports to VLAN 2).

Thanks for these reples which are helpful. One more question.

What, if any, is the eifference between moving the ports in the switch configuration so that the lan ports are the Wan interfact and the wan port is the (one and only) lan interface and doing the same in the definition of the Wan and lan interfaces (i.e. editing the lan interface to be eth1 and the wan to be eth0.1 when they were the other way around origionally).


I am not sure I understand the question here.
It depends which version do you have.

The v2.x and v3.x get the lan and wan interface not via eth0.1/eth0.2 but via eth0 (wan) and eth1 (lan). The eth0 is in the same vlan as port 5 on the switch. Because of that, port 6 on the v2.x, v3.x routers is an additional CPU port - used for wan traffic only.

If you want to have LAN on the wan port on v2/3 you could just reassign the physical interface of LAN interface to be eth0 instead of eth1
There are also examples further down the page about moving the wan port to be part of LAN interface.

As I understand you want to switch the LAN ports to WAN ports and WAN ports to LAN ports? If yes, then this can be done through VLAN and network configuration. You will just either reverse the VLAN config or change the ports within network interfaces and you should be good to go.

Yes, but, actually I want to do this on a Netgear 3400, I have suceeded on a TL-WR1043, the Netgear is confusing me.

Thanks again

Well if you can share the switch configuration screenshot then maybe I can try to explain.

Better the uci show network

I am not expert in the config options so that is why I asked for a screenshot.

Here is how I did it on a GL AR750 router https://gist.github.com/tiagonmas/48ec43ba281c220e544ca55eea9384cd