Configure an IP address on a switch

By default, Cisco changes Ethernet frames without any configuration. This means that you can buy a Cisco adapter, connect the correct cables to connect multiple devices to the adapter, turn it on and turn on the adapter correctly.

However, to perform network switching or to use protocols such as SNMP, the adapter must have an IP address. The IP address is configured under a logical interface, known as a management domain or a VLAN. Typically, the default VLAN 1 acts as the adapter's NIC to connect to a LAN to send IP packets. These are the steps to configure an IP address in VLAN 1:

Enter the VLAN configuration mode 1 with the global configuration interface vlan 1.
Set the IP address with the Subnet_MASK IP_ADDRESS sub-command.
Enable the VLAN 1 interface with the subcommand command without the shutdown interface.
(Optional) Use the IP-gateway IP_ADDRESS general configuration command to configure the default gateway.

(Optional) Add IP -ADDRESS to the General Configuration Command IP command to configure the DNS server.

Here's a simple example grid:

We have a simple network of a host and a switch. We can assign an IP address to the switch to enable IP communication between the two devices:

SW1 (config) #int vlan 1
SW1 (config-if) #
SW1 (config-if) #
SW1 (config-if) # IP address
SW1 (config-if) # did not shut down

SW1 (config-if) #
% LINK-5-CHANGED: Vlan1 interface, status change up

% LINEPROTO-5-UPDOWN: Line protocol in the VLAN1 interface, status change to top
To check the IP address configured on a switch, you can use the show int vlan 1 command:

SW1 # show int vlan 1

Vlan1 is active, the line protocol is active.

The hardware is the interface of the CPU, the address is 0030.a3e8.6b3c (bia 0030.a3e8.6b3c)
The Internet address is
We can verify that the host can reach the switch through its IP address by pinging from host A:

C: \> ping

Ping with 32 bytes of data:

Response from Bytes = 32 Time <1 ms TTL = 255
Response from Bytes = 32 Time <1 ms TTL = 255
Post a Comment (0)
Previous Post Next Post