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. encapsulation dot1q vlan_id – This command configures the subinterface to respond to 802.1Q encapsulated traffic from the specified vlan-id.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: 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 FastEthernet0/1, changed state to up R1 Subinterface Configuration Router-on-a-Stick Example S2(config)# vlan 10 The configuration for S2 is similar to S1. Only S1 and S2 can ping each other, but they but are unreachable by PC1 or PC2 because they are also on different networks. Currently, PC1 and PC2 cannot ping each other because they are on separate networks. The table also shows the three VLANs that will be configured on the switches.Īssume that R1, S1, and S2 have initial basic configurations. To route between VLANs, the R1 GigabitEthernet 0/0/1 interface is logically divided into three subinterfaces, as shown in the table. These are trunk links that are required to forward traffic within and between VLANs. The S1 FastEthernet 0/1 port is connected to the S2 FastEthernet 0/1 port.
In the figure, the R1 GigabitEthernet 0/0/1 interface is connected to the S1 FastEthernet 0/5 port. You can see in the figure that the router is not in the center of the topology but instead, appears to be on a stick near the border, hence the name.
This topic details how to configure router-on-a-stick inter-VLAN routing. In the previous topic, three different ways to create inter-VLAN routing were listed, and legacy inter-VLAN routing was detailed.
Router-on-a-Stick Inter-VLAN Routing Verification.Verify Connectivity Between PC1 and PC2.