switchport mode
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2012 05:43 AM - edited 03-07-2019 05:09 AM
Hello Experts,
I am a newby in Cisco world.
My question may be a very fundamental one, but I couldn't find any reasonable and satisfactory answer in the web.
One of the port on a 3750 stack that is connected to the edge switch is confıgured as in the following:
!
interface GigabitEthernet2/8
description V158_L2_UPLINK
load-interval 30
switchport access vlan 158
switchport trunk encapsulation dot1q
switchport mode trunk
end
Please correct me if I'm wrong:
1 - "switchport mode access vlan <vlan-id>" command is used to add a port to a Vlan OR to add Vlan to a specific port.
2 - "switchport mode trunk" command,on the other hand, is used to make the port 'trunk' so that that port can be connected to an edge switch which has multiple VLANs configured on.
These two conflicting situations have been configured on a specific interface.
Can someone please comment on this explaining how it works?
Thanks in advance!
- Labels:
-
Other Switching

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2012 06:53 AM
The port should be trunking because that's the switchport mode. It looks like someone initially had it configured as an access port, changed the mode to trunk and forgot to remove the access vlan information.
If you do a "show int g2/8 trunk" you should see that the port is trunking. If that's the case, you can remove the "switchport access vlan 158" command.
John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2012 06:56 AM
So, I understand that 'switchport mode trunk' overrides the access port command, right?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2012 07:03 AM
Yes. The switchport default is access and generally doesn't show up in the running config. In order for this to be an access port, you'd need to change the mode from "switchport mode trunk" to "switchport mode access".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2012 03:11 PM
Hi. I hope that you won't mind if I add something. A friend of mine has correctly noted that switchport default is NOT access, but dynamic (dynamic desirable or dynamic auto).
Best regards,
Jan

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2012 03:20 PM
Correct. I misspoke earlier, but the mode of the switchport is set to trunk which makes his access vlan config not valid.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2012 04:47 PM
Hi Jan,
your friend is correct. also as john mentioned, when you have " switchport mode trunk" you are hard coding the interface to be a trunk.
do a "sh interface GigabitEthernet2/8 switchport"
this will show you the administrative mode which tells if its trunk or access
HTH
Kishore
rate if helps or mark correct if answered
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2012 11:58 PM
Thank you all!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2012 12:18 AM
Hi Kishore,
As a sidenote to your answer, the administrative mode is how it was configured but most importantly is the operational mode which is how it is behaving which is dependent on administrative mode of the other end.
Regards.
Alain
