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

switchport mode

mbufatihcisco
Level 1
Level 1

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!

8 Replies 8

John Blakley
VIP Alumni
VIP Alumni

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

HTH, John *** Please rate all useful posts ***

So, I understand that 'switchport mode trunk' overrides the access port command, right?

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".

HTH, John *** Please rate all useful posts ***

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

Correct. I misspoke earlier, but the mode of the switchport is set to trunk which makes his access vlan config not valid.

HTH, John *** Please rate all useful posts ***

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

Thank you all!

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

Don't forget to rate helpful posts.
Review Cisco Networking for a $25 gift card