LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 08-06-2015, 10:28 PM   #1
trscookie
Member
 
Registered: Apr 2004
Location: oxford
Distribution: gentoo
Posts: 463

Rep: Reputation: 30
Removing cisco rules


Hello All,

I am at a loss as to how I remove a couple of lines from a cisco running-config:

when running: show running-config:

Code:
no ip http server
no ip http secure-server
ip nat inside source list NAT interface FastEthernet0 overload
ip nat inside source static 10.0.2.8 203.???.???.???
ip nat inside source static 10.0.2.4 203.???.???.???
ip nat inside source static 10.0.2.7 203.???.???.???
ip nat inside source static 10.0.2.5 203.???.???.???
ip nat inside source static 10.0.2.36 203.???.???.???
ip nat inside source static 10.0.2.6 203.???.???.???
ip nat inside source static 10.0.2.9 203.???.???.???
ip nat inside source static tcp 10.0.2.160 548 203.???.???.??? 80 extendable
ip nat inside source static tcp 10.0.2.160 548 203.???.???.??? 548 extendable
ip nat inside source static tcp 10.0.2.160 548 203.???.???.??? 8080 extendable
ip nat inside source static 10.0.2.160 203.???.???.???
ip nat inside source static tcp 10.0.2.11 548 203.???.???.??? 80 extendable
ip nat inside source static tcp 10.0.2.11 548 203.???.???.??? 548 extendable
ip nat inside source static tcp 10.0.2.11 548 203.???.???.??? 8080 extendable
ip nat inside source static 10.0.2.11 203.???.???.???
ip nat inside source static tcp 10.0.2.2 548 203.???.???.??? 80 extendable
ip nat inside source static tcp 10.0.2.2 548 203.???.???.??? 548 extendable
ip nat inside source static tcp 10.0.2.2 548 203.???.???.??? 8080 extendable
ip nat inside source static 10.0.2.2 203.???.???.???
ip nat inside source static 10.0.2.3 203.???.???.???

I would like to remove the following lines:

Code:
ip nat inside source static tcp 10.0.2.160 548 203.???.???.??? 80 extendable
ip nat inside source static tcp 10.0.2.160 548 203.???.???.??? 548 extendable
ip nat inside source static tcp 10.0.2.160 548 203.???.???.??? 8080 extendable
ip nat inside source static 10.0.2.160 203.???.???.???
ip nat inside source static tcp 10.0.2.11 548 203.???.???.??? 80 extendable
ip nat inside source static tcp 10.0.2.11 548 203.???.???.??? 548 extendable
ip nat inside source static tcp 10.0.2.11 548 203.???.???.??? 8080 extendable
ip nat inside source static 10.0.2.11 203.???.???.???

I have tried saving the config removing the lines then loading the config file again, but it still does not remove the expected lines. Is there a way to just delete those 8 lines?

Cheers,
trscookie
 
Old 08-07-2015, 03:24 AM   #2
wildwizard
Member
 
Registered: Apr 2009
Location: Oz
Distribution: slackware64-14.0
Posts: 875

Rep: Reputation: 282Reputation: 282Reputation: 282
The normal way to remove a Cisco config setting is to prefix the command with "no"

With the commands you have you would need to type out the entire command with "no" on the front of each line as your removing specific rules.

Also something you may have overlooked is that the config you need to overwrite is called startup-config not running-config. Whenever you change a config setting you alter running-config but not startup-config.

startup-config is the config saved into flash and loaded on startup and then becomes running-config.

The correct way to update startup-config is to execute "copy running startup" on the Cisco CLI which will then copy running-config into startup-config
 
Old 08-09-2015, 06:01 PM   #3
trscookie
Member
 
Registered: Apr 2004
Location: oxford
Distribution: gentoo
Posts: 463

Original Poster
Rep: Reputation: 30
Hey, cheers for the response. I have tried using 'no' to no avail unfortunately, I have no idea why this is:

Code:
TB_BB_Package#no ip nat inside source static tcp 10.0.2.160 548 203.???.???.??? 80 extendable
                 ^
 Invalid input detected at '^' marker.
Thanks again,
 
Old 08-09-2015, 11:03 PM   #4
trscookie
Member
 
Registered: Apr 2004
Location: oxford
Distribution: gentoo
Posts: 463

Original Poster
Rep: Reputation: 30
I forgot to run "configure terminal" after "enabling"! doh!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
NAT rules through Cisco VPN CLient nicolas59000 Linux - Security 1 05-20-2014 03:36 AM
auditctl -l not showing any rules even though i have rules written in audit.rules alphaguy Linux - Security 1 02-07-2014 05:28 PM
ok network problem with the cisco e3200 router and cisco se2800 switch to ps3 linux/unix87 Linux - Hardware 0 03-07-2012 06:04 PM
LXer: Run Linux on your Cisco router with Cisco's new AXP module LXer Syndicated Linux News 0 10-03-2008 02:00 PM
Removing option from rules in makefile RichardS Programming 1 08-18-2007 08:07 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 01:59 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration