10-23-2013 05:50 AM - edited 03-07-2019 04:11 PM
While looking at a issue today, I notice something weird.
RTR-1#sh vlan
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
122 Textron-RIF active <<<<<<<<<<<<<<< notice no ports listed, yet...
in the config... vlan 127 does have a port assigned...
!
interface GigabitEthernet2/0/12
description Textron Internet VSX
switchport access vlan 122
switchport trunk encapsulation dot1q
switchport trunk allowed vlan 122
switchport mode trunk
mls qos trust dscp
!
RTR-1#sh int Gi2/0/12 switchport
Name: Gi2/0/12
Switchport: Enabled
Administrative Mode: trunk
Operational Mode: trunk
Need to know the logic behind this ?
Regard's
Kaushal
10-23-2013 06:17 AM
Hi kushal,
switchport can be either access or trunk.
You can not have a single point act as an access port and trunk port. You can have only one at a time. The configuration line which determine which is switchport mode trunk or switchport access vlan 102. your Port is strictly configured for a Trunk which means that you wont be able to Fall over to Access Port.
You can write it in a manner as you did but as you enter the switchport mode trunk command the switchport access vlan 122 is simply ignored till the time that you enter switchport mode access(which will rewrite switchport mode trunk command).
So
switchport access vlan 122
switchport trunk encapsulation dot1q
switchport mode trunk
results in TRUNK (switchport access vlan 122 ignored).
You can configured the Port as Dynamic desirable which will try to form a trunk, then it will fall over to an access port on the clan that u have configured.
Regards
Sent from Cisco Technical Support iPhone App
10-23-2013 06:22 AM
Hello,
Seems like the switch port is enabled in trunk mode. Based on your configs, the vlan 122 is going through as tagged.
The "show vlan" shows untagged ports configured in "switchport mode access"
If you want the vlan 122 to pass untagged through the trunk, you need to add the folllowing command to the interface:
switchport trunk native vlan 122
Also if you need to know which hosts are connected to which ports, the following command is useful because it shows the mac addresses learned per port, either access or trunk,
show mac address-table vlan 122
10-23-2013 06:32 AM
When you do a "show vlan", only the access ports placed in that vlan are displayed.
Your port is currently in trunk mode, so it is going to be displayed under "show interface trunk".
You are allowed to have both access and trunk configurations on your port, but the commands that are actually "used" will be determined by your switchport mode. In your case, you have switchport mode trunk configured, so it will only use the applicable trunk configurations.
Sent from Cisco Technical Support Android App
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