Southern Polytechnic State University

smashlizardsΔίκτυα και Επικοινωνίες

29 Οκτ 2013 (πριν από 3 χρόνια και 9 μήνες)

89 εμφανίσεις

Southern Polytechnic State University

Electrical and Computer Engineering Technology Program
ECET 6302 Laboratory Exercise: OSPF Routing and Layer 3 Switches


Revised 12/08
Objectives:

Students will learn how to configure a Cisco layer 3 switch so that it can perform inter-VLAN routing.
Students will also configure layer 3 switches to connect to a router network and configure the routers
to run the OSPF routing protocol.
Background:

Layer 3 switches were primarily developed to improve inter-VLAN routing performance. The
improvements are realized by performing routing functions in hardware and eliminating the external
link to a router. Layer 3 switches are becoming increasingly complex and with the appropriate
hardware and software options can perform most of the functions of routers, including implementing
different routing protocols.
The layer 3 switches in the lab consist of one Catalyst 3550-48 and four Catalyst 4948 devices. The
3550 has fewer features than the 4948 but can run most of the same routing protocols that the 4948
switches can. Both the 3550-48 and the 4948 software can support RIP, OSPF, EIGRP and IGRP. Both
can support various QoS features, but again, the 4948 is more capable.
Students will work in groups, each responsible for a switch/router combination. You will configure the
switch with two VLANs and set up routing between them. You will then configure one interface as a
layer 3 interface to be used to send traffic to your router and into the router-based backbone. The RIP
routing protocol will be configured on the layer 3 switch. You will configure the router backbone serial
interfaces as well as both RIP and OSPF. The router will use the RIP protocol to determine routes
toward the layer 3 switch and will use OSPF for the backbone serial link network. The RIP routes will
be redistributed to OSPF and the OSPF routes will be redistributed to RIP. Refer to Fig. 1 for the
network topology.
Unless stated otherwise, you will configure your router and switch via telnet. The switch will already
have the IP address for VLAN 1 configured so you can access the switch through the network. Also,
one router Ethernet interface will be configured so that when you configure the switch’s layer 3
interface, it will enable you to connect to the router through the network to configure it.
Since there are two switch models used in the lab exercise appropriate commands will be given for
both if they are different.





G 0/0
G 0/0
G 0/0
Houston
2851 Router
4948 L3 Switch
Atlanta
2851 Router
3550 L3 Switch
Seattle
2851 Router
4948 L3 Switch
Memphis
2851 Router
4948 L3 Switch
Boston
2851 Router
4948 L3 Switch
S 0/0/0
DTE
S 0/0/0
DCE
S 0/0/1
DCE
S 0/0/1
DTE
S 0/0/0
DTE
S 0/0/1
DTE
S 0/1/0
DCE
S 0/0/1
DTE
S 0/0/0
DCE
S 0/0/0
DCE
S 0/0/1
DTE
S 0/1/0
DCE
Host 1
Host 2
Host 1
Host 2 Host 2
Host 1
Host 2
Host 1
G 0/0
G 0/0G 0/0
Host 1
Host 2
Fig. 1. Lab network configuration.
F 0/1
G 1/1
G 1/1
G 1/1


Table 1. Catalyst 4948 and 3550 Layer 3 Switch Addresses.

Location VLAN 1 VLAN 2 G 1/1 or F 0/1 Host 1 Host 2
Boston 192.168.80.1 /24 192.168.81.1 /24 172.16.0.2 /16 192.168.80.2 /24 192.168.81.2 /24
Atlanta 192.168.90.1 /24 192.168.91.1 /24 172.17.0.2 /16 192.168.90.2 /24 192.168.91.2 /24
Memphis 192.168.100.1 /24 192.168.101.1 /24 172.18.0.2 /16 192.168.100.2 /24 192.168.101.2 /24
Houston 192.168.110.1 /24 192.168.111.1 /24 172.19.0.2 /16 192.168.110.2 /24 192.168.111.2 /24
Seattle 192.168.120.1 /24 192.168.121.1 /24 172.20.0.2 /16 192.168.120.2 /24 192.168.121.2 /24

Table 2. 2800 Series Router Addresses.

