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”.
Switch>show ip interface brief
Interface IP-Address OK? Method Status Protocol
Vlan1 unassigned YES unset administratively down down
FastEthernet4/0/1 unassigned YES unset down down
FastEthernet4/0/2 unassigned YES unset down down
FastEthernet4/0/3 unassigned YES unset up up
FastEthernet4/0/4 unassigned YES unset down down
FastEthernet4/0/5 unassigned YES unset down down
FastEthernet4/0/6 unassigned YES unset down down
FastEthernet4/0/7 unassigned YES unset down down
FastEthernet4/0/8 unassigned YES unset down down
FastEthernet4/0/9 unassigned YES unset down down
FastEthernet4/0/10 unassigned YES unset down down
FastEthernet4/0/11 unassigned YES unset down down
FastEthernet4/0/12 unassigned YES unset down down
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.
Switch(config-if)#ip address 192.168.1.1 255.255.255.0
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.
Switch#Copy Running-Config Startup-Config
Destination filename [startup-config]?
0 bytes copied in 1.879 secs (0 bytes/sec)
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.