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.
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.
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:
CBS350X#configureStep 3. To enable IP routing on the switch, enter the following:
CBS350X#ip routingNote: 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:
CBS350X#no ip routingStep 5. In the Global Configuration mode, enter the Interface Configuration context by entering the following:
CBS350X#interface [interface-id]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.
Step 1. To display the usability status of configured IP interfaces, enter the following:
CBS350X#show ip interfaceThe IPv4 Interface table contains the following information:
- 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.
- 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:
CBS350X#show ip interface [interface-id]Step 3. (Optional) In the Privileged EXEC mode of the switch, save the configured settings to the startup configuration file, by entering the following:
CBS350X#copy running-config startup-configStep 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.
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.
Revision | Publish Date | Comments |
---|---|---|
1.0 |
13-Dec-2018 |
Initial Release |