CCIE Pursuit Blog

August 8, 2007

Configure the Native VLAN on Both Sides of The Trunk

Filed under: Cisco, Cisco Certification, IOS, Switching — cciepursuit @ 10:51 am

Be sure to remember to configure the native VLAN on both sides of the trunk link or you will get this error until you do so (or disable CDP):

*Mar  1 01:35:01: %CDP-4-NATIVE_VLAN_MISMATCH: Native VLAN mismatch discovered on FastEthernet0/13 (1), with sw1 FastEthernet0/13 (10).

They come in once every minute (CDP updates go every 60 seconds by default):

*Mar  1 01:38:01: %CDP-4-NATIVE_VLAN_MISMATCH: Native VLAN mismatch discovered on FastEthernet0/13 (1), with sw1 FastEthernet0/13 (10).
*Mar  1 01:39:01: %CDP-4-NATIVE_VLAN_MISMATCH: Native VLAN mismatch discovered on FastEthernet0/13 (1), with sw1 FastEthernet0/13 (10).
*Mar  1 01:40:01: %CDP-4-NATIVE_VLAN_MISMATCH: Native VLAN mismatch discovered on FastEthernet0/13 (1), with sw1 FastEthernet0/13 (10).

sw2(config-if)#do sh cdp
Global CDP information:
        Sending CDP packets every 60 seconds
        Sending a holdtime value of 180 seconds
        Sending CDPv2 advertisements is  enabled

What happens if you disable CDP?  Will you still get the error?

sw1:
sw1(config)#do sh run int fa0/13
Building configuration…

Current configuration : 128 bytes
!
interface FastEthernet0/13
 switchport trunk encapsulation dot1q
 switchport trunk native vlan 10
 switchport mode trunk
end

sw2:
sw2(config-if)#do sh run int fa0/13
Building configuration…

Current configuration : 110 bytes
!
interface FastEthernet0/13
 switchport trunk encapsulation dot1q
 switchport mode trunk
 no cdp enable
end

***
sw1#sh int fa0/13 trunk

Port        Mode         Encapsulation  Status        Native vlan
Fa0/13      on           802.1q         trunking      10

sw1#sh int fa0/13 switch | i Native VLAN
Administrative Native VLAN tagging: enabled

sw1#sh cdp int fa0/13
FastEthernet0/13 is up, line protocol is up
  Encapsulation ARPA
  Sending CDP packets every 60 seconds
  Holdtime is 180 seconds

sw2#sh int fa0/13 trunk

Port        Mode         Encapsulation  Status        Native vlan
Fa0/13      on           802.1q         trunking      1

sw2#sh int fa0/13 switch | i Native VLAN
Administrative Native VLAN tagging: enabled

sw2#sh cdp int fa0/13
[Note: No output because we've disabled CDP]
sw2#

It’s been a few minutes and no alarms(on either switch):

*Mar  1 01:42:14: %SYS-5-CONFIG_I: Configured from console by console
sw1#sh clo
*01:48:09.468 UTC Mon Mar 1 1993

*Mar  1 01:41:51: %SYS-5-CONFIG_I: Configured from console by console
sw2#sh clo
*01:45:09.826 UTC Mon Mar 1 1993

Another good reason to run CDP.  :-)

