cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
8943
Views
0
Helpful
8
Replies

switchport access vlan Vs encapsulation dot1Q ?

mmendis
Level 1
Level 1

Hi All,

 

Could some one explain the difference between encapsulation dot1Q & the switchport access vlan ???

1 Accepted Solution

Accepted Solutions

The only problem I can see here is that the 7206 will still be "tagging" the frames with vlan 25 tag. The 2851 is not tagging since it is simply an access port.

Please try making the 7206 "native vlan" for vlan 25 so it is not tagged. Also please make sure that L2 Vlan is created on other router.

7206
show run int gi0/3.1
Building configuration...

Current configuration : 103 bytes
!
interface GigabitEthernet0/3.1
 encapsulation dot1Q 25 native
 ip address 198.18.31.21 255.255.255.252
end

If this is production environment, I would not do this as it may complicate matters, I would make it simple by both interfaces point to point interfaces but as routed domain for any other subnets. Or even so, you could leave out the sub-if on the 7206, configure the physical interface gi0/3 for IP and leave the 2851 as it is.

Please rate useful posts & remember to mark any solved questions as answered. Thank you.

View solution in original post

8 Replies 8

Leo Laohoo
Hall of Fame
Hall of Fame

The command "switchport access VLAN" is a command to specify the one-and-only-one VLAN you want the switch port to carry.  By default, an access port will always carry VLAN 1.  This is the reason why you will never see the command "switchport access vlan 1".  You cannot have an access port carry more than one VLAN (except when you allow voice VLAN).  

 

If you want to have two or more VLANs per a single switchport, then you need to enable Trunking.  Therefore the command "encapsulation dot1q" is one of the command to enable Trunking.  This command specifies which of the two Trunking protocols to use:  IEEE's 802.1q or Cisco's ISL.  

 

Take note that without the command "switchport mode trunk" the interface is still an access port.   Not all Catalyst switch will accept the command "switchport encapsulation dot1q".  This is because the switch will ONLY accept 802.1q encapsulation so there's no need for this command.  All Catalyst 2K (except 2924XL) and some legacy 4000/4500 line cards support only 802.1q encapsulation.  All others will support either 802.1q or ISL.  You will never find a Catalyst switch that can support BOTH 802.1q and ISL.

Thanks for the explanations given Leo.... I have an incident where we connected 2 location via a layer 2 fiber circuit. One side is connecting to a 2851 router HWIC card ( configured a vlan 25 ) other end connecting to a 7206 G2 card ( Gi0/3 divided in to Gi0/3.1 and encapsulated wih dot1Q 25 ). Layer 2 devices @ both end getting the expecting mac addresses but I can't ping both ends IP. Do you have any idea why this is happening ????

Hi,

 

If possible can you share the 2851 vlan 25 and trunk port config &

7206 gi0/3.25 port config

Thanks for the reply vishnush. Following are the configuration details .

 

2851
show run int fa0/0/2
Building configuration...

Current configuration : 131 bytes
!
interface FastEthernet0/0/2
 switchport access vlan 25
 no ip address
 load-interval 30
end
show run int vlan 25
Building configuration...

Current configuration : 65 bytes
!
interface Vlan25
 ip address 198.18.31.22 255.255.255.252
end

7206
show run int gi0/3.1
Building configuration...

Current configuration : 103 bytes
!
interface GigabitEthernet0/3.1
 encapsulation dot1Q 25
 ip address 198.18.31.21 255.255.255.252
end

The only problem I can see here is that the 7206 will still be "tagging" the frames with vlan 25 tag. The 2851 is not tagging since it is simply an access port.

Please try making the 7206 "native vlan" for vlan 25 so it is not tagged. Also please make sure that L2 Vlan is created on other router.

7206
show run int gi0/3.1
Building configuration...

Current configuration : 103 bytes
!
interface GigabitEthernet0/3.1
 encapsulation dot1Q 25 native
 ip address 198.18.31.21 255.255.255.252
end

If this is production environment, I would not do this as it may complicate matters, I would make it simple by both interfaces point to point interfaces but as routed domain for any other subnets. Or even so, you could leave out the sub-if on the 7206, configure the physical interface gi0/3 for IP and leave the 2851 as it is.

Please rate useful posts & remember to mark any solved questions as answered. Thank you.

mmendis
Level 1
Level 1

Thanks Bilal , It actually worked.

 

If I really want to send a tagged packet from 2851 & received it to 7206 with the same tag. What are the changes I should do ????

Any help !!!!

Review Cisco Networking for a $25 gift card