So let’s have a look at a difference in configuration.
So what happens if I type sh run | b vty.
If I look at the startup config I have the same configuration
but let’s change that so, line vty 0 10 login password cisco
sh run | b vty I can see my 5 VTY lines
0 4 plus an additional 6 VTY lines.
If I type sh start | b vty
I only see my first 5 VTY lines with the command login.
So let’s copy start to run and see how it merges the configuration.
Well it removes config, overwrite it or replace it.
So sh run | b vty we still have the VTY config as configured.
So the login command is still there, the password command is still there
and the additional VTY lines are still there.
Sh start | b vty, only has the first 4 VTY.
But now let’s make a change, lines line vty 0 10
I’m gonna type no login, so sh run type begin vty notice we’ve use the command no login
which means no login credentials are required, but if we look at the startup config
we’ve got the login keyword, so this login keyword conflicts with this no login command.
copy, copy start run sh run | b vty
so notice the difference now.
On the VTY lines, this command has been overwritten by the startup config
because previously in the running config
we had no login and then the startup config we had login.
So no login was in conflict with login and that’s now been replaced
but the additional conflict hasn’t been removed.
So the startup config has been merged with the running config.
Be careful doing merges of config, it can be confusing
to know what your result in configuration is.
Now there’s another option called configure replace.
So now let see what happens if we replace, the config with the startup config.
So I'm gonna replace the running config with the startup config
notice we’ve told that configuration changes have been made.
So if I type sh run | b vty
the default login authentication has been added.
the configuration of all the lines have been replaced with the startup config.
So this is not a merge, this is the replacement of the running config with the startup config.
So just to reiterate, copy start run is a merge
configure replace startup config.
configure replace nvram startup config is a replacement
of the running config with the startup config.
So be careful using copy start to run
because the result in configuration may not be what you expect it to be.
A copy runs start is a replacement always but a copy start to run is a merge
so a command that often preferred is configure replace
which replaces the running config with the startup config
the same could be used, so it configure replace
and you could specify TFTP rather options
so you could replace the running config with the configuration on a TFTP server.
By default a copy from TFTP to run is a merge
in the similar way to when you make a configuration changes through the CLI
like we’ve been doing you are merging the configuration
in other words you're making changes to specific portions and the same is true
when you copy the config from startup to running config, be aware of the different options.