How to Set a Static IP Address on a Cisco Switch or Router
This guide will go through the brief process of Assigning a static management IP Address for your Cisco switch or router, using the command line.
1.) Connect to your switch or router, using your Terminal Emulator.
I will be using a computer with Putty installed on it, connected to the switch using a Cisco Rollover cable.
2.) First we need to find out which interfaces exist on our switch, so we can choose the one we want to configure.
Please note that interfaces can be physical, such as a physical port on the switch, or virtual, such as a specific VLAN.
You can get a list of interfaces by typing, “show ip interface brief”.
Once you decide on which interface you wish to configure go to the next step.
3.) Next we will need to enter Global configuration mode to configure the interface we selected.
To get to Global configuration mode use “Enable” followed by “Configure Terminal”.
4.) Once in Global Configuration Mode, we will select the switches interface you wish to configure and assign it a static IP Address.
I will be configuring my switches VLAN1 interface.
A.) Type “Interface interfacename“.
Replace interfacename with the name of the interface you previousley chose.
For example, I will use “interface VLAN1”.
5.) Next we will assign the interface an ip address and then turn on that interface.
Use the command “ip address ipaddress subnetmask” to set an ip address for that interface.
Replace “ipaddress” with the ip address you wish to use and “subnetmask” with the subnet mask.
Then use the “no shutdown” command to turn on that interface.
6.) Now we will exit Global configuration mode.
Briefly Press the CTRL button and then C button to get back to Privileged EXEC mode.
(As an alternative, you can use the “exit” command two times, to get back to Privileged EXEC mode)
7.) We can now save our configuration, so that we don’t lose our work if the switch or router restarts.
In Privileged EXEC mode, use the “Copy Running-Config Startup-Config” command.
If prompt for the destination filename, press ENTER.
You are now done configuring the switch with a static IP Address.
You can use this ip address to remote into the switch for future configuration, monitoring etc.