cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1474
Views
0
Helpful
0
Comments
smallbusiness
Community Manager
Community Manager

Article ID:5825

Setting Static IPv4 Address on a Switch via CLI

Date Identified

April 6, 2017

Date Resolved

N/A

Products Affected

Model
Firmware Version
Sx250; SG250X; Sx350; SG350X, Sx550X; SG350XG, SG550XG 2.3.5.63
 

Problem Description

After upgrading devices to the latest firmware, converting the switch IP address from DHCP assigned to statically set is prevented by a bug (screenshot below). This document introduces a temporary workaround for setting a static IP address on switching devices via the command line interface (CLI). For a complete rundown of commands available please click here.

Visual example of the issue in a browser window.

Workaround

As mentioned above, the graphical user interface (GUI) does not enable you to compose the IP address. An alternative workaround for assigning a static IP address via the GUI can be found here. For users who prefer to use the CLI to complete the process, continue reading.

Prior to beginning this process, it is a best practice to create a backup of the running configuration, for further directions click here.

As an important note, there are two methods of connecting your computer to your switching devices. The first is via serial or a console cable, and the second is via SSH/Telnet over a networked connection. If you intend to change the IP address to an address outside of its currently running configuration, we recommend you connect via the console or serial cable. If the IP address is remaining within its current subnet, feel free to choose whichever method works best for you.

To set a static IP address via the CLI via SSH, follow the steps below:

Step 1. For reference SSH must be enabled from the GUI prior to initiating your first SSH session. If you have not already enabled these settings, log in to the web configuration utility page and continue forward, otherwise skip ahead to step 3.

From the main menu, Choose Security>TDP/UDP services:

Navigation bar location of this step's destination.

Step 2. Enable Telnet or SSH service by checking the appropriate box and click Apply

Step 3. Use your preferred application to SSH into the device and then enter your username and password. For additional instructions on accessing your device via SSH click here.

Note: If you intend to edit the IP address of the switch to an IP address outside the device's current sub-network you should use a serial/console port to maintain the session connection through completion of the IP address modification.

Step 4. From the command prompt enter terminal configuration mode by typing the command (below in bold font).

SG350X#config terminal

Note:The command line displays as the switch host name followed by a #, in this case the device is a SG350X switch.

Step 5. Once in terminal configuration mode, you will need to proceed to interface configuration mode by entering the following:

SG350X(config)#interface [VLAN ID]

Note: Parameters in [bracket notation] should be treated like quotation marks and substitute in the parameter specific to your network configuration.

Step 6. After this command runs you will be asked if you want to proceed, enter Y when prompted.

SG350X(config-if)#No ip address DHCP

Step 7. Now you will be removing the existing IP address of the switch with this command:

SG350X(config-if)#No ip address [old IP address]

Step 8. Once you have set the CLI to enter interface mode, you are able to set the IP address and subnet mask:

SG350X(config-if)#ip address [IP address] [subnet mask]

Note: The IP address change will drop the SSH connection; then log into the device from the newly set IP address.

Step 9. (Optional) Now exit interface configuration mode by typing exit.

SG350X(config-if)#Exit

Step 10. (Optional) This step is only required if you are changing the switch IP address outside of its original subnet or if the switch requires remote access. If you changed subnets, you will need to set a new default gateway via the following command.

SG350X#IP default-gateway [Gateway Address]

Step 11. As an additional layer of validation, once logging back in, you can verify the IP address with the following command:

SG350X#show ip interface

You will be presented with an output similar to the one shown below:

You should now have successfully assigned a static IPv4 address on the VLAN interface through CLI.

© 2018 Cisco Systems, Inc. All rights reserved.

2.3.5.63

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: