CCIE Pursuit Blog

June 7, 2007

Interface Range: Wax On. Wax Off.

Filed under: Cool Commands,IOS,Tech Tips — cciepursuit @ 4:02 pm

If you need to configure a number of interfaces at the same (common with switches) you can use the “interface range” command: 

Using the Interface Range Command To Add to the Config:
sw1(config)#interface range fa0/13 – 15
sw1(config-if-range)#desc -> type some stuff
sw1(config-if-range)#exit

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

Current configuration : 63 bytes
!
interface FastEthernet0/13
 description -> type some stuff
end

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

Current configuration : 63 bytes
!
interface FastEthernet0/14
 description -> type some stuff
end

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

Current configuration : 63 bytes
!
interface FastEthernet0/15
 description -> type some stuff
end

Most people are aware of this application of the Interface Range command.  The only tricky part is to remember to keep a space on either side of the hyphen:

Right:
interface range fa0/1 – 10

Wrong:
interface range fa0/1-10

When you’re doing labs(especially short labs), you will often need to reverse your changes.  A lot of times you will simply default the interface:

Default the Interface:
sw1(config)#default int fa0/1

This is a great time saver, but can we use the Interface Range command to default a bunch of interfaces at once?  Sure we can:

Using Default with Interface Range:
sw1(config)#default inter range fa0/13 – 15
sw1(config)#do sh run int fa0/13
Building configuration…

Current configuration : 34 bytes
!
interface FastEthernet0/13
end

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

Current configuration : 34 bytes
!
interface FastEthernet0/14
end

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

Current configuration : 34 bytes
!
interface FastEthernet0/15
end

NICE!!!  This is a great time-saver over defaulting each interface or using “write erase” and “reload”.

One last note: you can always pop of interface range mode (config-if-range) by using exit, control + z, or just typing a command that is not applicable at the interface level, such as:

From Interface Range to Interface Level:
sw1(config-if-range)#int po1
% Command exited out of interface range and its sub-modes.
  Not executing the command for second and later interfaces

Cisco Documentation:

Interface Range

Advertisements

2 Comments »

  1. thanks for your nice activity,
    may be i need my self blog

    Comment by Gost — March 11, 2008 @ 9:12 pm | Reply

  2. hi, does anyone know why interface range command is not supported on the packet tracer 4.1? any known workaround?
    Thanks

    Comment by Stevo — April 21, 2008 @ 11:39 pm | Reply


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: