Managing network infrastructure often requires re-addressing devices during subnet migrations, security segmentation projects, or initial deployments. On Cisco Catalyst switches, management access is handled through a Switch Virtual Interface (SVI)—a logical Layer 3 interface tied to a specific VLAN. Changing this IP address requires precision: an incorrect subnet mask, a forgotten default gateway, or an uncommitted change can immediately sever management access and isolate the switch from the network.
This comprehensive guide covers everything required to reconfigure a Cisco switch IP address via the Cisco IOS command-line interface (CLI). You will learn the underlying architecture, how to safely inspect the current configuration, execute the change, update routing parameters, execute remote changes without lockout, and troubleshoot reachability issues.
Table of Contents
Cisco Catalyst Management IP Architecture and Specifications
In Cisco IOS and IOS XE architectures, management communication to a Layer 2 or Layer 3 Catalyst switch occurs through an in-band Switch Virtual Interface (SVI) or a dedicated out-of-band (OOB) Ethernet management port (such as FastEthernet0 or GigabitEthernet0/0 on supported chassis).
Switch Virtual Interface (SVI) Definition
An SVI is a routed interface representing a VLAN terminating on the switch. It provides Layer 3 processing for packets directed to or originating from the switch CPU (such as SSH, SNMP, Syslog, NTP, and RADIUS/TACACS+ traffic).
- Default Configuration: Out of the box, Cisco switches default management capabilities to
interface Vlan1. - Security Recommendation: Production deployments routinely deactivate
Vlan1for management and provision an isolated management VLAN (e.g., VLAN 10 or VLAN 99) across 802.1Q trunk links.
SVI Operational State Requirements (Autostate)
For a management SVI to transition into an up/up state and process packets, Cisco IOS enforces the Autostate algorithm. The SVI will remain down/down or up/down unless the following conditions are met:
1. The corresponding VLAN exists in the switch’s local VLAN database (vlan.dat).
2. The VLAN is active and not administratively shut down.
3. At least one Layer 2 physical switchport or port-channel assigned to that VLAN is in the operational up/up spanning-tree forwarding state, or an active 802.1Q trunk port is up and has the VLAN unpruned in its allowed VLAN list.
How to Find the Current IP Address Using the Cisco IOS CLI
Before modifying any network settings, determine the current management interface, its IP address, subnet mask, and operational status.
Step 1: Access Privileged EXEC Mode
Connect to the switch via console or SSH and enter Privileged EXEC mode using the enable command:
Switch> enable
Switch#
Step 2: Identify Active Interfaces and Assigned IPs
Execute show ip interface brief to display a summary table of all physical interfaces and virtual interfaces:
Switch# show ip interface brief
Interface IP-Address OK? Method Status Protocol
Vlan1 192.168.1.2 YES manual up up
GigabitEthernet0/1 unassigned YES unset up up
GigabitEthernet0/2 unassigned YES unset down down
Identify the SVI configured with an IP address (commonly Vlan1 or a dedicated management VLAN).
Step 3: Retrieve the Subnet Mask
The show ip interface brief output does not display subnet masks. To obtain the exact subnet mask and routing settings, query the specific VLAN interface:
Switch# show ip interface vlan 1
Vlan1 is up, line protocol is up
Internet address is 192.168.1.2/24
Broadcast address is 255.255.255.255
Address determined by non-volatile memory
MTU is 1500 bytes
Alternatively, view the active running configuration for that interface:
Switch# show running-config interface vlan 1
interface Vlan1
ip address 192.168.1.2 255.255.255.0
no shutdown
end
Step-by-Step Guide: Changing the Management IP Address via CLI
Once you have verified the active SVI, you can reconfigure the IP address. Cisco IOS allows you to overwrite the primary IP address directly on the interface.
Step 1: Enter Global Configuration Mode
From Privileged EXEC mode, enter global configuration mode:
Switch# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#
Step 2: Enter the Interface Configuration Context
Navigate to the SVI that holds the management IP address:
Switch(config)# interface vlan 1
Switch(config-if)#
(Replace 1 with your dedicated management VLAN ID if applicable).
Step 3: Assign the New IP Address and Subnet Mask
Issue the ip address command with your new network parameters. In Cisco IOS, applying this command automatically replaces the existing primary IP address:
Switch(config-if)# ip address 10.10.20.15 255.255.255.0
Step 4: Ensure the Interface Is Active
Ensure that the interface is not administratively disabled:
Switch(config-if)# no shutdown
Switch(config-if)# exit
Switch(config)#
Step 5: Save the Running Configuration
Return to Privileged EXEC mode and commit the changes from RAM (running-config) to NVRAM (startup-config) so they persist across reboots:
Switch(config)# end
Switch# copy running-config startup-config
Destination filename [startup-config]? [Press Enter]
Building configuration...
[OK]
(Alternatively, execute the shortcut write memory or wr).
Updating the Default Gateway and Routing Settings
Changing the IP address of a switch to a new subnet almost always requires updating its default gateway. Without an accurate gateway, the switch can communicate with devices on its local subnet but cannot return traffic to management stations residing in other subnets.
The command required depends on whether your switch functions purely at Layer 2 or has Layer 3 IP routing enabled.
Scenario A: Layer 2 Switches (ip default-gateway)
If the switch operates as a pure Layer 2 bridge (standard for Catalyst 2960, 1000, or multi-layer switches operating with no ip routing), configure the default gateway in global configuration mode:
Switch# configure terminal
Switch(config)# ip default-gateway 10.10.20.1
Switch(config)# end
Switch# copy running-config startup-config
To verify the updated gateway:
Switch# show ip default-gateway
10.10.20.1
Scenario B: Layer 3 Multi-Layer Switches (ip route)
If your Catalyst switch (e.g., Catalyst 3650, 3850, 9200, 9300) operates as a Layer 3 switch with ip routing enabled, the ip default-gateway command is ignored. Instead, manage default egress traffic using a static default route (0.0.0.0/0):
- Check the existing routing table:
text
Switch# show ip route - Remove the old static default route:
text
Switch(config)# no ip route 0.0.0.0 0.0.0.0 192.168.1.1 - Add the new static default route pointing to your new next-hop gateway:
text
Switch(config)# ip route 0.0.0.0 0.0.0.0 10.10.20.1
Switch(config)# end
Switch# copy running-config startup-config
Safely Changing a Remote Switch IP Without Dropping SSH Connectivity
Re-addressing a switch over an active SSH or Telnet session carries significant risk. Modifying the IP address or default gateway terminates the active TCP session instantly. If a syntax error occurs, or the new subnet/gateway is unreachable, you face a permanent lockout that requires an on-site console cable intervention.
Use this failsafe procedure to protect against remote lockouts.
Step 1: Arm the Automated Reload Timer
Before executing configuration changes, schedule a safety reload:
Switch# reload in 10
System configuration has been modified. Save? [yes/no]: no
Proceed with reload? [confirm] [Press Enter]
- How this protects you: The switch will reboot back into its current
startup-configin 10 minutes. If you lose access, do nothing; the switch will automatically reload the previous working configuration.
Step 2: Execute Commands as a Single Batch
To prevent mid-session disconnects caused by an IP change without an updated gateway, combine your interface IP change, gateway update, and interface state into a single batch entry:
configure terminal
interface vlan 1
ip address 10.10.20.15 255.255.255.0
no shutdown
exit
ip default-gateway 10.10.20.1
end
Paste these lines all at once into the terminal window. Your current SSH session will terminate as the old IP stops responding.
Step 3: Establish a New Connection and Cancel the Reload
- Open a new terminal session from your management station and connect to the new IP:
bash
ssh admin@10.10.20.15 - Upon successful authentication, immediately cancel the reload timer:
text
Switch# reload cancel - Save your running configuration to NVRAM:
text
Switch# copy running-config startup-config
If the new connection fails within 10 minutes, the reload timer expires, rebooting the switch to its prior IP and restoring access.
Cisco Switch IP Configuration Scripts and Command Templates
Use these pre-formatted scripts to streamline configuration. Replace all bracketed values (< ... >) with your site-specific parameters before pasting into the CLI.
Layer 2 Catalyst Switch Template
enable
configure terminal
!
interface vlan <MANAGEMENT_VLAN_ID>
description Management_SVI
ip address <NEW_IP_ADDRESS> <SUBNET_MASK>
no shutdown
exit
!
ip default-gateway <NEW_GATEWAY_IP>
!
end
copy running-config startup-config
Layer 3 Multi-Layer Switch Template
enable
configure terminal
!
interface vlan <MANAGEMENT_VLAN_ID>
description Routed_Management_SVI
ip address <NEW_IP_ADDRESS> <SUBNET_MASK>
no shutdown
exit
!
no ip route 0.0.0.0 0.0.0.0 <OLD_GATEWAY_IP>
ip route 0.0.0.0 0.0.0.0 <NEW_GATEWAY_IP>
!
end
copy running-config startup-config
Frequently Asked Questions: Troubleshooting Switch Unreachability
Why can I ping the new switch IP from the local subnet, but not from across a router?
This issue almost always points to a missing or incorrect default gateway.
* On Layer 2 switches, verify that ip default-gateway is configured and matches the IP of the local router interface on that VLAN.
* On Layer 3 switches with ip routing active, ensure a default static route (ip route 0.0.0.0 0.0.0.0 <next-hop>) exists using show ip route.
Why does show ip interface brief display the VLAN interface as “up/down” or “down/down”?
This is driven by the Cisco Autostate mechanism covered earlier:
* If the line protocol is down, ensure the VLAN is defined in the VLAN database (show vlan brief).
* Check that at least one physical port belonging to this VLAN is plugged in, operational, and in the STP forwarding state (show interfaces status).
* If using an 802.1Q trunk, verify the VLAN is not excluded by the switchport trunk allowed vlan filter.
Why is SSH/Telnet failing even though the switch responds to ICMP echo (ping)?
- Access Control Lists (ACLs): Check your VTY line configurations. Run
show running-config | section line vty. If anaccess-classis applied, make sure your new management subnet is explicitly permitted in the referenced access list. - Crypto Key Invalidation: If the switch hostname or IP domain name was changed alongside the IP address, RSA key pairs may need regeneration:
text
Switch(config)# crypto key generate rsa modulus 2048
Does assigning a new IP address automatically remove the old IP?
Yes. Entering ip address <new-ip> <subnet-mask> directly replaces the primary IP address. It does not append a second IP unless you explicitly append the secondary keyword to the command. You can confirm active assignments at any time using show running-config interface vlan <vlan-id>.
Conclusion
Changing the IP address on a Cisco Catalyst switch involves modifying the management SVI, ensuring alignment with the Autostate prerequisites, and updating the corresponding Layer 2 default gateway or Layer 3 default route. For remote environments, using proactive rollback mechanisms like the reload in safety timer guards against configuration lockouts. By verifying interface states prior to execution and committing changes to NVRAM immediately after testing, network administrators can ensure seamless management transitions across enterprise environments.











Comments