5

I am thinking especially of VLANs, which represent separate subnets that may need only one switch.

1
  • 4
    You need something that performs a routing function, it could be a linux server with routing enabled, a firewall, a Layer3 load-balancer, or a router / Layer3 switch. If the aforementioned items were what you're calling "a router", then yes... you must have those for the different subnets to communicate, unless your hosts are also dual-homed to the aforementioned subnets. Jun 6, 2013 at 21:40

3 Answers 3

14

You need a Layer-3 capable device to route between VLANs. This can be a L3-capable switch though, it doesn't have to be a separate router.

6

Before things like "virtual interfaces" came around, you would need a separate router to terminate layer 3 connectivity for VLANs. The term originally used was "router on a stick" because there was a single VLAN trunk connecting to the router, and subinterfaces of the router's interface which connected to the switch were used to create the layer 3 entities that were representative of each VLAN's subnet.

As @Aziraphale has said, With modern switches, this is no longer necessary. Assuming your switch is running the right version of code, it's usually just as simple as defining interfaces for your L2 Vlans. For a Cisco switch running IOS, something along the lines of:

conf t
vlan 100  <--- this creates the L2 VLAN. What shows up in "show vlan id"
name Marketing
exit
interface vlan 100  <--- This creates the L3 endpoint for your VLAN, called an "SVI"
ip address 192.168.1.1 255.255.255.0

If the switch is running L3 capable code, this creates a directly connected network in the switch's routing table. If you repeated this with 2 different VLANs with different subnets, you can now route between those three VLANs in one box.

1
  • 2
    If it is a Cisco Layer 3 switch, make sure you type "ip routing" when you're done :-)
    – WaxTrax
    Jun 6, 2013 at 22:08
4

To add to everyone else, VLANs represent separate broadcast domains, and require a Layer-3 capable device to route packets between them.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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