10-01-2010 08:41 AM - edited 03-04-2019 09:57 AM
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?
10-01-2010 08:52 AM
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
10-01-2010 09:46 AM
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.
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: