Next, use ping to verify connectivity with PC2 and S1, as shown in Figure 4-5. The output confirms the IPv4 address and default gateway of PC1.
SUBINTERFACES ROUTER ON A STICK WINDOWS
Example 4-7 Verify Windows Host Configuration C:\Users\PC1> ipconfig It is a good idea to first verify the current host IP configuration using the ipconfig Windows host command, as shown in Example 4-7. The configuration can be verified from the hosts, router, and switch.įrom a host, verify connectivity to a host in another VLAN using the ping command. The router-on-a-stick configuration is complete after the switch trunk and the router subinterfaces have been configured. R1# Verify Connectivity Between PC1 and PC2 (4.2.5) GigabitEthernet0/0/1, changed state to up *Sep 15 19:08:51.071: %LINEPROTO-5-UPDOWN: Line protocol on Interface R1(config-if)# description Trunk link to S1 R1(config-subif)# description Default Gateway for VLAN 99 R1(config-subif)# description Default Gateway for VLAN 20 R1(config-subif)# description Default Gateway for VLAN 10 Example 4-6 R1 Subinterface Configuration R1(config)# interface G0/0/1.10 In the configuration in Example 4-6, the R1 G0/0/1 subinterfaces are configured for VLANs 10, 20, and 99. If the physical interface is disabled, all subinterfaces are disabled. When all subinterfaces have been created, enable the physical interface using the no shutdown interface configuration command. Each router subinterface must be assigned an IP address on a unique subnet for routing to occur. Repeat the process for each VLAN to be routed. This address typically serves as the default gateway for the identified VLAN. Ip address ip-address subnet-mask : This command configures the IPv4 address of the subinterface. The native keyword option is only appended to set the native VLAN to something other than VLAN 1. Although not required, it is customary to match the subinterface number with the VLAN number.Įach subinterface is then configured with the following two commands:Įncapsulation dot1q vlan_id : This command configures the subinterface to respond to 802.1Q encapsulated traffic from the specified vlan-id. The subinterface syntax is the physical interface followed by a period and a subinterface number. The router-on-a-stick method requires you to create a subinterface for each VLAN to be routed.Ī subinterface is created using the interface interface_id.subinterface_id global configuration mode command. *Mar 1 00:23:52.137: %LINEPROTO-5-UPDOWN: Line protocol on InterfaceįastEthernet0/1, changed state to up R1 Subinterface Configuration (4.2.4) Example 4-5 S2 Configuration S2(config)# vlan 10 The configuration for S2 is similar to S1, as shown in Example 4-5. S2 VLAN and Trunking Configuration (4.2.3) *Mar 1 00:23:44.511: %LINEPROTO-5-UPDOWN: Line protocol on Interface *Mar 1 00:23:43.093: %LINEPROTO-5-UPDOWN: Line protocol on Interface Example 4-4 Configure Trunking Ports S1(config)# interface fa0/1 Finally, ports Fa0/1 connecting to S2 and Fa05 connecting to R1 are configured as trunk ports, as shown in Example 4-4. Example 4-3 Configure Access Ports S1(config)# interface fa0/6 Assume PC1 has been configured with the correct IP address and default gateway. Next, port Fa0/6 connecting to PC1 is configured as an access port in VLAN 10, as shown in Example 4-3. Example 4-2 Create the Management Interface S1(config)# interface vlan 99 Next, the management interface is created on VLAN 99 along with the default gateway of R1, as shown in Example 4-2. Example 4-1 Create and Name VLANs S1(config)# vlan 10 VLANs are created only after you exit out of VLAN subconfiguration mode. First, the VLANs are created and named, as shown in Example 4-1.