Cisco’s NXOS – the friendly face that’s just like that old IOS thing you used to know, but has enough little differences to trip you up constantly. Moving between IOS and NXOS is getting to be a little like moving between IOS and Junos. Is it
mac address-table? Can I
quit or must I
exit? Can I use
show running today?
Mostly the documentation is pretty good when you get stuck, but yesterday a colleague asked me about configuring ranges of interfaces and I confess to getting very confused.
NXOS Interface Ranges
In principal, configuring a range or interfaces is simple. Here’s a snippet from the interface range documentation for NXOS 5.x:
The interface range configuration mode allows you to configure multiple interfaces with the same configuration parameters. After you enter the interface range configuration mode, all command parameters you enter are attributed to all interfaces within that range until you exit out of the interface range configuration mode.
You enter a range of interfaces using dashes (-) and commas (,). Dashes separate contiguous interfaces and commas separate noncontiguous interfaces. When you enter noncontiguous interfaces, you must enter the media type for each interface.
The following example shows how to configure a contiguous interface range:
switch(config)# interface ethernet 2/29-30 switch(config-if-range)#
The following example shows how to configure a noncontiguous interface range:
switch(config)# interface ethernet 2/29, ethernet 2/33, ethernet 2/35 switch(config-if-range)#
So far, so good; this works just fine.
As I kept looking for resources, further down in the same document I found this regarding configuring port profiles:
This example shows how to assign the port profile named adam to Ethernet interfaces 7/3 to 7/5, 10/2, and 11/20 to 11/25:switch# configure terminal switch(config)# interface ethernet 7/3–5, 10/2, 11/20–25 switch(config-if)# inherit port-profile adam switch(config-if)#
This example contradicts the earlier configuration guidance though. If you try it in version 6.0:
nxos6(config)# int e1/1, 1/3 ^ Invalid interface format at ‘^’ marker.
And in 5.0.2:
nxos5(config)# int e1/1, 1/3 ^ Invalid command (unexpected token) at ‘^’ marker.
Oops. It’s also interesting (to me) to note that the two examples of entering an interface range to configure it show two different configuration mode prompts. The former:
At least allegedly. Since the latter form of configuration does not work, I assume that the rest of the example is similarly made up!
Mixing Media Types
The other thing that wasn’t clear was whether I could mix media types on the same line. For example, could I configure an Ethernet interface and a Port-Channel interface as part of the same interface range? After all, the first guide says:
When you enter noncontiguous interfaces, you must enter the media type for each interface.
That sounds to me like the purpose of entering the media type is to allow mixing!
nxos6(config)# interface port-channel 1, e1/1 ^ Invalid interface format at '^' marker.
Never Too Old to Learn
What do I know now? First, that you have to say Ethernet each time you add a new non-contiguous range of ports to the interface command. I also know that the second example in the documentation appears to be total fiction, invented on the spot (rather than tested on a router) by somebody in the documentation department. And now I know that you don’t seem to be able to mix interface types in a single command.
Live and learn.