08-21-2015 11:19 AM
Hi There,
I'd like to 'protect' the switchport trunk allowed vlan command on interfaces, so that vlan's can be configured only with the add/remove/exept/all/none commands.
In IOS I can do this with the attached script ('borrowed' from http://networkengineering.stackexchange.com/questions/1190/accidentally-removed-allowed-vlans-from-cisco-switch-dot1q-trunk)
Unfortunually this doen't work on Nexus-OS Switches. Anyone who can help me with this?
event manager applet forbid-vlan-trunk
event cli pattern "switchport trunk allowed vlan\s+[0-9]" skip yes sync no
action 1.0 syslog msg "switchport trunk allowed vlan MUST be configured via add/remove"
Solved! Go to Solution.
08-21-2015 12:22 PM
While CLI applets that block commands from running are possible in NX-OS, it does not appear you can match config commands. So while you could match, for example, "show run" you can't match the "switchport trunk allowed vlan" command.
08-21-2015 12:22 PM
While CLI applets that block commands from running are possible in NX-OS, it does not appear you can match config commands. So while you could match, for example, "show run" you can't match the "switchport trunk allowed vlan" command.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide