Switch IP 1

certskills
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.

Requirements

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 10.1.1.20 and a mask of 255.255.255.0.
  2. For the default gateway use IP address of 10.1.1.1.
  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 CML (Formerly 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 Cisco Modeling Lab – Personal (CML-P). CML-P replaces Cisco Virtual Internet Routing Lab (VIRL) software, in effect serving as VIRL Version 2.

Below, find two files: a file useful with CML-P and another useful with VIRL. (Note that the CML-P file has a .yaml filetype, while the older VIRL file has a VIRL filetype.) Once the file is loaded, CML-P or VIRL will create a lab topology similar to this lab’s topology, with the initial configuration shown in the lab as well.

This lab’s CML file!

This lab’s VIRL file!

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

Network Device Info:

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

Device Lab Port CML/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 10.1.1.2 02:00:11:11:11:11 cisco/cisco
PC2 10.2.2.2 02:00:22:22:22:22 cisco/cisco

 

Handy Host Commands:

To see PC IP address: ifconfig eth1

Ping example: ping -c 4 10.1.1.1

Trace example: tracepath 10.1.1.1

To connect to another node within the topology: telnet 10.1.1.1

 

 

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

4 Comments

  1. Gabriel October 3, 17:33

    Hi, I have a question regardin this topic. In a Test Exam I received the following question:
    – Within a production network, what is the purpose of configuring a switch with a default gateway address?
    My answer was: “A switch must have a default gateway to be accessible by Telnet and SSH” but I got an wrong answer.
    The good one was:
    “The default gateway address is used to forward packets originating from the switch to remote networks.”
    So, my question is what kind of packet can be originated from the switch? I thought that packet are originated from end-devices but not switches. How can I generate a packet into a switch to be send to a remote network?.
    Thanks in advance for your anwers.
    Regards,
    Gabriel.

    Reply to this comment
  2. Gabriel October 3, 17:51

    Hi, I have a question regarding this topic.
    In a Test Exam ITN I go the following question:
    6 Within a production network, what is the purpose of configuring a switch with a default gateway address?
    My answer was “A switch must have a default gateway to be accessible by Telnet and SSH.”, but it was wrong.
    The good one was: “The default gateway address is used to forward packets originating from the switch to remote networks.”
    So, I wonder how switches themselves can originate packets to be send to another network.?
    Thanks in advance for your reply.
    Regards,
    Gabriel.

    Reply to this comment
  3. certskills Author October 5, 15:22

    Hi Gabriel,
    Guessing, literally, the answer you chose is not true. EG, PC on the same subnet as the switch management IP address – the switch does not need a default gateway. The suggested correct answer gets are the core of the function of the default gateway, which is to allow communication to other subnets (aka remote networks.) But honestly, given that it’s content you saw from some other source, maybe ask them directly.
    Regards,
    Wendell

    Reply to this comment
    • Gabriel October 5, 16:32

      Hi Wendell,
      Sorry I made a mistake posting twice the question.. I thought the first time it wasn’t saved it. 😉
      But what you said now has made all my mind clear.! thank you!.
      This question cames from CISCO NetAcad by the way..
      Yesterday was surfing your blog I came just to here and then I thought maybe Wendell can help me why my answer was not right?.
      And yes! very proffesional answer. Even I tryed what you said in Packet Tracer and no doubt now (same subnet, not default gateway needed) completely true.
      Again thank you.
      Have a good day.
      Gabriel.

      Reply to this comment
View comments

Write a comment

Comment; Identify w/ Social Media or Email

Subscribe

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

Thank you for subscribing.

Something went wrong.

Search

Categories