Set VLAN 1 IP Address
The objective is to assign an IP address to the device on VLAN 1. This is often sufficient for small local area networks that use Dynamic Host Configuration Protocol (DHCP) or static IP address allocation. The system implements a DHCP client that, once enabled, will send out requests for IP address configuration. Those requests are received by a DHCP server on the network (if present and appropriately configured). The server will then search through its pool of available IP addresses, allocate one, and return it to the DHCP client. The returned information typically includes IP address, netmask, and default gateway, but may also contain other information such as Domain Name Service (DNS) server addresses. The configuration proceeds in the same manner as setting the hostname: Enter configuration mode, input and execute configuration commands, leave configuration mode. The following commands instruct the device to use DHCP to obtain an IP address, or, if DHCP fails, to use a static fallback address. Inclusion of a fallback IP is optional and may be omitted.
Notice how the prompt changes; the interface vlan 1 command enters a configuration sub-mode that allows, among other things, configuration of IP address. Also note that IP addresses can only be assigned to VLAN interfaces. After configuration is complete, the resulting IP address can be inspected. As seen below, the DHCP negotiation succeeded and the device obtained an address:
show ip interface brief displays all configured and active IP interfaces. The status should be UP. If it isn’t, then the reason could be that there is no link on any port. If DHCP negotiation failed then the fallback IP of 172.16.1.2/255.255.0.0 would be assigned. Now the most basic system configuration is complete. Management connectivity can be verified by issuing a ping command to a well-known external IP address:
If the ping is successful, network logins can now be performed through telnet or ssh to the address on VLAN interface 1, 172.16.1.17 (or 172.16.1.2).
Last updated