Location S 0/0/0 S 0/0/1 S 0/1/0 S 0/1/1 G 0/0 G 0/1 Router ID
Boston 10.10.10.2 /24 10.10.12.2 /24 10.10.11.2 /24 172.16.0.1 /16 None 192.168.250.240
Atlanta 10.10.12.1 /24 10.10.15.2 /14 172.17.0.1 /16 None 192.168.250.230
Memphis 10.10.15.1 /24 10.10.13.2 /24 172.18.0.1 /16 None 192.168.250.220
Houston 10.10.11.1 /24 10.10.14.2 /24 172.19.0.1 /16 None 192.168.250.250
Seattle 10.10.14.1 /24 10.10.10.1 /24 10.10.13.1 /24 172.20.0.1 /16 None 192.168.250.210















Host 1 IP Address Host 2 IP Address
Router G 0/0
IP Address
VLAN 1
IP Address
VLAN 2
IP Address
Switch G 1 /1or
F 0/1 Uplink
IP Address
Router S 0/0/0
IP Address
Connected Router:

IP A
ddr
ess
:
Connected Router:
IP A
dd
r
ess
:
Connected Router:

IP A
dd
r
ess
:
Router S 0/0/1
IP Address
Router S 0/1/0
IP Address
Fig. 2. Your LAN and WAN connections.
Complete Only
If You Have A
S 0/1/0
Connection

Revised 12/08
Procedure:

Logistics
1. You will work in teams during this exercise. Your instructor will assign you to a workstation and a
router. Enter the name of your switch/router network below.
Important: Obtain passwords for the switch and router from your instructor.
Network Name:
Network Configuration
2. The routers, switches and workstations are to be connected together as shown in Fig. 1. This may
already be done. If it is, verify the configuration. Complete the steps below as necessary. Ask your
instructor whether or not you should perform any configurations via the console port. Most likely
you will not. Tables 1 and 2 show the IP address scheme for the network.
a) Referring to Fig. 2, fill in the IP addresses associated with your router and switch. In this way,
you will become more familiar with the network organization.
b) Make the physical connections as in Fig. 1 if they are not already made.
Important: Connect Host 1 to one of the switch interfaces numbered 2 – 32. Connect
Host 2 to one of the interfaces numbered 33 – 44. Interfaces 45-48 on the 4948
switches are connected to the uplinks and therefore disabled. Interface 1 is the
router uplink interface and will be configured as a layer 3 interface.
Connecting to the Switch
3. Your instructor will let you know if you are connecting to the switch and router via the console
port or over the network using telnet. If it is telnet, skip step (a).
a) Connecting your workstation to the Cisco switch or router console port as in Fig. 3.
i) Connect the Cisco serial cable to the router console port.
ii) Connect the other end to the Cisco crossover adapter.
iii) Connect the adapter to the workstation serial port, using a 25-pin to 9-pin serial port
adapter if necessary.








b) Connecting your workstation to the Ethernet.
Fig. 3. Console port connection.
Router or Switch
Console
Port
Cisco serial cable
9 to 25 pin Serial
Port Crossover
Adapter


Revised 12/08
i) Telnet access requires that a workstation be connected to the router through the
network. Also, the workstation can be connected to the router Ethernet port directly or
through the lab patch panel and Ethernet switch.
ii) If connecting directly to a router, run a crossover patch cable from the workstation
Ethernet card to the router’s Ethernet port.
iii) If connecting through the Ethernet switch, use normal patch cables to connect your
workstation to the switch and then from the switch to the router’s Ethernet port.
c) Configuring TCP/IP on your workstation.
i) To communicate to your router through the Ethernet, you need to configure TCP/IP on
your workstation.
ii) Boot your workstation to the operating system designated by your instructor.
iii) Set up TCP/IP using the IP address and subnet mask shown in Table 1 for your
workstation. For example, Host 1 for the Boston network will have IP address
192.168.80.2 /24. Since it will be connected to the network through VLAN 1, you
should configure Host 1 with VLAN 1’s IP address as its default gateway, which is
192.168.80.1 /24.
Note: VLAN 1’s address is a switched virtual interface (SVI) that will be routed at
layer 3 inside the switch. Using the VLAN address as the default gateway is not
done when connected to a layer 2 switch with VLANs routed by a router.
Similarly, Host 2 of the Boston network will have IP address 192.168.81.2 /24 and will
use VLAN 2’s address as its default gateway, or 192.168.81.1 /24.
Booting the Switch and Router
4. The switch and router may already be running the correct configuration for this lab, so you may not
need to reboot them. Ask your instructor if you must do so. Otherwise, go to the log on procedure.
Log on to the Switch
5. Perform step 5 if you are using the console port interface.
a) If the terminal emulation program on your computer (i.e. HyperTerminal) has a configuration
called Cisco.ht, double click on it to connect to the Cisco switch.
b) If the configuration does not exist, create one using the setup wizard as follows:
i) Double click the Hyperterm.exe icon.
ii) Type the name Cisco. Click OK.
iii) In the Connect To box, choose the COM port of your computer that you will use. This
is usually COM1.
iv) In the COM1 Properties box, choose the following settings:
Bits per second: 9600
Data bits: 8

