cisco hands-on experience

default interface nexus 5000

default interface nexus 5000 tcl script

In my latest post i wrote something about vpc double sided configuration with N5k.
Due to of refinishing i have to define several ports on the n5k device as port-channels or as
access-ports. This ports are used in previous environment for different purposes on the
N5k devices.

So i have to clear the old port settings and several of them with the range command.
But most switchport commands failed.
‘command failed: port not compatible [port access vlan]’
So i want to use the ‘default interface’ command but it doesn’t works fine respectively the
command was not available.

Since implementaion, we have been using the following NX-OS version:

BIOS:      version 3.6.0
loader:    version N/A
kickstart: version 5.1(3)N1(1)
system:    version 5.1(3)N1(1)
power-seq: Module 1: version v4.0
uC:        version v1.0.0.2
SFP uC:    Module 1: v1.0.0.0
BIOS compile time:       05/09/2012
kickstart image file is: bootflash:///n5000-uk9-kickstart.5.1.3.N1.1.bin
kickstart compile time:  12/6/2011 22:00:00 [12/07/2011 08:30:01]
system image file is:    bootflash:///n5000-uk9.5.1.3.N1.1.bin
system compile time:     12/6/2011 22:00:00 [12/07/2011 10:09:44]

On my investigation i discover that there is a bug number CSCth06584 on

This is an enhancement request filed requesting “default interface” capability in Nexus 5000/5500 series switches.

Negate each command under the interface individually.


Absolutely no solution for me to define ports under shortage of time.
I decided to write a short tcl script to accelerate port configurations.

Content of the script:
foreach int {
} {exec no $int }
foreach def {
} {exec  $def }
Next steps:
    1. Upload the script in your flash.
    2. define a new alias for your tcl script.
    3. check if the alias is right configured.
    4. execute the script in (config-if)# mode.


copy tftp: flash:   (do the needful commands)

NX5K(config)# cli alias name defaultInterface name.tcl

NX5K(config)# alias or NX5K# show cli alias
CLI alias commands
alias   :show cli alias
defaultInterface  :tclsh name.tcl
wr      :copy run start

NX5K(config)# int eth1/13, eth1/14
NX5K(config-if)# defaultInterace

final statement:

If you use this script don’t forget to clear the appropriate logical port-channels.
Single or range commands are possible with it. Just enjoy.

  1. DonnetteUVanwyck Reply

    I’m no longer certain the place you’re getting your info,
    but great topic. I needs to spend some time learning more or figuring out more.
    Thank you for magnificent info I used to be on the
    lookout for this info for my mission.

Leave a Reply


captcha *