cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1054
Views
0
Helpful
2
Replies

Change ip and default gateway with only one command

bagnolini
Level 1
Level 1

I need to change multiple commands on a router with only one command, for example I have to send these command:

conf t

interface fastethernet 0/0

ip address 192.168.0.1 255.255.255.0

exit

ip route 0.0.0.0.0 0.0.0.0 192.168.0.254

Is it possible send only one "macro" command to a router?

2 Replies 2

gatlin007
Level 4
Level 4

I'm going to guess you are accessing the router over the very interface and route you are configuring?  This is always dangerous business.

Out of band management; such as a modem you can dial into that's connected to the console is the best way.

If you don't have that option continue at your own risk.

1.  Write mem

2.  Reload in 20 ### Router will reload with saved config 20 minutes latter in the event of 'lost router' scenario.

3.

ip route 0.0.0.0.0 0.0.0.0 fa0/0

no ip route 0.0.0.0 0.0.0.0 x.x.x.x  ### This is the original default route

### Still work?

4.

int fa0/0
ip address 192.168.0.1 255.255.255.0
exit

ip route 0.0.0.0 0.0.0.0 192.168.0.254

no ip route 0.0.0.0 0.0.0.0 fa0/0

### Still work??

5. write mem

6. reload cancel


Chris

paolo bevilacqua
Hall of Fame
Hall of Fame

As Christoper pointed out, that is always dangerous to do.

I would recommednt he following:

a. prepare a complete new configuration file

b: conf overwrite

c. reload

As long the new configuration is correct, that method is guaranteed to work.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Innovations in Cisco Full Stack Observability - A new webinar from Cisco