Revised 12/08
Parity: None
Stop bits: 1
Flow control: None
v) Click OK.
c) Initiate the session by double-clicking on the Cisco.ht icon.
i) Press Enter when the window pops up.
d) You should see the user mode prompt hostname>, where hostname is the router name.
i) Type enable in all lower case letters and press Enter.
ii) The router will respond with the Password: prompt. Enter the password given by your
instructor and press Enter.
Note: if you do not enter the password within a given time a time out may occur.
Press enter once and wait for the prompt to reappear.
e) The switch will respond with the privileged EXEC prompt hostname#. You are now
successfully logged in to the switch and ready to configure it.
6. Perform the following steps if you are using Telnet.
a) Open a Command window.
b) Establish a session by typing “telnet address”, where address is the IP address of the gateway
to the router.
i) The telnet window appears and you will see Password:.
Note: you may see a Username: prompt first.
ii) Enter the virtual terminal username and password designated by your instructor.
iii) The router will respond with the user-mode prompt like hostname>.
c) Enter enable at the prompt. The router will respond with the Password: prompt. Enter the
enable password given by your instructor.
Note: if you do not enter the password in a given time a time out may occur. Press enter
once and wait for the prompt to reappear.
d) The router will respond with the hostname# (or similar) prompt. You are now successfully
logged in to the switch and are ready to configure it.
Checking the Switch Configuration
7. You will check several switch configuration parameters.
a) In privileged EXEC mode, type show running-config or just show run. Determine the
following configuration parameters.
VLAN 1 address (should match Table 1)
b) In privileged EXEC mode, type show vlan. Determine the following configuration parameter.

Revised 12/08
Number of VLANs on the switch:
Configure VLAN2
8. The routing table shows all of the networks that your router can reach either directly or indirectly
and the next-hop address needed to reach that network.
a) At the hostname# prompt, type config t to enter the global configuration mode.
b) At the hostname(config)# prompt, type vlan 2.
c) At the hostname(config)# prompt, type interface range g 1/33 – 48 for the 4948 or type
interface range f 0/33 – 48 for the 3550. This will allow you to perform commands on these
16 interfaces at the same time.
Note: the spaces before and after the “-“ in this command are required for the 3550 but not
the 4948.
d) Next type switchport mode access. The default Layer 2 switching mode for the 4948
interfaces is switchport mode dynamic auto and the default mode for the 3550 is swictchport
mode dynamic desirable. The switchport mode may not appear in the configuration file from
the show run command.
e) Enter switchport access vlan 2.
f) Enter end to return to privileged EXEC mode.
g) Enter show run and show vlan to verify the VLAN membership of the interfaces.
h) At this time, verify that your Host 1 is connected to an interface in VLAN 1 and Host 2 is
connected to a VLAN 2 interface.
Configure Logical Layer 3 Interface for VLAN 2
9. The switch VLAN 1 virtual interface should already have the correct IP address assigned. Now the
VLAN 2 address will be configured.
a) At the hostname# prompt, type config t to enter the global configuration mode.
b) At the hostname(config)# prompt, type interface vlan 2.
c) At the hostname(config-if)# prompt enter ip address ip_address subnet_mask where the ip
address and subnet mask are obtained from Table 2 for VLAN 2 for your network.
d) Enter no shutdown.
e) Enter end to return to privileged EXEC mode.
Configure and Test Routing Between VLANs
10. Since your two VLANs appear as directly connected virtual interfaces, the layer 3 routing
functions of the switch will route traffic between them.
a) At the hostname# prompt, type config t to enter the global configuration mode.
b) At the hostname(config)# prompt, type ip routing. This ensures that routing is enabled.

