In this lab session I wanted to accomplish two things: experiment with setting up DTP and perform inter-VLAN routing via router-on-a-stick
First, I wanted to try configuring DTP so I set up a pair of switches with a single connection between them. By default, the switches are put into dynamic auto mode which means they will negotiate to access ports.

To change this, I'll have to set one of the ports to be in either dynamic desirable mode or a trunk. I will set one switch to be in dynamic desirable mode with the command switchport mode dynamic desirable on the interface.
Once configured, the interface goes down momentarily and comes back up and should now be in dynamic desirable mode and form a trunk with the other switch. I confirmed by looking at the show interfaces output on both switches:

Next, I wanted to set up a router-on-a-stick to do inter-VLAN routing. To do this I added a couple PCs to the topology that will be in separate VLANs as well as a router coming off one of the switches.

First, I created a few VLANs and set up a management VLAN with a default gateway IP address.
Then I configure the appropriate ports to be either access or trunk ports. The connections to the PC's should be access ports and the connections between the switches and the router should be trunk. The switches are already set up as a trunk from the first part of the lab, so all that I'll have to do is the connection to the router.
Once each interface is properly assigned, the next step will be to configure subinterfaces on the router. The subinterfaces will allow us to route to each VLAN, thus we need to create a subinterface for each VLAN we want to route. For the configuration we have to set the encapuslation (dot1Q) to allow the trunk traffic and then assign an IP address for each subinterface.

*Note to remember to enable the main interface to bring up the subinterfaces, otherwise they will not pass traffic.
Everything should now be set up and we should be able to ping the PCs across the VLANs. To confirm we will go on the PCs and attempt to ping the other.
From PC1:

From PC2:

Final topology:

Created with © systeme.io