This allows the router to route between the two VLANs. You can see both sub-interfaces in the routing table. O - ODR, P - periodic downloaded static routeĬ 192.168.10.0/24 is directly connected, FastEthernet0/0.10Ĭ 192.168.20.0/24 is directly connected, FastEthernet0/0.20 Ia - IS-IS inter area, * - candidate default, U - per-user static I - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2Į1 - OSPF external type 1, E2 - OSPF external type 2 Let’s check the routing table: R1# show ip routeĬodes: C - connected, S - static, R - RIP, M - mobile, B - BGPĭ - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area Fa0/0.10 will belong to VLAN 10 and Fa0/0.20 to VLAN 20. There is no way for our router to know which VLAN belongs to which sub-interface so we have to use this command.
![router on a stick lab router on a stick lab](https://www.packettracerlab.com/wp-content/uploads/2021/02/Inter-Vlan-routing.png)
One important command is the encapsulation dot1Q.
![router on a stick lab router on a stick lab](https://i0.wp.com/howdoesinternetwork.com/wp-content/uploads/Reflexive-ACL-Topology.png)
IP address 192.168.10.254 will be the default gateway for computers in VLAN 10 and 192.168.20.254 for computers in VLAN 20. R1(config-subif)# ip address 192.168.20.254 255.255.255.0Ībove you can see my two sub-interfaces and the IP addresses that I assigned to them. R1(config)# interface fastEthernet 0/0.20 R1(config)# interface fastEthernet 0/0.10 Here’s what the configuration looks like on the router: R1(config)# interface fastEthernet 0/0