Revised 12/08
c) From Host 1 on VLAN 1 ping Host 2 on VLAN 2. This should be successful.
d) Return to the hostname# and type show ip route to see the directly connected VLANs in the
routing table.
e) Have your instructor verify your results.
Configure The Uplink Interface to the Router
11. You will reconfigure the first interface (g 1/1 or f 0/1) to be a layer 3 interface and then set up the
RIP version 2 routing protocol. This protocol may already be running on the router.
a) At the hostname# prompt, type config t to enter the global configuration mode.
b) At the hostname(config)# prompt, type interface g 1/1 (or interface f 0/1 for the 3550).
c) At the hostname(config-if)# prompt, type no switchport.
d) Enter ip address ip_address subnet_mask where the ip_address and subnet_mask are
obtained from Table 2 for g 1/1 or f 0/1 for your network.
e) Enter no shutdown.
f) Enter end to return to privileged EXEC mode.
g) At the hostname# prompt, type config t to enter the global configuration mode.
h) Enter router rip.
i) Enter version 2.
Note: if there is a RIP version mismatch between the switches and routers, the routing
tables will not be correct.
j) Enter network network_address where network_address is the address of one of the switch’s
directly connected networks. Repeat the network command for the other directly connected
networks. For example, the Boston switch has the networks 192.168.80.0, 192.168.81.0, and
172.16.0.0 directly connected.
k) At the hostname# prompt, enter show run to verify your configuration.
l) Enter show ip route to see the routing table. You should see the 10.0.0.0 networks connected
to the router if they are configured.
Log on to the Router
12. Now that the switch is configured, telnet to the router. Telnet to the router’s 172.XX.0.1 interface
as determined by Table 2 for your router.
Note: you may have to telnet from the switch to the router instead of from your workstation and
configure the router from a telnet session on the switch. If you have to do this, the problem should
go away once you set up RIP in step 13.
Configure RIP on the Router
13. RIP will be used to handle routes into and out of the layer 3 switch. The router redistribute
command will ensure that the routes obtained from OSPF will be forwarded to RIP. Since RIP and

Revised 12/08
OSPF use different metrics, the OSPF route metric will be converted to RIP hop count using the
default-metric command, which will be set to 8.
a) At the hostname# prompt, enter config t to enter the global configuration mode.
b) At the hostname(config)# prompt, enter router rip.
c) At the hostname(config-router)# prompt, enter network 172.XX.0.0 where XX is the
appropriate number for your network from Table 2.
d) At the hostname(config-router)# prompt, enter version 2.
Note: the RIP version for all of the routers and switches must be the same or routing tables
will be incorrect.
e) At the hostname(config-router)# prompt, enter redistribute ospf 1000 match internal
external 1 external 2.
f) At the hostname(config-router)# prompt, enter default-metric 8. The hop count from the
layer 3 switch across the OSPF network will be set to 8. The network administrator should set
this to a realistic number.
Configure the Router’s Serial Interfaces
14. Configure the serial interfaces.
a) Configure the IP addresses of the serial interfaces based on Table 2.
b) Be sure to enter the encapsulation ppp command for each interface and set the clock rate for
the DCE interfaces to 2 Mbps.
c) Test connectivity between routers with ping.
Configure OSPF on the Router
15. OSPF is considerably more complicated than RIP. Cost metrics are usually assigned by the
administrator, overriding default values, and usually related to link bandwidth. Default values are
assigned to well known link types. The cost is calculated as 1×10
8
bps (the default reference)
divided by the line bandwidth in bps. The default cost for 10 Mbps Ethernet is 10; the cost for a
serial link or T1 line is 64. The smallest cost possible is 1, so based on the 1×10
8
reference, both
fast Ethernet and gigabit Ethernet interfaces have a cost of 1.
Important: The serial interface clock rate has no influence on the OSPF cost calculation. If you
want the cost to accurately reflect your interface bandwidth, use the bandwidth command in
interface config mode. This is done below. Also, you can directly specify the cost using the ip ospf
cost command in interface command mode.
You are going to change the OSPF metric in two ways. First, you will raise the default reference
from 1×10
8
bps to 10×10
8
bps so that gigabit Ethernet costs will be 1 and fast Ethernet costs will be
10. This also means that the default serial link cost is 640. You will set your link costs using the
bandwidth command and setting the bandwidth equal to your clock rate. The bandwidth will be
specified on DTE and DCE interfaces.
Important: Specifying the bandwidth does not change the clock rate, nor does it interfere with
the DTE and DCE interface designation.

