Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements
Webcast-Catalyst9k
New Member

switchport mode

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!

Everyone's tags (4)
8 REPLIES

switchport mode

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 ***
New Member

switchport mode

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

switchport mode

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 ***
Silver

switchport mode

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

Re: switchport mode

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 ***

Re: switchport mode

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

New Member

Re: switchport mode

Thank you all!

Purple

switchport mode

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.
1309
Views
0
Helpful
8
Replies
CreatePlease to create content