Friday, March 19, 2010

IOS: Clearing an Interface Configuration

September 13, 2009 by Greg Ferro · 4 Comments 

This Post is Part of a Series — click for list on Console Mastery»

Interface is full

This occurs most com­monly when you are lab­bing or test­ing some­thing and an inter­face ends up with a lot of con­fig­ur­a­tion, pos­sibly some­thing like the following:

Router(config-if)#do sh run int fa0/​0
Building configuration…

Current con­fig­ur­a­tion : 320 bytes
!
inter­face FastEthernet0/​0
descrip­tion Show the Default com­mand
ip dhcp relay inform­a­tion trus­ted
ip address 198.18.56.1 255.255.255.0
no ip route-​​cache cef
no ip route-​​cache
ip ospf authentication-​​key MYOHMY
ip ospf net­work point-​​to-​​point
ip ospf hello-​​interval 20
duplex half
standby 1 ip 198.18.54.90
end

Router(config-if)#

You want to clear this con­fig­ur­a­tion and reuse the inter­face for some other task. Normally you would need to issue a the “no” com­mand for each line.

The ‘default’ command

The default com­mand has many uses, and this is only one of them, but pos­sibly it is the most useful.

Router(config-if)#default inter­face fa0/​0
Building configuration…

Interface FastEthernet0/​0 set to default con­fig­ur­a­tion
Router(config)#do sh run int fa0/​0
Building configuration…

Current con­fig­ur­a­tion : 61 bytes
!
inter­face FastEthernet0/​0
no ip address
duplex half
end

Router(config)#

That’s it. Simple and elegant.

Please rate this post:

  Why Rate Posts?
1 Star - It\\\'s Crud2 Stars - It\\\'s Tosh3 Stars - Something\\\'s missing4 Stars - Needs works5 Stars - Good Enough6 Stars - Good7 Stars - Excellent8 Stars - Brilliant9 Stars - Astonishing10 Stars - Awesomely Godlike? (4 votes, average: 9.00 out of 10)
Loading ... Loading ...

Comments

4 Responses to “IOS: Clearing an Interface Configuration”
  1. Beware of it on pro­duc­tion switches, though! By default, switch­ports are not shut­down and default­ing will make them come up, pos­sibly in the wrong VLAN. Of course, STP should not make this too dan­ger­ous, but it’s a good thing to be aware of. What I usu­ally do is:

    default inter­face X
    inter­face X
    shut­down
    ! whatever else I need to do

  2. Aaron says:

    I had to teach that one to some of our new boys this past week.

    You can also use the range dir­ect­ive to reset con­figs on a whole mess of ports.

    Router(config)#default int range f0/​0/​0 — 4

    Or some­thing like that.

  3. Oldpaul says:

    I also like using it with the indi­vidual inter­face com­mands, if I only want to “default” some­thing on an interface:

    conf t > int f0/​0 > default speed > default duplex

  4. Oldpaul says:

    Marko, I just tested default inter­face com­mand on my 6500, and it *does* retain the shutdown/​noshutdown state of the inter­face. Everything else was “defaulted”.

Speak Your Mind

Tell us what you're thinking...
and oh, if you want a pic to show with your comment, go get a gravatar!