Link to home
Start Free TrialLog in
Avatar of bermyman
bermyman

asked on

Is there a command in IOS to clear the commands applied under an interface?

I'm trying to find out if there is a command that will clear an interfaces configuration.

E.G. If under "show run" an interface is listed as:

fastethernet 0/1
spanning-tree portfast
switchport mode access
switchport nonegotiate
spanning-tree portfast bpdufilter

I want one command I can use from the command-line that will clear it back to showing just

fastethernet 0/1
(with no commands here)

I've search but can find nothing, there must be a way to do this other than creating a macro filled with negation commands?

Any comments welcome!
Thanks
ASKER CERTIFIED SOLUTION
Avatar of harbor235
harbor235
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of bermyman
bermyman

ASKER

It did clear a lot of stuff, oddly left on some switchport only commands regarding spanning tree. Details as follows:

Before:
interface GigabitEthernet1/0/11
 switchport mode access
 switchport nonegotiate
 switchport voice vlan 7
 switchport port-security maximum 30
 switchport port-security
 switchport port-security mac-address sticky
 macro description access
 no cdp enable
 spanning-tree portfast
 spanning-tree bpduguard enable
end

After:
interface GigabitEthernet1/0/11
 no switchport
 no ip address
 macro description access
 spanning-tree portfast
 spanning-tree bpduguard enable
end

Still - that's a pretty good attempt. Thanks mate!
Give this a try:

conf t
default interface g1/0/11
That's exactly what I was looking for! I don't think I can give you points too but the help is much appreciated.
Thanks!
No problem on the points, glad to help.