0

I have two VLANs (VLAN10 + VLAN20)

I've got them configured successfully on my routers and L3 switches and now wanting to get routing working efficiently on IPv4.

Router diagram

What I want to solve now is getting routing information, specifically default gateway information to DHCP clients working dynamically so that they route via the local switch rather than going back to the main router when routing between VLANs.

My core reason for this is that my router only has a 1Gbps link and so currently cross-VLAN routing is limited to 1Gbps.

Ideally, I want to keep broadcast traffic global (but not sure this is possible) as it's a single subnet for each VLAN in practice.

Is it possible to have each L3 switch "block" their upstream DHCP servers and then publish as a relay so that it can pass through its address as the default gateway for devices?

If this is not possible how else could I structure this network to allow for inter-vlan routing to occur at the nearest L3 router/switch rather than going all the way back to the main router? (to complicate things there is a wireless AP under each switch that I would want to enable roaming between).

1 Answer 1

1

I want to keep broadcast traffic global (but not sure this is possible) as it's a single subnet for each VLAN

Not happening. The entire purpose of VLANs is to separate L2 broadcast domains.

how else could I structure this network to allow for inter-vlan routing to occur at the nearest L3 router/switch

You simply enable routing on the switches.

  • Assume VLAN 10 and 20 are both present on the 328. With routing enabled the switch will route between directly connected VLANs w/o sending traffic to the router
  • Assume VLAN 10 is on the 328 and VLAN 20 is on the 309. When traffic is sent from VLAN 10 to VLAN 20, if the 328 already knows 309 has the route to this subnet it will route the traffic directly there. If not, it will query which neighboring router knows the route, 309 will respond and 328 will know how the subnet is reached. In either case no inter-VLAN traffic is sent to the router.

Is it possible to have each L3 switch "block" their upstream DHCP servers and then publish as a relay

Mikrotik 300-series switches know DHCP option 82, so they can act as DHCP relay agents.

to complicate things there is a wireless AP under each switch that I would want to enable roaming between)

Whether this complicates things depends on the APs. To allow roaming both APs must bcast the same SSID(s). If they're dot1Q capable, you should be able to configure them to drop the Wi-Fi traffic on SSID 10 to VLAN 10, and SSID 20 to VLAN 20 etc.

How to do this in practice:

  1. Configure inter-switch and switch-AP links to be trunked so they can pass traffic on multiple VLANs
  2. Put the router on its own subnet - switch-router links don't need trunking
  3. Connect both switches directly to the router so traffic intended outside of the VLANs can be directly forwarded to the router w/o passing the inter-switch link
  4. Enable routing on the switches
  5. Point the switches' default route to the router
  6. Configure the router to provide DHCP service on all VLANs
    • Set the client default GW to be a switch
      • The clients will always send the traffic destined outside their own network towards the DGW. If the DGW is set to be the router, the switch will forward the traffic to the router whether or not IP routing is enabled on the switch.
    • If the router is only capable of providing DHCP service on a single subnet, you need to set up a DHCP server elsewhere in the network. I'd put this to the same VLAN with the router so it doesn't receive any other client traffic but DHCP.
  7. Configure DHCP option 82 (DHCP Relay) on the switch VLANs
  8. Configure SSIDs you need on the APs
  9. Configure the APs to forward the traffic received on a specific SSID to the appropriate VLAN

An example as a pic is worth 1000:

pic

For detailed instructions refer to Mikrotik documentation and the documentation of your APs.

WoL packets are normally sent to the L2 bcast address. That means that by default they cannot be forwarded across VLANs. One way to get around this is to configure the WoL source system's physical interface to have subinterfaces on each VLAN. On Linux / UNIX systems (incl. MacOS) you'd configure for example eth0.10 for VLAN 10, eth0.20 for VLAN 20 etc. On Windows systems it's a bit more complicted. The switch interface connecting to this system needs to be trunked for each VLAN. This way a single system can send WoL to each VLAN separately.

There may be also other solutions. Searching for mikrotik wol across vlans brings a few results with possible solutions / workarounds from Mikrotik forums.

2
  • VLAN 10 and VLAN 20 are on both 328 and 309. What I'm seeing is that packets between VLAN 10 and VLAN 20 on 309 are being routed via the router. I'm assuming this is because the default gateway from DHCP is the router? Commented Apr 9, 2023 at 8:10
  • So I either want separate vlans on each switch (so I can have separate DHCP responses with the appropriate gateway, at the cost of not being able to WOL across switches) or I need to pick a switch (probably 328) to be the default gateway instead of the router? Commented Apr 9, 2023 at 8:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .