[go: up one dir, main page]

0% found this document useful (0 votes)
29 views21 pages

09 SwitchConfig

The document discusses switch configuration including virtual LANs, configuring switches, and spanning tree protocol. Virtual LANs logically separate devices into broadcast domains. Configuring switches involves creating VLAN interfaces and associating ports with VLANs. Spanning tree protocol prevents switching loops by disabling redundant paths while ensuring connectivity.

Uploaded by

d.vargas
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views21 pages

09 SwitchConfig

The document discusses switch configuration including virtual LANs, configuring switches, and spanning tree protocol. Virtual LANs logically separate devices into broadcast domains. Configuring switches involves creating VLAN interfaces and associating ports with VLANs. Spanning tree protocol prevents switching loops by disabling redundant paths while ensuring connectivity.

Uploaded by

d.vargas
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 21

Switch Configuration

• Virtual LANs
• Configuring Switches
• Spanning-Tree Protocol
• Network Management (see textbook)
• Power over Ethernet (see textbook)
Virtual LANs
• Recall our discussion of physical versus logical entities:
o "Physical" tends to indicate the actual or literal entity
o "Logical" refers to something more abstract. It can...
 Stand in for
 Emulate
 Serve as a proxy for
o ...its
physical counterpart. In the case of emulating, we might
call such a thing virtual.
Virtual LANs
• A virtual LAN (VLAN) is a group of networked hosts (e.g.,
servers and computers) that are
o Configured as if they were on a LAN ...
o ...even though they may be separated by routers, in actuality.
• This is useful because the network administrator can
group the hosts based on factors other than physical
location, such as the department within an organization.
• There are three main types of VLANs...
Virtual LANs
• Port-based :
o Here,a specific VLAN is associated with a particular set of
ports on a switch.
o For
example, if a single switch were to have 16 ports, you
might have...
 VLAN 1: Ports 1-4
 VLAN 2: Ports 5-10
 VLAN 3: Ports 11-13
o Whileswitches normally form a single broadcast domain,
these VLANs would in fact belong to separate domains.
Virtual LANs
• Tagged-based :
o This
uses Ethernet frames, along with the IEEE 802.1Q
standard
o Here, the Ethernet frame will include a VLAN id
o Thisway, you could actually have more than one VLAN on a
switch port
• Protocol-based :
o Data traffic connects on different ports based on protocol
o Separates data traffic for different networks
Virtual LANs
• Assignment of VLAN membership can be of two types:
o Static assignment : Port-based. Membership happens
at time of port assignment to a VLAN.
o Dynamic assignment :
 Port assignment is based on other factors, like MAC address or
username.
 This way, location can change, while maintaining VLAN
membership.
Configuring Switches
• With regards to using a switch in GNS3, much will be similar.
• Many of the modes and commands you used to interact
with your Cisco router will also apply to your Cisco switch --
though there will also be some differences because the
switch is a different type of device.
• Most notably, you will be configuring a VLAN, which will
have an IP address.
o On a router, the IP address exists so that it can serve as a gateway
for the LAN
Configuring Switches
o On a switch, the VLAN IP address is so that the switch can communicate
with other VLAN devices.
 This is useful if you need to remotely connect to the switch to manage it.
 The switch is still functioning at Layer 2. It is not performing any routing.
• Some command examples will follow, with two caveats:
o What we are describing here is in the context of GNS3 and our labs in this
class. However, much will still be relevant in real-life situations dealing with
physical networks and hardware.
o In GNS3, we are not using a proper managed switch. Instead, we are using
an EtherSwitch router that is configured to behave like one.
o As such, some of the commands that you use will be different than what is
presented in the textbook.
Configuring Switches
• In configuration mode, "VLAN" is like a type of interface
that you can configure.
ESW1(config)#interface VLAN 1
• In interface configuration mode, you will use similar
commands as you used on a router
ESW1(config-if)#ip address 192.168.2x.10 255.255.255.0
ESW1(config-if)#no shutdown
• Your switch will also need a default gateway, which will be
your router's local NIC:
ESW1(config)#ip default-gateway 192.168.2x.1
Configuring Switches
• Finally, you will also be able to view configuration
information for VLAN 1:
ESW1#show interface VLAN 1
• In Homework #10, you will start by configuring the first
VLAN, which will be the default for administrative purposes.
• At first, all Ethernet ports will be associated with that one.
You can verify this by running the command show vlan
(On your EtherSwitch router in GNS3: show vlan-switch)
• Moving forward, you can establish other VLANs.
Configuring Switches
• On your EtherSwitch router in GNS3...
o you would enter the correct mode with the command vlan
database, which gives you the prompt ESW1(vlan)#
o There, you can create new VLANs, specified by number and name:
vlan [number] name [VLAN's name]. For example:
vlan 2 name Sales

vlan 3 name Engineering

o (Contrast this to the textbook example.)


• You can associate different Ethernet ports with one VLAN or
another...
Configuring Switches
• To do this:
o Enter configuration mode.
o Enter interface configuration mode, for the port in
question.
o Enter the command switchport mode access
o Enter the command
o switchport access vlan [number]
o The end command
Configuring Switches
• Example:
ESW1#configure terminal
ESW1(config)#int fa 1/1
ESW1(config-if)#switchport mode access
ESW1(config-if)#switch port
port access
access vlan
vlan 33
ESW1(config-if)#end
• You can run show vlan (On your EtherSwitch router in
GNS3: show vlan-switch) in order to see the updated
state of Ethernet ports with respect to VLANs.
Spanning-Tree Protocol
• In many cases, it is good to have some level of redundancy
in your network setup. For example...
o A host device may have both an Ethernet card and a wireless
card, enabling it to gain network access in a wider variety of
environments.
o A wireless access point might function on both the 2.4 GHz and 5
GHz bands, allowing more connection options.
o If there are multiple Layer 3 routes between two endpoints, then
one route can be used in the event that the default route fails.
Spanning-Tree Protocol
• As such, you might have Layer 2 redundancy in a LAN.
o That is, there might be more than one Layer 2 path between two
devices, on account of multiple switches being interconnected. We
might say that the switches themselves are in a "mesh" topology.
o On one hand, this can be beneficial for maintaining network
connectivity, in the event that one switch fails.
o On the other hand, if not properly managed, you can end up with a
switching loop.
o Example: https://www.youtube.com/watch?v=P04gaoq53FU (0:10 - 3:10)
Spanning-Tree Protocol
• A switching loop occurs when a data packet, that has
passed out of a switch, ends up passing back into it.
o This can happen in scenarios where the switch does not have one
unique destination for a packet -- such as broadcasting or flooding.
o It begins when the switch receives a data packet on a port....
o For whatever reason -- such as a broadcast packet or an unknown
destination MAC address -- the switch forwards (i.e., floods) the packet
to all ports (except for the entry port).
o Other switches, on receiving the packet, do the same.
o Because of path redundancy, the packet ends up coming back.
Spanning-Tree Protocol
• Two main types of problems can arise:
1. Broadcast storms :
 A broadcast packet is addressed to ff:ff:ff:ff:ff:ff
 If a switch receives one, then it transmits that packet to
every other port currently in use.
 In other words, one packet in = Multiple packets out!
 If one of those packets happens to arrive again, then it is
once again broadcast out
 This exponential proliferation of packets can quickly
overtake the network's capacity
Spanning-Tree Protocol
2. MAC flapping :
o When a host sends a packet into a switch, the source MAC is
examined to establish an association (between the host and
the port) in the switching table.
o Ifthe switch does not have the destination MAC in its table,
then it floods to all other ports, except the source port.
o Ifthe same packet enters another port -- on the same switch
-- via a loop, then the source MAC can become associated
with that other port.
o This creates instability in the Layer 2 links.
Spanning-Tree Protocol
• On managed switches, we can use Spanning Tree
Protocol (STP) to prevent loops and keep data flowing
along the right paths.
• To understand the notion of a "spanning tree", consider a
collection of interconnected nodes.
o Between any two nodes, there are multiple paths.
o You can eliminate (or "disable") some of those connections, such
that, between any two nodes, there is only one possible path
because redundant paths have been removed.
o If you make one node the "root", then you can think of it as a tree
Spanning-Tree Protocol
• When you have multiple switches with redundant paths, the
purpose of STP is to prevent looping by:
o Making one of those switches the root
o For any other switch, allowing only one port to lead to the root

• Switches accomplish this by exchanging Bridge Protocol


Data Units (BPDUs) in order to:
o Choose a root switch
o For other switches:
 Determine the shortest path to root
 Choose the switch port providing that best path
 Decide which switch ports participate in STP
Spanning-Tree Protocol
• In addition, there are also packets for communicating
topology changes and acknowledging those notifications.
• There are five STP states:
o Blocking : Not sending data but still keeping track of BPDUs
o Listening : Processing BPDUs
o Learning : Using packets to learn MAC addresses
o Forwarding : Switch is currently sending and receiving
o Disabled : Not actually part of STP, but the network administrator
can choose to disable a port

You might also like