Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VLAN tagging is not working as I expected #1962

Open
1 task done
richardjohnallsopp opened this issue Jun 12, 2023 · 0 comments
Open
1 task done

VLAN tagging is not working as I expected #1962

richardjohnallsopp opened this issue Jun 12, 2023 · 0 comments

Comments

@richardjohnallsopp
Copy link

richardjohnallsopp commented Jun 12, 2023

Description of Issue/Question

We have a large fleet of Cisco and Arista switches and we have noticed there is a difference in the way the vendor OS's handle tagged VLAN's on an interface. In Arista you can add as many as you like and it will stay as a single string in the config. Cisco on the other hand splits the VLAN's onto multiple lines based on a character count (48 including , unless the list would be split over 3 lines then it's splits on 41 and 43 characters).

Cisco:

interface Port-channel30
 description LACP_to_test
 switchport trunk allowed vlan 4,25,30,33-35,128,130,132,134,152,157,180
 switchport trunk allowed vlan add 186-188,202,208,211-216,221,240,300,410,610
 switchport trunk allowed vlan add 999,3001
 switchport mode trunk

Arista:

description CMO-ESX-01-vmnic4
speed forced 25gfull
switchport trunk allowed vlan 13-14,18-20,143-144,148-150,152,169-172,180,186,188,211-214,216,410,420,430,3001
switchport mode trunk

Did you follow the steps from https://github.com/napalm-automation/napalm#faq

(Place an x between the square brackets where applicable)

  • Yes
  • [] No

Setup

napalm version

(Paste verbatim output from pip freeze | grep napalm between quotes below)

napalm==4.0.0

Network operating system version

(Paste verbatim output from show version - or equivalent - between quotes below)

Cisco IOS XE Software, Version 17.08.01
Cisco IOS Software [Cupertino], Catalyst L3 Switch Software (CAT9K_IOSXE), Version 17.8.1, RELEASE SOFTWARE (fc2)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2022 by Cisco Systems, Inc.
Compiled Sat 09-Apr-22 00:47 by mcpre


Cisco IOS-XE software, Copyright (c) 2005-2022 by cisco Systems, Inc.
All rights reserved.  Certain components of Cisco IOS-XE software are
licensed under the GNU General Public License ("GPL") Version 2.0.  The
software code licensed under GPL Version 2.0 is free software that comes
with ABSOLUTELY NO WARRANTY.  You can redistribute and/or modify such
GPL code under the terms of GPL Version 2.0.  For more details, see the
documentation or "License Notice" file accompanying the IOS-XE software,
or the applicable URL provided on the flyer accompanying the IOS-XE
software.


ROM: IOS-XE ROMMON
BOOTLDR: System Bootstrap, Version 17.5.1r, RELEASE SOFTWARE (P)

raa-test-sw-01 uptime is 2 weeks, 5 days, 3 hours, 26 minutes
Uptime for this control processor is 2 weeks, 5 days, 3 hours, 28 minutes
System returned to ROM by PowerOn
System restarted at 10:33:44 UTC Wed May 24 2023
System image file is "flash:packages.conf"
Last reload reason: PowerOn



This product contains cryptographic features and is subject to United
States and local country laws governing import, export, transfer and
use. Delivery of Cisco cryptographic products does not imply
third-party authority to import, export, distribute or use encryption.
Importers, exporters, distributors and users are responsible for
compliance with U.S. and local country laws. By using this product you
agree to comply with applicable laws and regulations. If you are unable
to comply with U.S. and local laws, return this product immediately.

A summary of U.S. laws governing Cisco cryptographic products may be found at:
http://www.cisco.com/wwl/export/crypto/tool/stqrg.html

If you require further assistance please contact us by sending email to
[email protected].


Technology Package License Information:

------------------------------------------------------------------------------
Technology-package                                     Technology-package
Current                        Type                       Next reboot
------------------------------------------------------------------------------
network-essentials      Smart License                    network-essentials
dna-essentials          Subscription Smart License       dna-essentials
AIR License Level: AIR DNA Advantage
Next reload AIR license Level: AIR DNA Advantage


Smart Licensing Status: Smart Licensing Using Policy

cisco C9300X-48HX (X86) processor with 1310600K/6147K bytes of memory.
Processor board ID FOC2613YBQF
2 Virtual Ethernet interfaces
56 Ten Gigabit Ethernet interfaces
16 TwentyFive Gigabit Ethernet interfaces
4 Hundred Gigabit Ethernet interfaces
2048K bytes of non-volatile configuration memory.
16777216K bytes of physical memory.
1638400K bytes of Crash Files at crashinfo:.
11264000K bytes of Flash at flash:.

Base Ethernet MAC Address          : 18:59:f5:96:ae:80
Motherboard Assembly Number        : 73-19750-06
Motherboard Serial Number          : FOC261012H1
Model Revision Number              : D0
Motherboard Revision Number        : A0
Model Number                       : C9300X-48HX
System Serial Number               : FOC2613YBQF
CLEI Code Number                   :


Switch Ports Model              SW Version        SW Image              Mode
------ ----- -----              ----------        ----------            ----
*    1 78    C9300X-48HX        17.08.01          CAT9K_IOSXE           INSTALL

Steps to Reproduce the Issue

We have the VLAN ID's in a list.

  - port_channel: "30"
    description: "LACP_to_test"
    mode: "trunk"
    native_vlan: ""
    access_vlan: ""
    vlan_tags:
      - "4"
      - "25"
      - "30"
      - "33-35"
      - "128"
      - "130"
      - "132"
      - "134"
      - "152"
      - "157"
      - "180"
      - "186-188"
      - "202"
      - "208"
      - "211-216"
      - "221"
      - "240"
      - "300"
      - "410"
      - "610"
      - "999"
      - "3001"
    ip_dhcp_snooping: "" # set dhcp snooping 'information', 'limit', 'trust config', 'vlan'

Error Traceback

(Paste the complete traceback of the exception between quotes below)

TASK [Install IOS config with 5 minute auto roll back] *************************
fatal: [gb01-sw-i316-01 -> localhost]: FAILED! => changed=false 
msg: 'cannot install config: No pending configuration'

The reason this fails is due to the VLAN tags not being formatted correctly, my code will output them like so

interface Port-channel30
 description LACP_to_test
 switchport trunk allowed vlan 4,25,30,33-35,128,130,132,134,152,157,180,186-188,202,208,211-216,221,240,300,410,610,999,3001
 switchport mode trunk

The switch expects

interface Port-channel30
 description LACP_to_test
 switchport trunk allowed vlan 4,25,30,33-35,128,130,132,134,152,157,180
 switchport trunk allowed vlan add 186-188,202,208,211-216,221,240,300,410,610
 switchport trunk allowed vlan add 999,3001
 switchport mode trunk

I have fixed this issue with a custom filter but the more I work with it the more I feel this should be handled by Napalm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant