Switch IP 1

By certskills November 19, 2015 12:05

A layer 2 switch does not need an IP address or default gateway for its primary purpose of forwarding layer 2 Ethernet frames. However, the switch does need an IP address and a default gateway for layer 3 communication, such as responding to ping requests and allowing SSH and Telnet connections into the switch. In this lab, you will practice configuring a switch to support IP.


Your job: configure support for IPv4 on a Cisco Catalyst layer 2 switch. To do so, enable IPv4 support on the (default) VLAN 1, and configure the switch so that it can communicate with hosts outside its local subnet.

The specific rules for this lab are as follows:

  1. Assign the switch an IP address of and a mask of
  2. For the default gateway use IP address of
  3. For the management VLAN use VLAN 1

Figure 1: Basic LAN


Initial Configuration

The initial configuration uses almost all default settings. Note that by default, all ports are assigned to access VLAN 1. The configuration that does already exist sets the hostname and the passwords for the switch.

Example 1: SW1 Config


It’s Now Time for Your Answer

Next, write your answer on paper. Or if you have some real gear, or other tools, configure the lab with those tools.

Testing this lab (if you go to the effort to configure in an environment where you can test) can be done with ping and Telnet. Use a host in another subnet, like PC2 in the figure. Using a host in a different subnet tests both the switch IP address and the default gateway setting.


Do this Lab with Cisco’s VIRL

You can do these labs on paper and still get a lot out of the lab. As an extra help, we have added files for the Virtual Internet Routing Lab (VIRL) software as well. The .VIRL file found here is a file that when used with VIRL will load a lab topology similar to this lab’s topology, with the initial configuration shown in the lab as well. This section lists any differences between the lab exercise and the .VIRL file’s topology and configuration.

Download this lab’s VIRL file!

For this .VIRL file, because .VIRL does not currently support serial links, and this lab shows a serial link, the .VIRL file replaces the serial link with an Ethernet link. It uses subnet, with R2’s G0/2 interface using address, and R2’s G0/2 interface using

Network Device Info:

This table lists the interfaces changed in this lab to work well in VIRL.

Device Lab Port VIRL Port
SW1 F0/1 G0/2
SW2 F0/1 G0/2
R1 S0/0/1 G0/2
R2 S0/0/1 G0/2

Host device info:

This table lists host information pre-configured in VIRL, information that might not be required by the lab but may be useful to you.

Device IP Address Mac Address User/password
PC1 02:00:11:11:11:11 cisco/cisco
PC2 02:00:22:22:22:22 cisco/cisco


Handy Host Commands:

To see PC IP address: ifconfig eth1

Ping example: ping -c 4

Trace example: tracepath

To connect to another node within the topology: telnet



Answers: IPv6 Addressing with OSPFv3
Answers: Switch IP 1
By certskills November 19, 2015 12:05
Write a comment

No Comments

No Comments Yet!

Let me tell You a sad story ! There are no comments yet, but You can be first one to comment this article.

Write a comment
View comments

Write a comment

Comment; Identify w/ Social Media or Email


Subscribe to our mailing list and get interesting stuff and updates to your email inbox.

Thank you for subscribing.

Something went wrong.