Configuring the Router-on-a-Stick Solution
The configuration process of the router-on-a-stick solution consists of two parts: configuring the switch and the router. On the switch, you need to:
- create the desired VLANs,
- set the membership mode on the interfaces, and
- assign the access ports to the corresponding VLANs.
On the router, you need to:
- create subinterfaces,
- assign them to the desired VLANs, and
- define IP addresses.
VLAN and Trunking Configuration on a Switch
Based on the topology example in the image above, you need to configure the following commands on the switch, assuming the interfaces are already enabled:
Subinterface Configuration on a Router
The configuration process on the router consists of three steps:
- Configuring subinterfaces: Enter the mode of the subinterface you want to use on the router. This can be done by using the interface [interface.subinterface_number] command. For example, “interface Fa0/1.10” to configure subinterface 10 inside interface FastEthernet0/1.
- Mapping the subinterfaces to the desired VLANs on the switch: This can be done by using the encapsulation dot1q [vlan_number] command, which defines the 802.1Q encapsulation and mapping to the desired VLAN.
- Assigning IP addresses on subinterfaces: The IP address required for routing will also serve as a default gateway for the devices in the corresponding VLAN.
You need to configure the following commands on the router, assuming the interfaces are already enabled:
To verify the configuration on the router, you can use the following commands:
- show ip interface brief: To verify the subinterfaces and the parameters defined.
- show vlans: To verify the mapping of the subinterfaces and the VLANs.
- show ip route: To verify that the router can reach the VLAN networks.
The best way to verify connectivity is always to perform a ping from a device in one VLAN to a device in another.