Okay, I'm curious because I've never done this in production. I was doing some lab work and changed the native vlan on a trunk. Then I started getting cdp errors on the other side, so on the other side I changed the default to match up with the other end. CDP stopped complaining and spanning-tree started forwarding again. The vlan that I had specified existed on SW1, but it doesn't exist on SW3. I was under the impression that the vlan, native or not, had to be on the switch in order to forward anything:
R3 before native changed:
*Mar 1 00:23:36.647: %CDP-4-NATIVE_VLAN_MISMATCH: Native VLAN mismatch discovered on FastEthernet0/13 (1), with Rack1SW1 FastEthernet0/16 (146).
*Mar 1 00:23:36.675: %CDP-4-NATIVE_VLAN_MISMATCH: Native VLAN mismatch discovered on FastEthernet0/14 (1), with Rack1SW1 FastEthernet0/17 (146).
*Mar 1 00:23:36.695: %CDP-4-NATIVE_VLAN_MISMATCH: Native VLAN mismatch discovered on FastEthernet0/15 (1), with Rack1SW1 FastEthernet0/18 (146).
R3 after native changed:
*Mar 1 00:24:43.879: %SPANTREE-2-UNBLOCK_CONSIST_PORT: Unblocking FastEthernet0/13 on VLAN0001. Port consistency restored.
*Mar 1 00:24:43.879: %SPANTREE-2-UNBLOCK_CONSIST_PORT: Unblocking FastEthernet0/14 on VLAN0001. Port consistency restored.
*Mar 1 00:24:43.883: %SPANTREE-2-UNBLOCK_CONSIST_PORT: Unblocking FastEthernet0/15 on VLAN0001. Port consistency restored.
1 default active Fa0/1, Fa0/2, Fa0/3, Fa0/4
Fa0/6, Fa0/7, Fa0/8, Fa0/9
Fa0/10, Fa0/11, Fa0/12, Fa0/16
Fa0/17, Fa0/18, Fa0/19, Fa0/20
Fa0/21, Fa0/22, Fa0/23, Gi0/1
5 VLAN0005 active Fa0/5
9 VLAN0009 active
43 VLAN0043 active Fa0/24
79 VLAN0079 active
Here's the port config:
Rack1SW3#sh run int fa0/13
Current configuration : 129 bytes
switchport trunk encapsulation dot1q
switchport trunk native vlan 146
switchport mode trunk
How is this allowing 146 when it doesn't even exist on the switch?
The command "switchport trunk native vlan 146" is not allowing the vlan, to allowe a vlan, use "switchport trunk allow vlan
What this command is doing, it tells the port that when a frame is going to be sent out, it will be tagged for all vlan except for vlan 146, wich will be sent out without tag. Becuse vlan146 doesn't excist all frames will be tagged. Also if a frame is received without a tag, that frame will be associated with vlan 146, and as a result of vlan146 doesn't exist such a frame will be dropped.
Thanks for the response, but I tried to recreate this in gns this morning and I get what I was expecting last night. I think I just either had a freak incident or hit a bug on the rack equipment's ios version. BTW, all vlans were allowed on the trunk, I was just telling it to not tag vlan 146 (which I should have gotten an error). Here's what I get in gns below:
*Mar 1 00:11:04.747: %DTP-5-TRUNKPORTON: Port Fa1/5 has become dot1q trunk
*Mar 1 00:11:05.251: %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan1, changed state to up
*Mar 1 00:11:05.359: %SPANTREE-2-RECV_PVID_ERR: Received BPDU with inconsistent peer vlan id 42 on FastEthernet1/5 VLAN1.
*Mar 1 00:11:05.359: %SPANTREE-2-BLOCK_PVID_LOCAL: Blocking FastEthernet1/5 on VLAN1. Inconsistent local vlan.
*Mar 1 00:11:07.159: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet1/5, changed state to up
1 default active Fa1/0, Fa1/1, Fa1/2, Fa1/3
Fa1/4, Fa1/6, Fa1/7, Fa1/8
Fa1/9, Fa1/10, Fa1/11, Fa1/12
Fa1/13, Fa1/14, Fa1/15
15 VLAN0015 active
20 VLAN0020 active
25 VLAN0025 active
30 VLAN0030 active
R1(config-if)#switchport trunk native vlan 42
% VLAN 42 does not exist. Please add it to vlan database