- [Instructor] Routed interfaces can be more
than just a standard interface on a router
with an IP address slapped on it.
Something that's infinitely useful
is Router on a Stick.
In fact, the majority
of enterprise networks I build employ this technique.
In a nutshell, routers or layer three switches
will connect to a switch network
and have a single interface carry multiple VLANs,
each being routed in the router.
So, a single router can connect to a switch network
and terminate hundreds of subnets
all over a single physical interface
simply by utilizing VLANs.
In this example, the switching clients
have been pre-configured, save for interface Fa0/1
that connects to the router.
I'll now configure switch one
to send VLAN 10 and 11 over to the router,
so that it can route the subnets.
Config t, interface fa0/1.
Switchport trunk encapsulation, dot one Q.
Setting the switchport encapsulation is required
on this model of switch.
Now, switchport mode trunk.
Technically, that's all that's required
so now I'll move over to the router.
I'll start by entering the base interface.
Interface gig 0/1.
I'll add a quick description and enable the interface.
Description to switch one, fa0/1,
now, no shut.
If the main interface is disabled
then all sub-interfaces I'm about to create will be down.
And now I'll create a sub-interface for VLAN 10.
Interface gig 0/1.10.
While I made the sub-interface .10,
it could have been .111,
though it's best practice
to make the sub-interface the same as the VLAN.
Now, here's where the magic happens.
Encapsulation dot1q 10.
This tells the sub-interface
that it should utilize
the 802 dot1q VLAN tag 10 for this interface.
Now, I'll add an IP address, IP address 192.168.10.1
with subnet mask of 255.255.255.0
and then a no shut for fun.
I'll now do the same for VLAN 11.
Interface gig 0/1.11,
encapsulation dot1q 11.
IP address 192.168.11.1
with subnet mask of 255.255.255.0
and now I'll no shut the port.
I'll now do a test ping from host A over to host B.
Ping 192.168.11.2, success.
Going back to the diagram,
I'm going to remove the router
and just use the switch as the router
since it's technically a layer three switch.
In this first layer three switch scenario,
I'll create a switch virtual interface or SVI.
This is a logical interface that represents a VLAN.
For VLAN 10, it's as simple as interface VLAN 10.
I'll now add my IP addressing to it.
IP address 192.168.10.1
with a subnet mask of 255.255.255.0
and then no shut.
It really configures like a standard interface.
Now for VLAN 11.
Interface VLAN 11, IP address 192.168.11.1,
255.255.255.0 and no shut.
Going back to host A, I'll do another test ping.
Ping 192.168.11.2 and it's not working.
This is because this layer three switch
needs routing enabled.
This is done with IP routing.
I'll now switch back to the test host
and sure enough, it's working now.
Verification is as simple as verification
of any physical interface.
Show interface VLAN 10.
The routing table is viewed with show IP route.
Layer three switches like the catalyst line
can also turn standard layer two interfaces
into routed layer three interfaces.
In looking at the diagram,
pay special attention to host C.
I'll configure it's interface to be layer three.
The command that determines whether a port is layer two
or three is the switchport command.
If the switchport command is enabled,
then it's layer two.
In this case, I want to disable it
to make it layer three directly.
Config t, interface fa0/3, no switchport.
Now, I can put an address on it like any other port.
IP address 192.168.12.1, 255.255.255.0.
Router on a Stick, as well as layer three switch routing,
goes far beyond simply being useful.
I'd expect to see it in most networks
as well as the test.