Hi All, this command is a little confusing to me:
"switchport trunk native vlan (vlan ID)"
So the way that I understand this is that if a frame comes in that is untagged without a vlan or vlan 1 that it will default to the vlan that I specify in this command. Is that correct? Even more puzzling is when would you need this. When I set up switches in my network I know what Vlan they are supposed to be in so I set that on the interface.
Any examples of when you would need to use this?
In addition to Giuseppe's post.
"So the way that I understand this is that if a frame comes in that is untagged without a vlan or vlan 1 that it will default to the vlan that I specify in this command"
By default the native vlan is 1 so these will be untagged on a trunk but if you change the native vlan (and you should) then vlan 1 packets will be tagged.
The native vlan is a concept in 802.1q that provides backwards compatability with older switches that don't understand 802.1q tags. If the switch doesn't understand 802.1q tags you can still connect to it using the native vlan because there is no tag associated with this vlan.
It is very rare to have to change the native vlan on any port connecting to a end device altho Giuseppe has given one example. This is primarily because ebd devices don't usually connect to the switch with a trunk link and the native vlan is only relevant on trunk links.
What is far more common is changing the native vlan on trunk links between switches. Cisco recommend using a vlan for the native vlan that is
1) not used for anything else ie. user ports, management etc..
2) does not have a L3 vlan interface. There is no need for a L3 vlan interface because there is never any need to route the native vlan.
the native vlan is the vlan untagged on an 802.1Q trunk.
you can use this command to change the native Vlan on a trunk.
Be aware that native vlan has to match on both sides of the trunk or you will experience problems because each side will associate the untagged frames to a different vlan.
There are cases where this is needed for example a workstation with vmware instances can associate different vlan tags with different instances and one of them can be untagged but different from 1.
In this case you need to use this command.
This command is also needed on some older switches to support Voip phones that require to configure a trunk with native vlan = data vlan.
Hope to help