Introduction:

Inter-VLAN Routing means enabling communication between originally isolated vlans, and Router on a Stick (also called single-arm routing) refers to implementing vlan communication on a single port of a router.


Objective:

Configure multiple vlan groups on a single router port and enable communication between different vlans.


Simulation Scenario:

Diagram_2021-09-18_095748

vLanIP(Subnet)
vlan1010.10.10.0/24
vlan2010.10.20.0/24

PC1 is in vlan10, PC2 is in vlan20, the IPs of the two computers are in different segments, and the router settings allow PC1 and PC2 to communicate with each other.


Router Settings (Cisco 2901)

Router_2021-09-18_092543

Router>enable
Router#configure terminal

Enter Global Configuration Mode

Router(config)#interface gigabitEthernet 0/1
Router(config-if)#no shutdown
Router(config-if)#exit

Select physical port 0/1 and enable it

Router(config)#interface gigabitEthernet 0/1.10
Router(config-subif)#encapsulation dot1Q 10
Router(config-subif)#ip address 10.10.10.1 255.255.255.0
Router(config-subif)#exit

Configure sub-interface on physical port 0/1

Configure 802.1Q protocol and assign vlan10

Set the IP address of the interface

Router(config)#interface gigabitEthernet 0/1.20
Router(config-subif)#encapsulation dot1Q 20
Router(config-subif)#ip address 10.10.20.1 255.255.255.0
Router(config-subif)#end

Configure sub-interface on physical port 0/1

Configure 802.1Q protocol and assign vlan20

Set the IP address of the interface

Router#write memory

Save the configuration


DHCP Server Setup on the Router

Router_DHCP_2021-09-18_094946

Router>enable
Router#configure terminal

Enter Global Configuration Mode

Router(config)#ip dhcp excluded-address 10.10.10.1 10.10.10.50
Router(config)#ip dhcp pool dhcp.vlan10
Router(dhcp-config)#default-router 10.10.10.1
Router(dhcp-config)#network 10.10.10.0 255.255.255.0
Router(dhcp-config)#dns-server 1.1.1.1
Router(dhcp-config)#exit

10.10.10.1 - 10.10.10.50 are reserved IP address segments, not assigned to devices.

Create an address allocation pool named dhcp.vlan10

Default router IP address 10.10.10.1

Network segment is 10.10.10.0/24

DNS server is 1.1.1.1

Router(config)#ip dhcp excluded-address 10.10.20.1 10.10.20.50
Router(config)#ip dhcp pool dhcp.vlan20
Router(dhcp-config)#default-router 10.10.20.1
Router(dhcp-config)#network 10.10.20.0 255.255.255.0
Router(dhcp-config)#dns-server 1.1.1.1
Router(dhcp-config)#exit

10.10.20.1 - 10.10.20.50 are reserved IP address segments, not assigned to devices.

Create an address allocation pool named dhcp.vlan20

Default router IP address 10.10.20.1

Network segment is 10.10.20.0/24

DNS server is 1.1.1.1

Router(config)#end
Router#write memory

Save the configuration


Switch Settings (Cisco 2960)

Switch_2021-09-18_091732

Switch>enable
Switch#configure terminal

Enter Global Configuration Mode

Switch(config)#vlan 10
Switch(config-vlan)#name vlan10
Switch(config-vlan)#exit

Create and name vlan10

Switch(config)#vlan 20
Switch(config-vlan)#name vlan20
Switch(config-vlan)#exit

Create and name vlan20

Switch(config)#interface fastEthernet 0/1
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 10
Switch(config-if)#exit

Configure port 0/1 in access mode and assign it to vlan10

Switch(config)#interface fastEthernet 0/2
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 20
Switch(config-if)#exit

Configure port 0/2 in access mode and assign it to vlan20

Switch(config)#interface fastEthernet 0/24
Switch(config-if)#switchport mode trunk
Switch(config-if)#exit

Configure port 0/24 in trunk mode to connect to the router

Switch(config)#end
Switch#write memory

Save the configuration


Test Connectivity

Connect PC1 to FastEthernet 0/1 and PC2 to FastEthernet 0/5 on the switch. Connect the router’s GigabitEthernet 0/1 port to the switch’s GigabitEthernet 0/1 port. Set PC1 and PC2 to obtain IP addresses automatically. They should receive IP addresses from their respective DHCP pools.

2021-09-18_095342

PC1 is assigned the IP address 10.10.10.51 (vlan10 network segment)

2021-09-18_095352

PC2 is assigned the IP address 10.10.20.51 (vlan20 network segment)

2021-09-18_095534

2021-09-18_095519

Test connectivity between PC1 and PC2 by using the ping command.


Conclusion:

We be able to successfully send and receive packets between PC1 and PC2, even though they are on different VLANs. This demonstrates successful inter-VLAN communication using the Router on a Stick method.