Title: Computer Networks
1Computer Networks
- Project 5
- Router and Switch Configuration
2TABLE OF CONTENTS
- Project Overview
- Report Format
- Before You Get Started
- Know Your Hardware
- What you will Configure
- Configuring a Router
- Configuring a Switch
- Configuring a Host
- So, does it work?
- Running ping
- Running traceroute
-
With special thanks to Mike Cole for his help
with configuration and knowledge transfer. He
showed me how to make this work!
3Project Overview
- The purpose of this Project is to become learn
how to set a router and a switch in order to
produce a network configuration of your choosing. - You will do this by using a commercial router- a
Cisco Catalyst 5500, a commercial switch a
Cisco Catalyst 2900, and the various hosts in the
Network lab. - When you are finished, you will have a network
made up of various subnets and will be able to
communicate between the various hosts that are
located on different subnets. - You can work on this either singly or in pairs.
- Have fun.
Report Format
As in the last Project, there is no formal report
that needs to be produced. However, you will be
asked questions about this Project on the final
exam. It would be wise to be prepared.
4Before You Get Started
- So whats the bigger picture here? To give you
some idea of the scope of routers, please answer
the following questions before you get to the
lab. If you do so, this will all make a lot more
sense to you. - Whats the difference between a router, a switch,
and a hub? - Cisco is one manufacturer of core routers. Who
else makes routers? This does NOT mean home
modem routers. - What operating system is run on the Cisco
routers? - Having learned the operating system, look up the
following information - Name the routine protocols supported by the OS.
- Briefly describe how to use the on-line help
feature of the OS user interface. - You may find this site useful
- http//www.cisco.com/univercd/cc/td/doc/product/so
ftware/ios11/cbook/cip.htm - d) How do you configure a node?? Read about
ifconfig and you too will be an expert. What is
a Class A, B and C address?
5Environment and Tools
Getting Around You can log into any of the
machines Net2 Net5 via terminal/monitor.
Warning, Net2 is very slow and will be used only
indirectly in this lab. You can ssh between any
of the machines net1 net5 by using their IP
address we arent running a nameserver so you
will not be able to do something like ping
Net2. Saving data between the Networks Lab and
the rest of the world During the course of doing
these various measurements, youll be collecting
a lot of data. This data will be output from
Ethereal, various other outputs, and so on. But
theres no printing or saving facilities in the
lab. So you would really like to get the data
back to your home directory in the regular CS lab
to get your file back to spears. From any of
the machines, you can ssh to tarski (also called
Net1), the machine that sees the world. ssh b
192.168.1.1 l Being able
to ssh in this fashion may or may not be useful
to you. What IS useful is being able to copy
files between nodes. Suppose Im on net2 and I
want to transfer the file CollectedWisdom to my
home directory on Spears. I do that with the
command scp which you can look up. Heres an
example of its use scp CollectedWisdom
jbreecher_at_192.168.1.1CollectedWisdom This will
deposit the file Collected Wisdom in my home
directory.
6Know Your Hardware
Connection to switch goes in output 1 of row 3.
VLans/Subnets are configured on the left-most 5
connectors.
Cisco Catalyst 2900 Switch
Power cord to wall this is how you turn it off!!
Connection from router goes in right-most input,
port 24.
Serial connector goes directly to serial port on
Net4
Our router is a bit different from the picture
Slot 1 Controls a switch internal to the
router Slot 2 Controls router Slot 3 10/100
RJ45 ports connect to the internal switch Slot 4
Fibre ports not used in this lab
Cisco Catalyst 5500 Router
Power switch this is how you turn the router
off and on!!
The router is highly available. In this case it
means that you can pull the card in slot 4 and
the router will keep on ticking. Its
hot-pluggable.
7Configuration Chart
Router VLan1 VLan2
VLan3 VLan4 VLan5
Dont mess 192.X.B.1 155.X.C.1
150.X.D.1 13.X.37.1
With this 255.255.255.0 255.255.255.0
255.255.254.0 255.255.0.0 192.168.1.2
The meaning of the letters in the IP addresses is
given in the next slide.
Connection To World 140.232.101.139
Red Wire
Switch 192.168.1.3 Vlan 1 Vlan 2
VLan 3 Vlan 4
VLan 5 Port 1 Port 2
Port 3 Port 4
Port 5
Tarski
192.168.1.1 255.255.255.0
155.X.C.5 255.255.255.0
13.X,55.5 255.255.0.0
150.X.D1,5 255.255.255.0
NET1 This machine has two NICs
NET4
NET5
NET2
NET3
All nodes have username / password root /
NetLab Note that by running root you have
complete control over the machine.
8What You Will Configure
The goal is to have a different configuration for
each of you. So that if someone leaves the
router and switch in THEIR configuration, youll
get to start from scratch. If youre working in
pairs, what you should do is obvious.
Breecher 37
123 111 120
9Procedure
- Turn off the power to the router and the switch.
The router has a knob to turn the switch you
turn off by pulling the plug. - Pull off the 5 cables between the switch and the
nodes youre going to be reattaching them in a
way different from the people who came before you
anyway. - Hook up the serial connector of Net4 to the
router via the serial cable there are two
serial connections on the back of Net4 use the
top one. - Hook up the red wire between the router and the
switch. - Turn on the power to the router and the switch.
It can take several minutes for the router to
boot. - Get minicom working on Net4 see Appendix A for
this later directions for configuration assume
that this is working correctly. - Configure the router using the methods described
below. - Configure the switch using the methods described
below. - Configure the nodes using the methods described
below. - Run the various tests showing the nodes connect
to each other. - Take apart all the wires. This means the serial
cable, the red wire, and unhook all the Netx
wires from the switch.
10Configuring A Router
WHAT ARE YOU DOING?? The purpose here is to
configure a set of IP addresses that have access
to the back plane of the router. If you have
that access, then you can communicate with the
other IP addresses on this backplane and can get
to any of the hosts associated with their subnets.
Im going to use in this example the addresses I
assigned myself
A VLan is the same as a subnet. Think of each
VLan as a door weve configured here the
addresses that can go out on each of the VLans.
You KNOW the router is fully powered up when the
large light on the left side of slot 2 is green
Router Backplane
VLan1 192.168.1.2 255.255.255.0
VLan2 192.37.123.1 255.255.255.0
VLan5 13.37.37.1 255.255.0.0
VLan4 150.37.120.1 255.255.254.0
VLan3 155.37.111.1 255.255.255.0
Dont mess With this VLan1
So a node with an address in the range
150.37.120.0 - 192.37.121.255 can get to the
router backplane thru VLan4 (note its subnet
mask!!) Once on the backplane, that signal can be
sent to any of the other VLans. So a node having
an address in the range 13.37.0.0 13.37.255.255
will see the frame via VLan5. This is our task
here to connect various subnets together even
if those subnets have very different IP addresses.
All the VLan outputs are multiplexed together and
run out through the RED WIRE to the switch.
11Configuring A Router
- Make sure you have the serial cable configured
between the router and Net4. Make sure the
router is turned on. - From the net4 command line, you should be able to
say minicom see Appendix A for any problems. - There should be no password required at this
point. If nothing happens, its either the
minicom configuration (App. A) or you forgot to
turn the power on the router. - Now youre ready to configure the router.
- en
// Enable supervisor mode - password Cisco // Note
its an uppercase C - Help
// Just so you see what it gives you - Show run //
Shows the current configuration. Shows that
current vlan1 is enabled and no others //
are enabled. - // NOTE DO NOT MESS with
vlan1 this is how you telnet into the switch
you // change vlan1 and youre in deep
doodoo!! - The task now is to assign the e-net addresses to
the Vlans these represent the addresses that
will allow access to the bus on the router. If
this confuses you, go back to the picture on the
previous page. - Config t
// Starts cycle to be performed for
each vlan - Interface vlan2
// The vlan youre configuring in this
cycle - Ip address 192.37.123.1 255.255.255.0 // use
your assigned addresses here - No shutdown
- End
- // Repeat steps 9
- 13 so that you give addresses to all vlan2
vlan5. - // NOTE the
router may suddenly spit back all kinds of
configuration info at you do not be
// alarmed!! - Show run
// You should see router is set up according to
your specification
12Configuring A Router
- Try these other commands to see what they do
- Show ip route
// shows routing tables (no rip or ospf) - show interfaces,
// contains among other things throughput
information - show protocols
// Sow that IP is running on the Vlans - Show arp
- Show ?
- AT any time you can turn off the power on the
router. If the whole world seems screwed up,
this is a way out. Then when you turn the power
on, youll be back in a clean and original state. - There are lots of commands we arent using
because our router isnt connected to another
router.
13Configuring A Switch
So heres that red wire from the router it
contains everything we know and need to know.
What matters is the left-most 5 ports those are
the only ones that have been previously
configured to be active on this switch. Our task
is simple to associate/map the VLans to these
output ports. So were assigning VLans to ports.
VLan1 is already mapped to Port 1 please dont
mess with that. So you will map VLan2 VLan5 to
ports 2 5 in any order. See the example.
EXAMPLE Suppose I associate VLan5 with port 2.
That means, as seen on a previous page, that the
node that is wired to port2 must have IP
addresses in the range 13.37.0.013.37.255.255
/255.255.0.0. This simply means that the node
must be on the same subnet as the port in the
router
14Configuring A Switch
- // Now youre ready to configure the switch But
first you need to log onto the switch.
// Remember, we last left you logged on the
router so you need to get from the router to
// the switch.. - At the router command line, Do a ping to
192.168.1.3 if it doesnt work you probably
forgot to turn on the switch. Do it now and be
patient. Router command line, telnet to
192.168.1.3 this is the IP of the switch. The
password required here is password. Now that
youre logged on to the switch, you can do its
configuration. - En
// Enable supervisor mode - Password password // This
gets you to the privileged part of the command
set - ?
// Just so you see what it gives you - Show running //
Shows the current configuration only Vlan1 is
active - config T
- int f0/2
// Were configuring Port 2 - Switchport access vlan 5 //
Associating VLan5 with this port2 - Speed 100
// try this possibilities are 10Mbps, and 100
Mbps. - Duplex full
// Choices are half or full what happens if you
do this? What // happens if
you say half? - End
- Repeat steps 6 11 until all the ports are
configured. - Show run
-
//If the switch ever asks you to save the
configuration, say no. - Q quit
// leave the switch - Are there other switch commands????
15Configuring A Node
- The goal here is to get our nodes, Net2 Net5 to
be able to talk to the router and to the other
nodes. This involves two actions - Configuring the IP address of the node this
needs to be an address that is in the subnet of
the appropriate router port. - Setting the route table so that the node knows
what to do with any particular address. - The first step is to figure out what possible IP
addresses can be used on any of the nodes. Net1
we havent messed with its 192.168.1.1
thats why it should be on port 1 of the switch
since that leads to VLan1 which traces back to
the router address 192.168.1.4/255.255.255.0. - Its your task to do similar thinking for the
other Nodes. - As another example, Ive put VLan5 connected to
port2. Lets suppose I plugged the cable from
Net4 into port2. That means that Net4 has to be
in the subnet of VLan5 hope youve followed
that logic, since you need to do that for your
own configuration. Id recommend you make
yourself a little table.
16Configuring A Node
- Useful commands for this part include ifconfig,
route, netstat, and arp. - There are two interfaces on each node. One is
called eth0 and is the real physical NIC. The
other is lo meaning loopback it functions
only as a way to send a packet to the same node
without leaving the machine. We want to work
with eth0. - Changing the IP address on a node is simple(
again Im using my example addresses) - ifconfig eth0 up 13.37.50.50 netmask
255.255.0.0 - Now go and set Net2 Net5 according to the Table
youve prepared. - Do the following steps at Net4
- Ping your router address -- ping 13.37.37.1 ---
this should work fine because youve told Net4
that it should send signals out eth0 in order to
get to anything on its subnet and 13.37.37.1
is on its subnet as set by the subnet mask. - Now try pinging to the IP address you set up for
Net5. Does it work? - The answer is probably not. The reason it
doesnt is that your Net4 doesnt know what to do
with the address. Youve told it, via ifconfig,
that anything on its subnet goes out eth0, but
you havent said where anything NOT on the subnet
should go. - To do that you need to use the route command.
Do a man route to become familiar with its
characteristics. What you need to do is tell
your Net4 that the way to handle any IP address
not on the subnet is to send it to the router to
be handled there. Heres the way to do that
- Route add net default gw
dev eth0 - where you of course have inserted the address of
the router in the command. - Use this route command to set the default gateway
on all the nodes.
17Wed Like To Know It Works
Its very easy to determine if it all works. You
should be able to ping between any two nodes in
your system. Heres a table you should be able
to put a yes into each box if its working
correctly.
18Wed Like To Know It Works
- Run traceroute and see what paths are used for
your various nodes. How many hops are required
from Net5 to Net3? - On the switch reset the speed of two of your
VLANs to 10Mb/sec. - Run emma full blast between those two connecting
nodes. How many bytes per second can you
transmit. (Appendix B has a review of the emma
commands). The answer SHOULD be equivalent to 10
Mb/sec. Make sure you can do that. NOTE if
you do the command uptime ./emma etc.
uptime you will get a timing of
how long it takes to send however many bytes you
specified. - Reset the VLans to 100 Mb/sec. You MAY need to
pull the cables and reinsert them to get the
nodes to rearbitrate the speeds. Can emma now
transmit faster? What result do you get?
TURN OFF THE ROUTER AND PULL THE PLUG ON THE
SWITCH!
Useful Commands Ifconfig, route(8), netstat(8),
arp(8), rarp(8), ipchains(8)
19Appendix A - Minicom
- Connecting to the router using minicom
- The Linux product that allows you to use a serial
connection is called Minicom. Youll find it
hard to believe, but for many years terminals
werent connected via a terminal cable but had a
serial connection. This meant that it was
necessary to interface the terminal with the
computer. Life is now simpler were using the
serial port on the computer to connect with the
Cisco router. - Most Linux distributions (i.e. Red Hat) already
include minicom ours does. - Start it up with the command "minicom".
- If minicom finds a configuration file, and if
that configuration file is consistent with the
settings on the Cisco, youre all set do
nothing else. Youll see that you have a
connection to the Cisco youre at a login
prompt. - If it doesnt find the correct configuration
file, then you will need to do these steps - Press "Ctrl-A Z" to get to the main configuraton
menu. - Press "o" to configure minicom.
- Go to "Serial port setup" and make sure that you
are - set to the correct "Serial Device" if you
connected the cable in the top serial connector,
then this will be /dev/ttyS0 - the speed on line E matches the speed of the
serial console (this is 9600 for the Cisco) - Hardware flow control is turned off (NO!) Here
are the settings I made when using my Serial A /
COM1 port on my Linux box - -------------------------------------------------
---------------------- - A - Serial Device /dev/ttyS0
- B - Lockfile Location /var/lock
- C - Callin Program
20Appendix B - Emma
- Theres a small program named emma that you will
be using for TCP tests later on. Heres a
description of the program that will help you
later on. Remember way back in Project 0 you
built a client and server that simply sent
messages back and forth between each other. This
program is an offshoot of the code from Project
0. The code for emma.c is available on all the
netlab machines. - Emma has one executable, but it can be run as
either a sender or a receiver but it does only
that one instance of the program sends only,
and the other receives only. Here are the inputs
for emma - emma Address
- or UDP
- The program expects switches in a particular
format. See examples below - -b - The total bytes to be sent, after
which sender closes the - connection. Note the receiver may
not receive this many bytes. - -d - Direction - your choices are Send or
Receive. The receiver also - does the accept while the Sender
will do the connect. - -i - IP Address - in the form
uuu.vvv.www.xxx. This is needed for the - Sender/Connector only - it shows how
to get to the receiver. - -p - Port that the receiver will accept
on. Both sides need to know this. - The default port is built into the
program - this switch is optional. - -s - Size of request to be sent or
received. - -t - Transport protocol - either TCP
(default) or UDP - Example
- emma -d Send -i 140.232.101.125 -b
1000000 - emma -d Receive -s 50