[ad_1]
Command
Encapsulation Dot1Q
Use
Permits you to use a router interface as a trunk port to a change. That is also called “Router on a stick” as a result of the change makes use of the router to route between VLANs.
Syntax
Router(config-subif)#encapsulation dot1Q <vlan> <native>
Choice
<native> | Units the vlan on the subinterface to behave because the native VLAN. |
Instance
Within the beneath instance we are going to configure a primary “router on a stick” configuration. First, we are going to configure the port linked to 2611XM’s Fa0/1 interface to be a trunk on the change.
Routers solely help Dot1Q encapsulation.
2950-XL#present cdp neighbor Functionality Codes: R – Router, T – Trans Bridge, B – Supply Route Bridge S – Swap, H – Host, I – IGMP, r – Repeater Machine ID Native Intrfce Holdtme Functionality Platform Port ID 2611XM Fas 0/1 174 R S I Cisco 2611Fas 0/0 2611XM Fas 0/3 166 R S I Cisco 2611Fas 0/1 2950-XL#conf t 2950-XL(config)#int fa0/3 2950-XL(config-if)#switchport trunk encapsulation dot1q 2950-XL(config-if)#switchport mode trunk
Now we configure the router’s Fa0/1 interface to behave as a trunk.
First, we take away the ip handle on the bodily interface.
Subsequent, we configure a subinterface for every VLAN the hyperlink shall be a trunk for. The interface quantity will be something you need.
After that, we configure encapsulation dot1q <vlan> for every subinterface. This command needs to be entered earlier than the IP handle or you’re going to get an error seen beneath.
Lastly, configure an ip handle for the VLAN. That is sometimes a default gateway.
2611XM(config-if)#int fa0/1 2611XM(config-if)#no ip add 2611XM(config-if)#no shut 2611XM(config-if)#int fa0/1 *Jul 25 02:40:49.523: %LINK-3-UPDOWN: Interface FastEthernet0/1, modified state to up 2611XM(config-if)#int fa0/1.70 2611XM(config-subif)#encapsulation dot1Q 70 2611XM(config-subif)#ip add 10.10.70.1 255.255.255.0 2611XM(config-subif)#int fa0/1.99 2611XM(config-subif)#ip add 10.10.99.1 255.255.255.0 % Configuring IP routing on a LAN subinterface is just allowed if that subinterface is already configured as a part of an IEEE 802.10, IEEE 802.1Q, or ISL vLAN. 2611XM(config-subif)#encapsulation dot1Q 99 2611XM(config-subif)#ip add 10.10.99.1 255.255.255.0
For testing we are going to add a pair SVI interfaces so we will do some ping checks.
2950-XL(config)#int vlan 70 2950-XL(config-subif)#ip add 10.10.70.254 255.255.255.0 2950-XL(config-subif)#int vlan 99 2950-XL(config-subif)#ip add 10.10.99.254 255.255.255.0 2950-XL(config-subif)#finish 2950-XL#ping 10.10.70.1 Sort escape sequence to abort. Sending 5, 100-byte ICMP Echos to 10.10.70.1, timeout is 2 seconds: !!!!! Success price is 100% (5/5), round-trip min/avg/max = 1/3/6 ms 2950-XL#ping 10.10.99.1 Sort escape sequence to abort. Sending 5, 100-byte ICMP Echos to 10.10.99.1, timeout is 2 seconds: !!!!! Success price is 100% (5/5), round-trip min/avg/max = 1/203/1006 ms 2950-XL#
[ad_2]