howtonetwork.net

Cisco Certification Training

  • Products
  • CCNA
    • CCNA Videos
    • CCNA Lectures
    • CCNA Practice Exams
    • Challenge Labs
      • Challenge Video Solutions
    • Cisco Commands
  • CCNP ROUTE
    • ROUTE Exams
  • CCNP SWITCH
    • SWITCH Exams
  • CCNP TSHOOT
  • Home
  • Join
  • Downloads
  • About Us
  • Whitepapers
  • Feature Articles
  • Helpdesk
  • FAQ
  • Free Training
You are here: Home / Encapsulation Dot1Q

Encapsulation Dot1Q

Command

Encapsulation Dot1Q

Use

Allows you to use a router interface as a trunk port to a switch. This is also known as “Router on a stick” because the switch uses the router to route between VLANs.

Syntax

Router(config-subif)#encapsulation dot1Q <vlan> <native>

Option

<native> Sets the vlan on the subinterface to act as the native VLAN.

Example

simple

In the below example we will configure a basic “router on a stick” configuration. First, we will configure the port connected to 2611XM’s Fa0/1 interface to be a trunk on the switch.
Routers only support Dot1Q encapsulation.

2950-XL#show cdp neighbor
Capability Codes: R – Router, T – Trans Bridge, B – Source Route Bridge
S – Switch, H – Host, I – IGMP, r – Repeater

Device ID Local Intrfce Holdtme Capability 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 act as a trunk.
First, we remove the ip address on the physical interface.
Next, we configure a subinterface for each VLAN the link will be a trunk for. The interface number can be anything you want.
After that, we configure encapsulation dot1q <vlan> for each subinterface. This command has to be entered before the IP address or you will get an error seen below.
Finally, configure an ip address for the VLAN. This is typically 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, changed 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 only allowed if that
subinterface is already configured as 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 will add a couple SVI interfaces so we can do some ping tests.

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)#end
2950-XL#ping 10.10.70.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.10.70.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/3/6 ms
2950-XL#ping 10.10.99.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.10.99.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/203/1006 ms
2950-XL#

Get access to over 5 hours of IT webinar videos as well as regular study tips and ideas when you
join our mailing list

About This Site

We replaced this site some time ago with an upgraded version. Please feel free to enjoy the content and if you like what you see check out our brilliant new site:

howtonetwork.com

Keep In Touch

About Us

This is a free access website which has now been replaced by howtonetwork.com.

Navigation

  • Home
  • Join
  • Downloads
  • About Us
  • Whitepapers
  • Feature Articles
  • Helpdesk
  • FAQ
  • Free Training

Copyright

All content is protected by international copyright laws. Copyright Reality Press Ltd.

Copyright © 2023 · Dynamik Website Builder on Genesis Framework · WordPress · Log in