"switchport access vlan" on a trunk?

Answered Question
Sep 29th, 2009

I need confirmation of the "switchport access vlan" command below when the interface is configured as a trunk.

If a PC is connected to this interface, and it isn't trunking, traffic will be sent on VLAN 53 (Native)... right?

so, therefore, the "switchport access vlan 600" isn't being used? or does it serve another purpose when the interface is configured as a trunk?

(i know what the command does when the interface is configured as an access port)

!

interface FastEthernet2/0/27

switchport access vlan 600

switchport trunk encapsulation dot1q

switchport trunk native vlan 53

switchport trunk allowed vlan 53,600

switchport mode trunk

end

thanks in advance.

Mark

I have this problem too.
0 votes
Correct Answer by Edison Ortiz about 7 years 2 months ago

You have the command

"switchport mode trunk"

which means the switch will form an unconditional trunk. Even if the connected device does not support trunking, the switchport will be in trunk status. The connected device will discard the tagged Vlans if trunking is not supported but it will be able to connect by using the native Vlan which is untagged.

On your example, the connected device is using Vlan 53 and not Vlan 600 and having 'access vlan 600' serves no purpose.

HTH,

__

Edison.

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 4.5 (2 ratings)
Loading.
Correct Answer
Edison Ortiz Tue, 09/29/2009 - 17:58

You have the command

"switchport mode trunk"

which means the switch will form an unconditional trunk. Even if the connected device does not support trunking, the switchport will be in trunk status. The connected device will discard the tagged Vlans if trunking is not supported but it will be able to connect by using the native Vlan which is untagged.

On your example, the connected device is using Vlan 53 and not Vlan 600 and having 'access vlan 600' serves no purpose.

HTH,

__

Edison.

johnnylingo Tue, 09/29/2009 - 19:23

Yes, all that matters is what "switch mode" is set to.

Likewise, if you set "switch mode access", the native VLAN trunk setting will be ignored.

It would be nice if IOS took out the unused lines for you, but on the other hand it makes switching between trunk and access easy.

Actions

This Discussion