Solved

Cisco Boot Startup Configuration

Posted on 2014-12-12
24
117 Views
Last Modified: 2015-08-16
Hello Experts,

Can someone please tell me how to configure the router to boot the startup config from the bootflash?

For example I copied a startup config to the bootflash called 'vanilla'. I want to be able to use that startup config in bootflash to be loaded in the router whenever the router reloads - even if I do a wr mem or copy run to startup.

I'm sure its possible but not sure how.

Cheers

Carlton
0
Comment
Question by:cpatte7372
  • 14
  • 7
  • 2
  • +1
24 Comments
 
LVL 6

Expert Comment

by:Matt
ID: 40496405
copy flash:/vanilla startup-config
0
 

Author Comment

by:cpatte7372
ID: 40496442
Thanks for responding, but how to I ensure that each time the router reloads it reloads with 'vanilla' configuration?

Cheers
0
 
LVL 28

Accepted Solution

by:
Jan Springer earned 500 total points
ID: 40496522
if you want to boot into an alternate config file, i believe that you will have to use tftp and load it from the network.
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 6

Expert Comment

by:Matt
ID: 40496549
If you want to boot every time with your "vanilla" config, you can use EEM (Cisco IOS Embedded Event Manager) and run script using CRON - I assume you have CISCO router?

For example this:
http://wiki.nil.com/Time-based_wireless_interface_activity

event manager applet ReloadFreshConfig
 event timer cron name ReloadFreshConfig cron-entry "0 7 * * *"
 action 1.0 cli command "enable"
 action 1.1 cli command "configure terminal"
 action 1.5 cli command "copy flash:/vanilla startup-config "
 action 1.6 cli command "reload"
0
 
LVL 28

Expert Comment

by:Jan Springer
ID: 40496563
if you want to save your changes to "vanilla", you can create an alias

alias exec van copy running flash:/vanilla

and then when you do a "van" (or whatever you choose to call it, it gets saved to the appropriate file.
0
 

Author Comment

by:cpatte7372
ID: 40498151
Hi Ian,

This might sound silly, but I don't want to save my changes for "vanilla", I want to boot every time from my "vanilla" config as highlighted by Matt.

But thanks a lot for responding.

Matt,  I'm going to try your suggestion.

I will let you know how I get on

Cheers
0
 

Author Comment

by:cpatte7372
ID: 40498243
Hi Matt,

I get the following error when I apply the following command on my Nexus:
N7K-23(config-applet)#  event timer cron name ReloadFreshConfig cron-entry "0 7 * * *"
                              ^
0
 

Author Comment

by:cpatte7372
ID: 40498244
Matt,

I have the following options:

N7K-23(config-applet)# event ?
  cli              Create a cli event specification
  counter          Create a counter event
  fanabsent        Create fanabsent event specification
  fanbad           Create fanbad event specification
  memory           Create memory thresholds event specification
  module           Create a 'module' event specification
  module-failure   Create a 'module-failure' event specification
  oir              Create Online-Insertion-Removal event specification
  policy-default   Use the event in the system policy being overridden
  poweroverbudget  Create poweroverbudget event specification
  snmp             Create a 'snmp' event specification.
  storm-control    Create a storm control event specification
  syslog           Create a syslog event specification
  sysmgr           System manager related events
  temperature      Create temperature event specification
  track
0
 
LVL 6

Expert Comment

by:Matt
ID: 40498250
0
 

Author Comment

by:cpatte7372
ID: 40498255
NK7
0
 

Author Comment

by:cpatte7372
ID: 40498259
Matt,

Even without the command "N7K-23(config-applet)#  event timer cron name ReloadFreshConfig cron-entry "0 7 * * *"

If I save the config with copy run start the EEM won't bring back the  "vanilla" config when I do a reboot. However, it will work if I don't do a copy run start

I would really like "vanilla" config to be built each time, regardless of issuing the command copy run start.

Is that possible?

Cheers
0
 
LVL 6

Expert Comment

by:Matt
ID: 40498263
Did you try

copy running-config startup-config

or

copy flash:/vanilla startup-config
0
 

Author Comment

by:cpatte7372
ID: 40498270
Hi Matt,

Just to give you an example

The hostname of the nexus in the vanilla config is NK7-2. If I change the hostname to NK7-33 and do a reload without issuing the command copy running-config startup-config when the nexus comes back it will still have the hostname NK7-2.

However, If issue the command copy running-config startup-config before reloading it will comeback with the hostname NK7-33.

I would like the vanilla config (with NK7-2) to come back after reload regardless of whether copy running-config startup-config is issued or not.

Does that make sense?

Cheers
0
 
LVL 6

Expert Comment

by:Matt
ID: 40498275
OK, it makes sense but why would you want to change hostname anyway? Hostname is defined in config file. If you change hostname and you have already defined RSA keys to SSH access, you will always get warning from SSH client that RSA keys do not match your FQDN of CISCO...

What is the purpose to change hostname anyway?

I'm now looking at CISCO documentation how to use EEM with NEXUS devices.
0
 

Author Comment

by:cpatte7372
ID: 40498278
Matt,

I guess what I'm saying is that I would like the startup config to be taken from "vanilla" no matter what

Cheers
0
 

Author Comment

by:cpatte7372
ID: 40498282
Hi Matt,

I was just using the hostname as an example - it could be any config change

Cheers
0
 
LVL 6

Expert Comment

by:Matt
ID: 40498288
OK, then save you vanilla config like "base-config.txt" in flash or disk0 device on Nexus.

I will try to find EEM example how to copy base-config.txt to your startup-config and then reloads device. Example I gave you was used for CISCO routers.
0
 

Author Comment

by:cpatte7372
ID: 40498289
Matt,

I'm basically trying to ensure that users can't overwrite the startup config with the command:

copy running-config startup-config

One way is to not allow the command copy running-config startup-config. Is that possible?

Cheers
0
 
LVL 6

Expert Comment

by:Matt
ID: 40498295
If user has privilege 15, he/she can do anything with device. Who is managing this device, who can change config?
0
 

Author Comment

by:cpatte7372
ID: 40498296
I'm managing the device.

I'm sure there is a way to prevent a command from being run not matter the privilege....
0
 

Author Comment

by:cpatte7372
ID: 40498297
If that's not possible I therefore the startup config to boot from flash regardless...
0
 
LVL 27

Expert Comment

by:Predrag Jovic
ID: 40502152
I'm sure there is a way to prevent a command from being run not matter the privilege....
I don't think that is possible. Even you would not be able to make changes to your router. It is the same logic as no one have password to router, but you are able to see config on piece of paper. :) Why don't you just change passwords, if you follow this logic?

You can copy your desired startup config to flash

#copy start flash://flashstart.cfg
Destination filename [flashstart.cfg]?

You can configure router to boot from that file
(config)#boot host flash://flashstart.cfg

In that case if someone change startup config and reboot router, after reboot rooter will start with configuration from flashstart.cfg. So, start config would be still the same as long as no one deletes this redirection.

In running config you will have redirection to flash
boot-start-marker
boot host flash://flashstart.cfg
boot-end-marker


I hope that's what you are looking for.

To remove redirection to boot router from flash
(config)#no boot host flash:
(config)#do copy run start
0
 

Author Comment

by:cpatte7372
ID: 40502157
Hello Predrag,

I have a work around - I will simply prevent users from saving the running config to startup config :-)
0
 

Author Closing Comment

by:cpatte7372
ID: 40932068
Thanks Jan
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to set-up an On Demand, IPSec, Site to SIte, VPN from a Draytek Vigor Router to a Cyberoam UTM Appliance. A concise guide to the settings required on both devices
I recently attended Cisco Live! in Las Vegas, a conference that boasted over 28,000 techies in attendance, and a week of hands-on learning hosted by a solid partner with which Concerto goes to market.  Every year, Cisco displays cutting-edge technol…
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…

825 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question