12 Comments »

  1. Hi Guys i have the same Problems. We made some changes to the switches and everything matches but still getting same mismatch error: (((( Some one mentioned something about Cabling ?????))

    S1#
    Oct 9 13:45:18.047: %CDP-4-NATIVE_VLAN_MISMATCH: Native VLAN mismatch discovered on GigabitEthernet0/15 (21), with Switch GigabitEthernet0/15 (1).
    Oct 9 13:46:18.064: %CDP-4-NATIVE_VLAN_MISMATCH: Native VLAN mismatch discovered on GigabitEthernet0/15 (21), with Switch GigabitEthernet0/15 (1).

    S2:
    Oct 9 13:00:17.551 UTC: %CDP-4-NATIVE_VLAN_MISMATCH: Native VLAN mismatch discovered on GigabitEthernet0/15 (21), with Switch GigabitEthernet0/15 (1).
    Oct 9 13:01:17.555 UTC: %CDP-4-NATIVE_VLAN_MISMATCH: Native VLAN mismatch discovered on GigabitEthernet0/15 (21), with Switch GigabitEthernet0/15 (1).

    Here is the config:

    S1#show run int g0/15
    Building configuration…

    Current configuration : 221 bytes
    !
    interface GigabitEthernet0/15
    description mgmt1
    switchport access vlan 21
    switchport trunk native vlan 21
    switchport trunk allowed vlan 21
    switchport mode trunk
    switchport nonegotiate
    spanning-tree cost 100
    end

    S2#sho run int g0/15
    Building configuration…

    Current configuration : 221 bytes
    !
    interface GigabitEthernet0/15
    description mgmt1
    switchport access vlan 21
    switchport trunk native vlan 21
    switchport trunk allowed vlan 21
    switchport mode trunk
    switchport nonegotiate
    spanning-tree cost 100
    end

    Thank you
    Noe Ruiz

    Comment by Noe Ruiz — October 9, 2007 @ 10:34 am | Reply

  2. Hi Noe.

    I can try labbing this up later, but just looking at the interface configurations I don’t see that you’ve set the trunking encapsulation to dot1q (“switchport trunk encap dot1q”). You’ve hard-set trunking, but not set the encapsulation. If the switches (what model are these switches?) is using ISL to trunk, then you’re going to have problems because ISL doesn’t recognize native VLAN.

    I would try also try removing “switchport access vlan 21″ from each interface. The interface must be in access mode (non-trunking) or the “switchport access vlan x” command will not work. You’ve hard-set the ports to trunk and to only allow VLAN 21, so you should be able to remove that line.

    If that doesn’t work, please post the output of “show int gi0/15 switchport” and “show int gi0/15 trunk” for each switch.

    Comment by cciepursuit — October 9, 2007 @ 11:48 am | Reply

  3. Since the Switches are in producitons I will not able to make any changes at the moment. here is the output:

    S1#show int gi0/15 switchport
    Name: Gi0/15
    Switchport: Enabled
    Administrative Mode: trunk
    Operational Mode: trunk
    Administrative Trunking Encapsulation: dot1q
    Operational Trunking Encapsulation: dot1q
    Negotiation of Trunking: Off
    Access Mode VLAN: 21 (otr_app_ X.X.X.X/26)
    Trunking Native Mode VLAN: 21 (otr_app_X.X.X.X/26)
    Voice VLAN: none
    Administrative private-vlan host-association: none
    Administrative private-vlan mapping: none
    Administrative private-vlan trunk native VLAN: none
    Administrative private-vlan trunk encapsulation: dot1q
    Administrative private-vlan trunk normal VLANs: none
    Administrative private-vlan trunk private VLANs: none
    Operational private-vlan: none
    Trunking VLANs Enabled: 21
    Pruning VLANs Enabled: 2-1001
    Capture Mode Disabled
    Capture VLANs Allowed: ALL
    Protected: false
    Unknown unicast blocked: disabled
    Unknown multicast blocked: disabled
    Appliance trust: none

    S2#show int gi0/15 switchport
    Name: Gi0/15
    Switchport: Enabled
    Administrative Mode: trunk
    Operational Mode: trunk
    Administrative Trunking Encapsulation: dot1q
    Operational Trunking Encapsulation: dot1q
    Negotiation of Trunking: Off
    Access Mode VLAN: 21 (stp)
    Trunking Native Mode VLAN: 21 (stp)
    Voice VLAN: none
    Administrative private-vlan host-association: none
    Administrative private-vlan mapping: none
    Administrative private-vlan trunk native VLAN: none
    Administrative private-vlan trunk encapsulation: dot1q
    Administrative private-vlan trunk normal VLANs: none
    Administrative private-vlan trunk private VLANs: none
    Operational private-vlan: none
    Trunking VLANs Enabled: 21
    Pruning VLANs Enabled: 2-1001
    Capture Mode Disabled
    Capture VLANs Allowed: ALL
    Protected: false
    Unknown unicast blocked: disabled
    Unknown multicast blocked: disabled
    Appliance trust: none

    S1#show int gi0/15 trunk

    Port Mode Encapsulation Status Native vlan
    Gi0/15 on 802.1q trunking 21
    Port Vlans allowed on trunk
    Gi0/15 21
    Port Vlans allowed and active in management domain
    Gi0/15 21
    Port Vlans in spanning tree forwarding state and not pruned
    Gi0/15 21

    S2#show int gi0/15 trunk

    Port Mode Encapsulation Status Native vlan
    Gi0/15 on 802.1q trunking 21
    Port Vlans allowed on trunk
    Gi0/15 21
    Port Vlans allowed and active in management domain
    Gi0/15 21
    Port Vlans in spanning tree forwarding state and not pruned
    Gi0/15 21

    Thank you in advance

    Comment by Noe Ruiz — October 9, 2007 @ 1:59 pm | Reply

  4. This is strange. You are successfully trunking dot1q with native vlan 21 on both sides of the trunk. Everything looks good to me.

    A couple of questions:

    1) Are these ports copper or fiber?
    2) If they are copper; are these ports directly connected to each other with a cross over cable?
    3) What model of switch are these?

    Are you sure that there is not another device between the two switches? You’re probably renaming your actual switch names to s1 and s2 to hide your naming scheme (good idea – I would do the same thing). Unless you renamed the switch names in the actual error output to “Switch”, then it looks like there is another switch between s1 and s2:

    “Oct 9 13:46:18.064: %CDP-4-NATIVE_VLAN_MISMATCH: Native VLAN mismatch discovered on GigabitEthernet0/15 (21), with Switch GigabitEthernet0/15 (1).”

    What this error is saying is “I am using a Native VLAN of 21 on gi0/15, but there is a device that I am connected to on that port that is using the default Native VLAN of 1. Therefore I am sensing a Native VLAN mismatch. I am sensing via CDP that the device (most likely a Cisco switch) that I am connected to on gi0/15 is called ‘Switch’ and I am connected to its port gi0/15.”

    Both s1 and s2 are seeing the CDP neighbor with a name of “Switch”. Of course they’re both seeing themselves connected to gi0/15 on “Switch” so it is probably just a case of you renaming the switch name in the output. :-)

    One other thing you can check is to see if each switch agrees on the root switch by doing “show span vlan 21″.

    Comment by cciepursuit — October 9, 2007 @ 3:17 pm | Reply

  5. That last paragraph should read:

    One other thing you can check is to see if each switch agrees on the root switch by doing “show span vlan 21″. If they are seeing different switches as the root switch for that VLAN, they are not trunking VLAN 21 between each other.

    Comment by cciepursuit — October 9, 2007 @ 3:17 pm | Reply

  6. funny you said that has to something with renaming. We have just renamed these two switches (CIGESM-I6K2L2Q4-M) they are IBM blades and also enabled SSH intead of Telneting. ( also reading some material : http://publib-b.boulder.ibm.com/Redbooks.nsf/RedbookAbstracts/tips0423.html?Open)) idicating about some Ip duplications. The naming conventions is: XXXXXS1 and XXXXS2 and the output is as follow:

    S1#show span vlan 21

    VLAN0021
    Spanning tree enabled protocol rstp
    Root ID Priority 32789
    Address xxxx.xxxx.de80
    Cost 3
    Port 66 (Port-channel6)
    Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

    Bridge ID Priority 61461 (priority 61440 sys-id-ext 21)
    Address xxxx.xxxx.4b80
    Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
    Aging Time 300

    Interface Role Sts Cost Prio.Nbr Type
    —————- —- — ——— ——– ——————————–
    Gi0/1 Desg FWD 4 128.1 Edge P2p
    Gi0/2 Desg FWD 4 128.2 Edge P2p
    Gi0/3 Desg FWD 4 128.3 Edge P2p
    Gi0/4 Desg FWD 4 128.4 Edge P2p
    Gi0/5 Desg FWD 4 128.5 Edge P2p
    Gi0/15 Desg FWD 100 128.15 P2p
    Po5 Altn BLK 3 128.65 P2p Peer(STP)
    Po6 Root FWD 3 128.66 P2p Peer(STP)

    S2#show span vlan 21

    VLAN0021
    Spanning tree enabled protocol rstp
    Root ID Priority 32789
    Address xxxx.xxxx.de80
    Cost 3
    Port 66 (Port-channel2)
    Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

    Bridge ID Priority 61461 (priority 61440 sys-id-ext 21)
    Address xxxx.xxxx.9a80
    Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
    Aging Time 300

    Interface Role Sts Cost Prio.Nbr Type
    —————- —- — ——— ——– ——————————–
    Gi0/2 Desg FWD 4 128.2 Edge P2p
    Gi0/3 Desg FWD 4 128.3 Edge P2p
    Gi0/4 Desg FWD 4 128.4 Edge P2p
    Gi0/5 Desg FWD 4 128.5 Edge P2p
    Gi0/15 Desg FWD 100 128.15 P2p
    Po1 Altn BLK 3 128.65 P2p Peer(STP)
    Po2 Root FWD 3 128.66 P2p Peer(STP)

    Thank you
    Noe

    Comment by Noe Ruiz — October 9, 2007 @ 3:41 pm | Reply

  7. They are both seeing the same switch as the root switch, but neither switch is using gi0/15 as the root port (which I should have guessed from the “spanning-tree cost 100″ config).

    I still suspect that there is another device between the switches. What do you see if you do “show cdp neighbor gi0/15″ on each switch?

    My best guesses right now are that there is another device between s1 and s2 that is using the default Native VLAN or that the switches are goofy for some reason. If you get a maintenance window, I would copy the port config, then default the port and paste it back in (perhaps without the “switchport access vlan 21″ command).

    Comment by cciepursuit — October 9, 2007 @ 4:21 pm | Reply

  8. Hello there, Yeah there is another device connected with an emty config. This device was going to be use for management purposes. They decied to turn off this device ( not going to be used any longer. The order thing I have found was the config:
    original : switchport trunk allowed vlan 1,21
    new: switchport trunk allowed vlan 21
    This causes the Mistach Vlan error message. The solution to this is either to Turn off the third switch ( which is the option ) ot to add the original command switchport trunk allowed vlan 1,21 or no cdp enable which is not the case.

    I’ll let you know thw outcame when they decide to turn off the 3rd switch.
    Thank you

    Comment by Noe Ruiz — October 10, 2007 @ 10:16 am | Reply

  9. In 2950 switches we have only one native vlan which is default.in muntilayer switches we can configure somany native vlans.If one switch have native vlan 1 and other have vlan 10 both will not match this time we will get the same error.In that case we have to inform those vlans in trunk port.

    Comment by Mohan — May 8, 2008 @ 10:28 pm | Reply

  10. And give the command in the interface mode.we will give the command in the interface which is trunk to other device.

    Config-if#switchport trunk native vlan

    Comment by Mohan — May 8, 2008 @ 10:34 pm | Reply

  11. CDP messages and errors are just that. For the interface in question enter “no cdp enable” and go on.

    If it is really important to you, don’t use inconsistent port based VLANs in bridges or when inter-connecting switches with CDP enabled.

    Comment by blah — September 23, 2008 @ 7:53 pm | Reply

  12. The issue is with CDP of course but disabling it is not the solution. I noticed the CDP version that is being used is v2, which is the source of the issue. Keep CDP enabled but enter ‘no cdp advertise-v2′, that should take care of it.

    The reason being, CDP v2 sends native vlan info. between switches.

    Hope this helps,

    Comment by Stache — November 9, 2008 @ 8:34 pm | Reply


RSS feed for comments on this post. TrackBack URI

Leave a comment

Blog at WordPress.com.