0

Per the question, Lets try to clarify a bit. Can a switch that has a router connected to it, segregate traffic (using a VLAN) from traffic that is part of the modem/router the switch is connected to?

Example:

Switch connects to Modem/Router(aka Source)

Secondary Router connects to switch. Can the switch successfully VLAN traffic between the primary router and secondary router?

2
  • 1
    I don't understand what you are asking. Do you mean can the switch arbitrarily place frames in different VLANs?
    – Ron Maupin
    May 4 '18 at 21:01
  • I'm unsure. I want to have separate VLANs for the primary network and the secondary network. But the switch has to connect to the primary router to get internet connection.
    – Matt
    May 4 '18 at 21:08
1

Traffic in separate VLANs doesn't mix. No device in one VLAN can directly talk to a device in another VLAN. Any communication between them needs to happen across a router.

You could define a VLAN for WAN traffic with the router's WAN port and the WAN modem in it and another VLAN with the router's LAN interface and your internal computers and servers on it.

Simply think of ports connected to the same VLAN as connected to the same switch and ports connected to different VLANs as connected to different switches.

(Connecting a WAN interface to a managed switch has some caveats. You'll want to deactivate or secure all functions on that port that could compromise or disturb your internal network - STP, LLDP, CDP, MVRP, ...)

4
  • Can the switch control for a VLAN on the modem/router even if its before the switch though? This will be primarily used for wireless.
    – Matt
    May 4 '18 at 21:13
  • Sorry, I don't get that...
    – Zac67
    May 4 '18 at 21:14
  • You and me both. How about this scenario. Can the switch create a VLAN only for the secondary router, that will keep it seperate from devices on the modem/router? So instead of having two vlans, it would technically be one. But it would still have to go through the primary router for internet. Do you think this would work?
    – Matt
    May 4 '18 at 21:17
  • You'd create two VLANs for that (see answer), one for the WAN side, one for the LAN side. With simple, port-based VLANs you just spilt the switch in two. E.g. two ports for WAN, the rest for LAN - or three VLANs, two for separate LAN segments.
    – Zac67
    May 4 '18 at 21:24
2

I think you don't really understand what you are asking. A router can send traffic to different VLANs of a switch. Whether you have multiple physical interfaces on the router, each connected to a different switch access interface in a different VLAN, or you can have different logical interfaces on a single physical interface that connects to a trunk interface on the switch.

In the image, the router on the left has different physical interfaces connecting to different physical interfaces on a switch. Each link is for a separate VLAN. The router on the right connects to the switch with a single physical link, but it has multiple logical interfaces on the physical link, and each logical interface is in a different VLAN.

enter image description here

In either case, the router is necessary for traffic to get from one network to a different network. A VLAN is really just partitioning the switch into multiple logical switches that do not directly communicate with each other.

3
  • So the switch just routes based on the VLAN setting( such as port, or other rules), It doesn't care where the source is from or to? Yes?
    – Matt
    May 4 '18 at 21:25
  • No, switches do not route; routers route, hence the name router. Switches switch frames within the same VLAN (frames cannot cross VLANs). Routers route packets between networks, and (normally) each VLAN is configured with a different network.
    – Ron Maupin
    May 4 '18 at 21:26
  • Ok, I think I understand now. Your diagram definitely helped make it clearer. Thank you.
    – Matt
    May 4 '18 at 21:29

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.