Configure VLAN Interface IPv4 Address on an Sx350 or SG350X Switch through the CLI
The switch can have multiple IP addresses and can be configured either on a port, a Link Aggregation Group (LAG), a Virtual Local Area Network (VLAN), or a loopback interface. If a switch does not have a Dynamic Host Configuration Protocol (DHCP) server then the IP address needs to be assigned statically. The switch routes traffic between the directly-attached IP subnets configured on the device and continues to bridge traffic between devices in the same VLAN. Traffic is routed by the device in layer 3 mode.
This article provides instructions on how to configure VLAN interface IPv4 address on the switch through the Command Line Interface (CLI).
Note: To learn how to configure VLAN on your switch, click here. For instructions on how to configure IPv4 management interfaces on the switch, click here.
If you are unfamiliar with terms in this document, check out Cisco Business: Glossary of New Terms.
- Sx350 Series
- SG350X Series
Configure VLAN Interface IPv4 Address
Important: When the switch is in a stacking mode with a Standby switch present, it is recommended to configure the IP address as a static 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 on the stack.
Configure VLAN Interface IPv4 Address
Step 1. 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.
Note: To learn how to access an SMB switch CLI through SSH or Telnet, click here.
Note: The commands may vary depending on the exact model of your switch. In this example, the SG350X switch is accessed through Telnet.
Step 2. From the Privileged EXEC mode of the switch, enter the Global Configuration mode by entering the following:
Step 3. To enable IP routing on the switch, enter the following:
Note: If you want to configure VLAN mapping on your switch, you must disable this feature.
Step 4. (Optional) To disable IP routing on the switch, enter the following:
SG350X#no ip routing
Step 5. In the Global Configuration mode, enter the Interface Configuration context by entering the following:
- interface-id — Specifies an interface ID on which IP addresses are defined.
Note: In this example, vlan 20 is used.
Step 6. Enter the IP address and the corresponding network mask of the interface:
Note: In this example, the IP address configured is 192.168.100.66 with 255.255.255.224 as subnet mask.
Step 7. Enter the exit command to go back to the Global Configuration context:
Step 8. (Optional) Repeat steps 5 to 7 to configure more interfaces.
Note: In this example, vlan 30 and vlan 40 are configured.
Step 9. Enter the end command to go back to the Privileged EXEC mode:
You should now have successfully configured the VLAN interface IPv4 addresses on your switch through the CLI.
Display VLAN IPv4 Interfaces
Step 1. To display the usability status of configured IP interfaces, enter the following:
SG350X#show ip interface
The IPv4 Interface table contains the following information:
- IP Address — The Unit or interface for which the IP address is defined. This can also be a loopback interface.
- I/F — The name of the specific interface.
- I/F Status: admin/oper — Displays the administrative and operational status of the interface.
- Type — The IP address type. The available options are:
- DHCP — Received from Dynamic Host Configuration Protocol (DHCP) server.
- Static — Entered manually. Static interfaces are non-DHCP interfaces that are created by the user.
- Default — The default address that exists on the device by default, before any configurations have been made.
- Directed Broadcast — The status of the translation of a directed broadcast to physical broadcasts on the interface.
- Prec — The status if source precedence is supported on the interface.
- Redirect — The interface status of sending of Internet Control Message Protocol (ICMP) redirect messages to resend a packet through the same interface on which the packet was received.
- Status — Results of the IP address duplication check.
- Tentative — There is no final result for the IP address duplication check.
- Valid — The IP address collision check was completed, and no IP address collision was detected.
- Valid-Duplicated — The IP address duplication check was completed, and a duplicate IP address was detected.
- Duplicated — A duplicated IP address was detected for the default IP address.
- Delayed — The assignment of the IP address is delayed for 60 seconds if DHCP Client is enabled on startup in order to give time to discover DHCP address.
- Not Received — Relevant only for DHCP Address. When a DCHP Client starts a discovery process, it assigns a dummy IP address 0.0.0.0 before the real address is obtained. This dummy address has the status of Not Received.
Step 2. (Optional) To display the details of a specific interface, enter the following:
SG350X#show ip interface [interface-id]
- interface-id — The interface ID on which IP addresses are defined.
Step 3. (Optional) In the Privileged EXEC mode of the switch, save the configured settings to the startup configuration file, by entering the following:
SG350X#copy running-config startup-config
Step 4. (Optional) Press Y for Yes or N for No on your keyboard once the Overwrite file [startup-config]… prompt appears.
You should now have displayed the IP management interface details on your switch through the CLI.
Access the VLAN Interface IPv4 Address
Step 1. To access the CLI of the configured switch interface, enter the IP address in the client that you are using. In this example, PuTTY is used.
Note: Make sure that your computer is connected on the same VLAN as the switch interface. In this example, 192.168.100.66 is entered.
The CLI of the switch should be accessible.
Step 2. (Optional) To access the web-based utility of the interface, enter the IP address on your web browser.
You should now have successfully accessed the CLI or the web-based utility of the switch using the VLAN interface IPv4 address.
Note: To learn how to configure additional IPv4 routes for routing to non-directly attached subnets through the CLI of the switch, click here.