Revised 12/08
The OSPF router redistribute command will take networks from RIP and assign a cost of 20 to
them. This is the default value and an artificial number that is not easily related to the actual OSPF
route costs. An administrator may want to change the redistributed RIP route costs to be more
realistic. Route redistribution from one routing protocol to another can be problematic, particularly
if loops exist.
Aside: For the lab network, it is a better idea to either set up default routes to and from your router
and switch or to run OSPF on the switch, with the switch network router acting as a stub network.
The point here is for you to see how route redistribution works.
a) At the hostname# prompt, enter config t to enter the global configuration mode.
b) At the hostname(config)# prompt, enter router ospf 1000. The “1000” is a process id. More
than one instance of OSPF can run on a router due since OSPF networks can be partitioned in
to areas, so different process ids are required for each.
c) At the hostname(config-router)# prompt, enter network 10.0.0.0 0.255.255.255 area 0. The
0.255.255.255 is a mask where the zero bits indicate the desired bits. Area 0 identifies the
backbone area. In multiple area OSPF networks, there must be an area 0 backbone.
d) At the hostname(config-router)# prompt, enter router-id id_address. The id_address is
found in Table 2 for your router. OSPF uses a router address as its id when sending link state
advertisements (LSAs) and will select the highest active address on the router unless it is
specified directly. Here you specify it directly.
e) At the hostname(config-router)# prompt, enter redistribute rip subnets. This will instruct
OSPF to map RIP routes to OSPF and to forward RIP routes to the layer 3 switches.
f) At the hostname(config-router)# prompt, enter auto-cost reference-bandwidth 1000. This
command sets the reference bandwidth used for OSPF cost calculations to 1000 Mbps.
g) Enter the interface configuration mode for serial interface s 0/0/0. At the hostname(config-if)#
prompt, enter bandwidth 2000. This command sets the bandwidth of the link to 2000 kbps, or
2 Mbps. Repeat this for all of your active serial interfaces, both DTE and DCE. Now calculate
the cost that OSPF will calculate:
Serial link cost:
Check Configurations and Routing Tables
16. a) Examine the running configurations of the layer 3 switch and router and make sure they are
correct.
b) Examine the routing tables on both your router and your layer 3 switch and save a copy of
each.
Note: the link cost for OSPF routes is the total cost, so two hops through a T1 line would
have a cost of 1280 for a cost reference bandwidth of 1000 Mbps.
• Did you see all of the networks in each routing table? If you did not see one, determine
why.
• Did you see the default metrics assigned for RIP route redistribution and OSPF route
redistribution? One type will appear on the switch routing table and the other on the router
routing table.

Revised 12/08
• Did you see “E2” next to the routes redistributed from RIP to OSPF? These are type 2
routes to networks external to the OSPF network. The cost metrics never change no matter
where these networks are relative to the router you are looking at.
• Be sure to look at question 2 in the Questions section.
c) At the hostname# prompt, enter show ip ospf interface to display the OSPF interface
information.
• What costs do you see for each interface?
(Optional) Adjust OSPF Cost
17. Your instructor may ask you to adjust one or more serial link cost and then examine the effects on
the routing tables. The command to use while in interface config mode is ip ospf cost number,
where number is an integer from 1 to 65535.
Exiting out of the Switches and Routers
18. Log out of the switches and routers.
Questions:

1. Static routes could be used between the switch and its directly-connected router instead of
configuring RIP. For example, the router would have two static routes, one to each of the
192.168.XX.0 networks through the 172.XX.0.2 address on the switch. The switch would have a
default route to reach all networks not on the switch going through the router’s 172.XX.0.1
address. What would be an advantage of using static routes instead of running RIP?
2. Did you see an example of route summarization in the layer 3 switch routing table? What is the
advantage of route summarization? Hint: you should look up the definition of this term on the
Cisco web site.
Conclusions:

Bring together the concepts illustrated in the lab and make conclusions as to what they mean, and what
you learned.
References:

C. Paquet, D. Teare, Building Scalable Cisco Networks, Indianapolis, IN, Cisco Press, 2001.
R. Froom, B. Sivasubramanian, E Frahim, Authorized Self-Study Guide: Building Cisco Multilayer
Switched Networks (BCMSN), Indianapolis, IN, Cisco Press, 2007
From Cisco Web site, the following PDFs are available:
Cisco Systems, Cisco IOS IP Routing Protocols Command Reference, San Jose, CA, July 2008. This is
for IOS version 12.4.
Cisco Systems, Cisco IOS IP Routing Protocols Configuration Guide – Release 12.4, San Jose, CA,
2008. This is for IOS version 12.4.
Cisco Systems, Catalyst4500 Series Switch Cisco IOS Software Configuration Guide – Release
12.2(46)SG, San Jose, CA, 2008. This is for IOS version 12.2.

Revised 12/08
Cisco Systems, Catalyst 3550 Multilayer Switch Software Configuration Guide - Release 12.1(19)EA1,
San Jose, CA, October 2003.