Network devices use distinct memory types and configuration files to manage settings across reboots. Understanding the difference between RAM-based running configuration and the persistent startup configuration is essential for maintaining consistent device behavior.
Device Configuration Files
It's going to be important for you to understand configuration, so let's talk about different configuration files and what their purposes are.
There are several different ways that these devices can actually store information. One is RAM. Using RAM — this is the same type of RAM that's in your computers, that you're used to hearing about — this is the fast memory, the stuff that's pretty close to the processor. But the problem with it is that when you unplug the device, then you lose the information that is within RAM.
Then you've got the NVRAM. This is the information that gets stored long term, so if there's something that we want to store long term, then we store that in NVRAM. And then we have flash, and the flash is the same thing, it's long-term memory. Now, in a lot of our devices nowadays these are actually combined, and you'll see the same information.
We also have different configuration files. We make configuration changes on our devices, and when we make a change on that device, that goes into RAM, and it goes into a file that is called the running configuration. So it is the running-config file, and that running-config file then stores that change, and it also uses that information in order to know what its configuration is at any given time. Then what will happen is, if we want to save that, we would save that and it gets saved to the startup-config file. And this startup-config file, when we load up the machine, then it'll get reloaded on there as well.
Let me give an example. Let's say I change the hostname of the device, so the device is named switch and I instead then call it switch2. I enter the command hostname switch2 and I hit enter. It goes into the running configuration. My prompt from there on then says switch2. If it were to be reset, then it would go back to just switch, whatever it was set to before that.
But if I save this running-config, then that information that gets saved gets moved to the startup-config, and so now it exists in both places. So then if that device were to get restarted, it would load up this startup-config — it actually loads that startup config into RAM and then it becomes the running-config — and therefore then you don't lose that information, it keeps the hostname switch2.
Flash is usually where that IOS is installed, but quite often we see that the IOS and the startup config file get stored in the same location. So it's important to understand the difference between the running-config, which is whatever current state that it's running with, with those configurations, and the startup-config file, which is the long term, "I'm storing, I'm saving these settings." And how they interact: when I do a save, it copies the information from the running config to the startup config, and then vice versa, when I restart that device, then the startup config gets loaded up into the RAM and becomes the running config.
Let's get on to the device and take a look at these different configuration files. I'm on the switch here. I'm going to need to get into privilege EXEC mode to see some of this, so I get into privilege EXEC mode, and then I'm going to do a show flash. When I do a show flash, I see all the directory listing for what is on flash. I can actually just type in directory and it would show me the same thing, because I'm in the directory right now.
I can use my other commands to navigate the directories. I can do a change directory and change it to all these other different systems. In here we see the flash, we also see the NVRAM, and we'll also talk about the system. We can see other items that we can access as well.
I'm not going to change directories at this point in time, but I can also see what's inside these directories without changing directories, just by typing in dir. Maybe I want to see what's inside NVRAM, so I type that out, and then I can see what's inside of the NVRAM — the non-volatile RAM.
I said we'd take a look at the systems, so let's take a look at dir system and take a look at what's in there. We see the default running config and the running config. So we see the running config right here, and that is the file, what's inside of RAM, all of our configurations and how we're running currently.
I can actually see what's inside of the running config by typing in show running-config. That is going to give me a view into what this running config looks like. I'm going to hit enter and it's going to show me the start of this, and I can scroll through the rest of this, but I'm not going to for now. I do see that switch is right here.
Let's play around with this a little bit. I'm going to change the hostname of this, so I'm going to get in and say hostname switch2, hit enter. Then I will get back into show, and now I see that the hostname has switched to switch2. So that change now made it to the running config, and I can see that, as well as my prompt has changed as well.
Now if I take a look at the show, I will see that it is still the original switch, it has not changed. Right now, since that exists inside of RAM but it does not exist inside of my non-volatile RAM or my flash, then what's going to happen is I'm going to lose that setting if I do a restart right now. So I need to save that.
There are a couple of ways I can save this. I can do a copy running-config startup-config, and that's going to copy it from the running configuration into the startup configuration. So then I hit enter with that, and it's going to prompt me, are you sure you want to do that? Yes, I do. So it's saving that. And then I can do a show startup-config, and I see now it is in the startup-config. So if I were to restart this device, it would then save that change, so I am good to go.
One other way that I can actually save that file is the write memory. If I do a write memory, that will also go through the same process of saving that.
Now let's say I want to start fresh and I want to delete the startup-config. All I need to do is type in erase startup-config and then hit enter, and then it's going to prompt me, are you sure you want to do that? Yes, I do. I'm going to hit enter, and now it's going to erase that. It no longer exists in there.
So that's how you're going to save your files and settings and navigate to the different files. That is the different configs and the different storage methods.
One thing to note with this: we say that the startup-config file is found in the NVRAM, but we also see this config.text. If you take a look, these are actually the same file. They're 2305, so it's actually the same size of file, and it is the same file. These reference each other. If you were to save something to the startup config, it is in fact saving it in the config.text. When you erase this or remove it, then you are removing this config.text and it no longer exists. So what you see in NVRAM and flash are actually the same thing here.
TechKnowSurge builds IT and cybersecurity professionals through hands-on, concept-first training built around real understanding — not memorization. Free interactive tools, structured programs, and 25+ years of real-world experience, all in one place.
Explore free tools and programs →