1

In the latest routers, where switching function is integrated into the box will have few LAN ports (say usually, 4 or 8) and 1 WAN port.

Usual configuration would be to connect computers or printers onto the LAN port and WAN port onto the modem to connect to the internet.

So is it like the LAN ports are nothing but the ports of the integrated switch? And WAN port is used to connect to a separate subnet, say to an another switch or to an another router? (Internally, it would be like integrated switch is connected to an another hidden WAN port*)

5

You have the right idea.Internally these devices are VLAN switches with exposed ports a member of a single vlan + a single port computer to do routing between vlans and configured to look like a dumb switch and wan port

If you can run it, DD-WRT for example - exposes the internal workings somewhat - typically all 5 ports - the WAN port included - are VLAN switch ports- with another invisible VLAN trunk port on the motherboard.

It is thus (software permitting - and most software does not) possible to combine ports so they are all on the same VLAN and appear as a dumb switch, or you can break them out on to separate vlans and have multiple "WAN" ports, or multiple lan subnets.

It is certainly possible to connect the WAN port to a separate subnet, say to an another switch or to an another router - really, that, and having a route table is the core requirement of a router.

  • "most software does not" -- because the last thing you want to ever happen is to accidentally set it up like this! – rackandboneman Mar 21 '18 at 23:10
  • 2
    "most software does not" because it would make their support burden higher because it makes things more complex. Its not really a high risk thing to do - no technical reason why this can't be done, save for ROR for developing the functionality - I've not seen swathes of reports from users of DD-WRT bricking their routers or systems - indeed, handled intelligently its only possible to set this functionality up if you know what you are trying to do - you are very unlikely to do it by mistake. – davidgo Mar 21 '18 at 23:19
  • @davidgo, I like this answer. But it should be mentioned, alot of these consumer grade routers have poor backplanes on the built in switch. I was very disappointed when I tried to do vlanning with many different types/models of routers. Minus the higher end devices, the WAN is a single port, and the LAN is a single port, but the software allows you to logically divide lan ports. The other downside I found was internally on some models the port mapping is backwards physical vs logical. Which can be very confusing. I steer new to networkers to just get a vlan capable switch for those reasons. – Tim_Stewart Apr 12 '18 at 14:34
5

It entirely depends on the router hardware.

I've seen router hardware where both the LAN ports and the WAN port are connected to the same switch, which is configured to add VLAN tags, and is connected to one ethernet port on the SoC of the router, where it's internally divided into two ethernet interfaces using the VLAN tag.

For those routers, when you reconfigure the switch, you can treat the WAN port as a fifth LAN port (if you don't need it), or you can use one of the LAN ports as the WAN port if the WAN port is broken (what happened on this particular router), etc.

I've also seen routers where the WAN port is connected to one ethernet port of the SoC, and the LAN ports are connected to a switch, and the switch is connected to a different ethernet port of the SoC. So you can't swap around anything on this hardware.

In general, no matter what the configuration, all of these are just ethernet ports. What makes them work as WAN or LAN is entirely the configuration on the embdedded Linux system that runs on the router.

  • It might be worth mentioning Distributed Switch Architecture which I would expected to be more common in this situation (over VLANs). – Attie Mar 21 '18 at 17:54
  • 1
    @Attie: Have you seen this on an actual router? Which model? – dirkt Mar 21 '18 at 17:59
  • Well... That explain whether a given port on the box can be LAN type or WAN type. I understand, thanks. However, my question is bit different. What is LAN port and WAN meant for? (I understand that you can configure any of the hardware Ethernet port to either LAN or WAN) – Darshan L Mar 21 '18 at 17:59
  • 3
    @DarshanL: Not sure if I understood your question. The LAN ports are for your local area network (your home network with your devices), while the WAN port connects to the wide area network (your ISP's network, in one form or other). But I thought that was really obvious, so maybe you mean something different? – dirkt Mar 21 '18 at 18:02
  • This DSA stuff reads like it is implemented using VLAN mechanics in the hardware... – rackandboneman Mar 21 '18 at 23:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.