The switch can have multiple IP addresses. Each IP address can be assigned to specified interfaces or ports, Link Aggregation Groups (LAGs), or Virtual Local Area Networks (VLANs). To remotely manage the device, an IP address must be defined to access the switch. This allows you to easily configure or troubleshoot the device through the web-based utility, Telnet, or Secure Shell (SSH).
The IP address of the switch can be manually configured or automatically received from a Dynamic Host Configuration Protocol (DHCP) server. If there are no DHCP servers available, the switch will use its factory default IP address which is 192.168.1.254.
This article provides instructions on how to configure the IP address settings of your switch through the Command Line Interface (CLI).
If you are unfamiliar with terms in this document, check out Cisco Business: Glossary of New Terms.
Important: If your switch is in one of the stacking modes with a Standby Switch present, it is recommended to configure a static IP address to prevent disconnecting from the network during a Stacking Active switchover. This is because when the standby switch takes control of the stack, when using DHCP, it might receive a different IP address than the one that was received by the original active-enabled unit of the stack.
In this scenario, the switch is set up without the availability of a DHCP server. Follow the steps below to configure a static IP address on the switch:
Step 1. Connect your computer directly to the switch using a serial cable.
If you would prefer to SSH into your switch, click here to view an article on gaining CLI access to a switch.
Step 2. Log in to the switch console. The default username and password is cisco/cisco. If you have configured a new username or password, enter the credentials instead.
Step 3. From the Privileged EXEC mode of the switch, enter the Global Configuration mode by entering the following:
SG350X#configureStep 4. In the Global Configuration mode, enter the interface context by entering the following:
SG350X(config)#interface [interface-id | vlan-idStep 5. Enter the IP address interface configuration command to define an IP address for an interface by entering either of the following:
The options are:
Step 6. (Optional) To remove an IP address from an interface, use the no form of the IP address command by entering the following:
SG350X(config-if)#no ip addressStep 7. Enter the end command to go back to the Privileged EXEC mode of the switch.
SG350X(config-if)#endStep 8. (Optional) To display the IP address configuration and information on the interface, enter the following command in the Privileged EXEC mode:
SG350X#show ip interfaceStep 9. (Optional) To save the configured settings to the startup configuration file, enter the following:
SG350X#copy running-config startup-configStep 10. (Optional) Press Y for Yes or N for No on your keyboard once the Overwrite file [startup-config]… prompt appears.
You should now have successfully configured the static IP address settings of your switch.
In this scenario, the switch is connected to a router which acts as an active DHCP server. Follow the steps below to configure the IP address of the switch through DHCP.
Step 1. Connect your computer directly to the switch using a serial cable.
Step 2. Log in to the switch console. The default username and password is cisco/cisco. If you have configured a new username or password, enter the credentials instead.
Step 3. From the Privileged EXEC mode of the switch, enter the Global Configuration mode by entering the following:
SG350X#configureStep 4. In the Global Configuration mode, enter the interface context by entering the following:
SG350X(config)#interface [interface id | vlan-id]Step 5. In the interface context, acquire an IP address from the DHCP server by entering the following:
SG350X(config-if)#interface [interface id | vlan-id]You will receive a notification that the device has been configured on the specified interface.
Step 6. (Optional) To remove an IP address from an interface, use the no form of the IP address DHCP command by entering the following:
SG350X(config-if)#no ip address dhcpStep 7. Enter the end command to go back to the Privileged EXEC mode of the switch.
SG350X(config-if)#endStep 8. (Optional) To display the IP address configuration and information of the interface, enter the following command in the Privileged EXEC mode:
SG350X#show ip interfaceStep 9. (Optional) To display the IP address configuration and information on the DHCP client interface, enter the following command in the Privileged EXEC mode:
SG350X#show ip dhcp client interfaceStep 10. (Optional) To save the configured settings to the startup configuration file, enter the following:
SG350X#copy running-config startup-configStep 11. (Optional) Press Y for Yes or N for No on your keyboard once the Overwrite file [startup-config]… prompt appears.
You should now have successfully configured the DHCP IP address settings on your switch.
Revision | Publish Date | Comments |
---|---|---|
1.0 |
13-Dec-2018 |
Initial Release |