03-08-2012 05:22 AM - edited 03-07-2019 05:26 AM
Hi,
I'm trying to understand VLANs and trunking.
This (screenshot) is a working router-on-stick example with 4 VLANs.
V40 is native Vlan 40 (ADMIN, manage)
All gig1/1 & gig1/2 interfaces are trunks.
My question is about the output of S1#sh int gig1/1 switch (same output on the other interfaces and switches)
S1#sh int gig1/1 switch
Name: Gig1/1
Switchport: Enabled
Administrative Mode: trunk
Operational Mode: trunk
Administrative Trunking Encapsulation: dot1q
Operational Trunking Encapsulation: dot1q
Negotiation of Trunking: On
Access Mode VLAN: 1 (default)
Trunking Native Mode VLAN: 40 (ADMIN)
Voice VLAN: none
Administrative private-vlan host-association: none
Administrative private-vlan mapping: none
Administrative private-vlan trunk native VLAN: none
Administrative private-vlan trunk encapsulation: dot1q
Administrative private-vlan trunk normal VLANs: none
Administrative private-vlan trunk private VLANs: none
Operational private-vlan: none
Trunking VLANs Enabled: ALL
Pruning VLANs Enabled: 2-1001
Capture Mode Disabled
Capture VLANs Allowed: ALL
Protected: false
Appliance trust: none
It's about this part
*********
Access Mode VLAN: 1 (default)
Trunking Native Mode VLAN: 40 (ADMIN)
************
If I would add switchport access vlan 40 to all gig interfaces. I have this output:
*********
Access Mode VLAN: 40 (default)
Trunking Native Mode VLAN: 40 (ADMIN)
************
But I can't see any differences in the working example and on the other command outputs.
Can anybody explain what the differences are?
THX.
03-08-2012 05:45 AM
Not really sure what your question , when you add the switchport access command all you are doing is saying if the line is not a trunk it will be an access port in vlan 1 . If the port is hardcoded as a trunk the switchport access command really has no meaning and does not need to be there .
03-08-2012 06:04 AM
The swtchport can be in access mode or in trunking mode.
If it is in access mode, then the command switchport access vlan n determines which VLAN it is on. If that command is absent, then it is on VLAN 1. Any command starting switchport trunk ... is ignored because we are not in trunking mode.
If the switchport is in trunking mode, packets have to be tagged to say which VLAN they are for, except if they are on the native VLAN. The native VLAN is determined by the command switchport trunk native vlan n. If that command is absent, the native is VLAN 1. Any command starting with switchport access ... is ignored because we are not in access mode.
In your output above, te "Access Mode VLAN" is the one the port would be on if it were in access mode. But that is irrelevant, because it is not in access mode; it is in trunk mode.
Hope that helps.
Kevin Dorrell
Luxembourg
03-08-2012 07:06 AM
In your output above, te "Access Mode VLAN" is the one the port would be on if it were in access mode. But that is irrelevant, because it is not in access mode; it is in trunk mode.
That is all I needed to know. It's clear to me now.
Thx a lot.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide