Link to home
Start Free TrialLog in
Avatar of cpatte7372
cpatte7372Flag for United Kingdom of Great Britain and Northern Ireland

asked on

Cisco Boot Startup Configuration

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
Avatar of Matthew
Matthew
Flag of Slovenia image

copy flash:/vanilla startup-config
Avatar of cpatte7372

ASKER

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

Cheers
ASKER CERTIFIED SOLUTION
Avatar of Jan Bacher
Jan Bacher
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
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"
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.
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
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 * * *"
                              ^
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
NK7
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
Did you try

copy running-config startup-config

or

copy flash:/vanilla startup-config
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
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.
Matt,

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

Cheers
Hi Matt,

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

Cheers
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.
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
If user has privilege 15, he/she can do anything with device. Who is managing this device, who can change config?
I'm managing the device.

I'm sure there is a way to prevent a command from being run not matter the privilege....
If that's not possible I therefore the startup config to boot from flash regardless...
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
Hello Predrag,

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