In this video, Russ goes through the router on a stick implementation. Learn how the router on a stick implementation works and when it should be deployed.
- [Instructor] One of the simplest implementations of routing is the Router on a Stick implementation. The new term for this, by the way, is Router on a Trunk. But in either case, whatever you call it, the purpose is the same, to provide inter-VLAN routing within a topology. Now creating a router on a stick allows the topology to pass traffic between VLANs in a multiple VLAN network. The goal is to allow VLAN traffic to be passed between VLANs by adding a layer three device to the top of our network topology.
Let's take a look at the physical topology. As you can see, the links between the switches on the left hand side of the screen are configured as trunks. But how does this work with the router interface? Routers don't have the ability to have trunk links. Let's dive into the logical topology to get a better understanding of how this thing works. As we can see at the access layer, we have a single VLAN that is being allowed.
This is what we would expect since most computers tend to reside on a single network or subnet. Now when we move up a layer, we see that the switch links are trunked, and in this case are carrying traffic for the VLANs they need to. Now this is called pruning where we don't carry all the VLANs within a topology, but only the VLANs that are required. As you can see at the top of the screen, we have blue and green. The trunk link between the two switches up a layer only move traffic for blue and green because that is what's required of it.
We have pruned off that orange VLAN. Now we see the link that connects to the router. The switch side of this link is still trunked but what do we do on the router side of things? We are going to introduce subinterfaces on the router side. Now if you remember way back in your IC and D one studies, a single router interface could only be assigned to a single network. We aren't exactly going to break that rule, but we're going to be bending it quite a bit.
So let's review, a router interface can't be configured as a trunk. This leads to a problem, right? Because we need to receive multiple VLANs from the downstream switch. Each is in a different subnet and we need a default gateway point or exodus point for each of those VLANs. But the router interface can only be assigned to one network. So what are we going to do? We will use subinterfaces as we stated earlier and instead of treating the interface as a single entity, we are going to break up that physical interface into logical units so that each VLAN will have its own interface.
It's just going to be a subinterface on the router. Now obviously this isn't ideal. And we are effectively dividing the bandwidth of the interface by a number of subinterfaces. Now if we don't push this too far, it could work well in certain environments. So subinterfaces, how do they work? Well they're broken down by adding a dot and a number to the original interface. So we have the physical interface, we're going to turn them into logical interfaces by assigning them a separate number.
So an example of this would be an interface is identified by fast ethernet one slash zero. The new identifier would be fast ethernet one slash zero dot 10 or even dot 20. This dot breaks it out into a subinterface. Now it's important to note that the dot doesn't really signify anything. It doesn't signify the VLAN. It is just an identifier, but from me to you, it definitely should be part of your naming convention to match the VLAN.
It is much easier to identify it and this makes troubleshooting a lot easier on your side. Now lastly, we do need to tie that subinterface to the correct VLAN. Now we would do this with the command encapsulation dot1q and then the VLAN number. This command issued at the subinterface level tells the router what tag traffic belongs to that specific subinterface that we just created. So let's take a look at traffic movement for the two scenarios in our environment.
The first is Intra-VLAN traffic, and as you can see, since we are in the same VLAN, no layer three intervention is required. Traffic moves up to the switch and then down to the destination using Mac addresses, and if required, we use address resolution protocol to find out the addresses we need. But what happens when we need to move between VLANs? In this example, we will see what happens when traffic needs to be routed between VLANs in our topology.
This is called Inter-VLAN traffic. As we can see, the data moves up to the switch and both VLANs are present on this switch, but this switch can only function at layer two. So it is unable to move the data to VLAN 20. To actually route between VLANs, we need to use the router on a stick so the traffic is handed upstream to the router. The router itself receives the traffic on the subinterface for VLAN 10 represented by the blue line in the diagram.
It then looks at its routing tables, figures out the interface it needs to use, in this case a subinterface, and passes the traffic back down. This time it uses the subinterface that has been designated for VLAN 20 represented by the green line in this diagram. As we can see, it passes through the first switch, then the last switch using the trunk links. Lastly, it traverses the access link that connects the switch to the computer for delivery.
- Static routing
- Dynamic routing
- Interior vs. exterior routing protocols
- InterVLAN routing
- OSPF routing
- EIGRP routing
- Other routing protocols