CS312
LAB 3 - CONFIGURING A ROUTER
Due Date: Nov 15
Be sure to leave the lab connected in the same way that you found it.
If you
change the configuration of the network, it may be difficult
for the next person to complete the lab.
After completing this lab, you should be able to:
1. Understand the capabilities of a router
2. Set up and configure a router
3. Be able to set TCP/IP parameters on a Linux system or PC
Background
Information
In this lab you are going to do the setup and configuration of two
routers and
the establishment of IP addresses for the Linux workstations in the
lab.
Design: In this lab, you are going to connect three networks using the
routers. There are four Linux machines. Using the hubs available,
connect
PC1 and PC2 into one hub, PC3 into a second hub and PC4 into a third.
(the big
black boxes are additional hubs) You will define new network numbers
for the
three segments using the class A private network numbers defined in RFC
1918. We will subnet the network using a mask of
255.255.255.0. Use
the range of class A subnetworks: 10.2.0.0
to
10.2.200.0. Randomly choose 4 of these network numbers to use.
There are three routers in the lab. One networks is to be to be
connected
to each router. router. A
fourth network will connect the routers.
Draw a diagram of how you intend to
interconnect the machines, identifying the network addresses of each of
the
machines. Also identify which ports you will be using on the
routers and
the IP addresses of those ports.
Note that one network will connect the three routers and have no
other
hosts on it (hence you need four networks).
Setup:
*****************************************************************
Be very careful to follow the directions in this writeup.
Do not change any of the passwords for any of the devices! For
all of the
machines, MAKE NOTE OF THE CURRENT SETTINGS SO THAT AT THE END OF THE
LAB YOU
CAN RECONFIGURE THE MACHINES TO THEIR ORIGINAL VALUES!
*****************************************************************
Physically hook up your network according to the diagram that you have drawn.
On the Linux boxes:
You can log into any of the Linux boxes using root as the user name and netlab as the password. Do not change the password!
To configure the network interfaces for the
Linux
workstations, the following must be done.
1. Identify the name of the network interfaces. There may
multiple
interfaces and they are known by different names on different systems.
To find
the network interfaces available, use the command:
netstat -ain
(Look at the man pages for netstat to
determine what
the options do)
One interface that is listed will be lo, which is the virtual interface
for
what is called local loopback (a way for a machine to treat itself as
one of
the machines on the net just like any other) and should have an address
of
127.0.0.1. Any others should be names of physical network
interfaces and
should show an ethernet address.
Set up the interfaces as you did in the last lab by using the
ifconfig <address/mask> as in lab2
In addition, we
need to set the default route for
each Linux box so that it knows what address to send packets that are
destined
for other networks. Since each box is attached to only one router, we
can
simply set a default route in the Linux box to send messages to the
router
address that is on its network. To do
this, you use the route command (do a man route to see details). The
command is
used as:
route add default gw <router_address>
If we have a
network of 10.1.1.0, and the router
that is attached to that network will have the address 10.1.1.254, then
we use
the command
route add default gw 10.1.1.254
You can also use route
–e to display the current routing table and route –c
to display the current routing cache. To
delete a route that has been set up, use route del default
gw
<router_address>
CISCO IOS basics:
The command line interface of IOS has a rich
syntax. There are hundreds of
configuration commands
and some commands have numerous options.
The command line interface runs in different modes and each
command
requires a certain mode. Each command mode has a different prompt and
you can
tell which mode you are in by looking at the prompt.
Typing a question mark at any prompt will
give you a list of available commands for that mode.
If a command requires parameters, you can get
an idea of the parameters required b typing the command followed by a
question
mark.
Note: When making selection within the router configuration
application, you
can abbreviate entries as long a they are not ambiguous (e.g. "int" for "interface")
Physically connect the serial cable (blue flat cable) from the serial
port on
the back of a Linux box to the router jack labeled “console” on
Router1.
On the Linux box, open up a terminal emulator program by typing minicom on the
command line. This should open a connection to the router and you
should see a
prompt of
Router1>
This is in the user EXEC mode. To see the commands that are possible in this mode, enter a question mark:
Router1> ?
To view and change system parameters, you need to enter the Privileged EXEC mode. To do this, type the word enable and then the password to the enable mode: netlab
Router1> enable
Password: cisco80211
Router1#
Notice that the prompt has changed indicating that you are in the Privileged EXEC mode. As before, you can enter a question mark to see what commands are available.
To modify systemwide configuration parameters, you need to enter the global configuration mode. This mode is entered by typing
Router1# configure terminal
Router1(config)#
The routers we are configuring have two ports or interfaces. Note the names of the two ports on the back of the router. To make changes to a network interface, enter the configuration mode by using the keyword interface along with the name of the interface you want to configure.
Router1(config)# interface FastEthernet0/0
Router1(config-if)#
To return from the interface configuration to the global configuration or from the global configuration to the Privileged EXEC mode, use the exit command.
Router1(config-if)# exit
Router1(config)# exit
Router1#
Each time you enter exit, it will take you one more step up the
hierarchy. To directly return to the
Privileged EXEC
mode from any configuration mode, type end
Router1(config-if)#
end
Router1#
To return from the Privileged EXEC mode to the user EXEC mode, type the command disable
Router1#disable
Router1>
To terminate the console session from the user
EXEC mode,
type logout.
Router1> logout
Router1 con0 is
now available
Press Return to
get started
Alternatively, you can type logout or exit from the Privileged EXEC mode.
Below is the dialog to configure one port on a router IF we were using the address 10.0.0.254 for the router address.
Router1> enable
Password: cisco80211
Router1# configure terminal
Router1(config)# no ip routing
Router1(config)# ip routing
The no ip routing disables IP forwarding and resets the contents of the routing table. The ip routing command enables ip forwarding on the router.
Router1(config)# interface FastEthernet0/0
Router1(config-if)# ip address 10.0.0.254 255.255.255.0
Router1(config-if)# no shutdown
This command enables the interface. The command shutdown would disable an interface.
Router1(config-if)#
end
According to your diagram, you should now configure all four interfaces of the two routers. Be sure that you match the network numbers and masks correctly on each of the interfaces according to what networks they are connected to according to your diagram.
When you have finished, use the commands
Router1# show
interfaces
Router1# show running-config
Do the same with Router2
Include the
output from these commands along with a brief explanation of what it
means.
From PC1, ping PC2, and both IP addresses of the router that is connected to the same network as PC1. Do the same thing from PC3. Include the result of your pings along with a brief explanation. Finally, from Router1, try to ping each of the 4 devices along with both IP addresses of Router2. In your report, you should indicate which devices you can successfully reach and if this matches your expectations.
Even though we have enabled ip routing on the routers, we have not created any routing tables! We will add static routes to begin.
The following commands can be used:
From the Privileged
EXEC mode
show ip route
Displays the contents of the routing table
clear ip route *
deletes all routing table entries
show ip cache
shows the contents of the ip cache
From the global
configuration mode:
ip route-cache
Enables route caching. By default, route caching is enabled on a router
no ip route-cache
disables route caching
ip route
destination mask gw_address
adds a static routing table entry to destination with netmask mask. Gw_address is the address of the next-hop router
ip route destination
mask iface
adds a static routing table entry to destination with netmask mask. Here the next-hop information is the name of a network interface(e.g. FastEthernet0/0)
no ip route
destination mask gw_address
no ip route destination mask iface
deletes the route table entry with destination, mask, and next hop
Here are a few examples of how you would add static routes to a table
Router1(config)# ip route 10.21.0.0 255.255.0.0 10.11.1.4
Router1(config)# ip route 10.0.2.0 255.255.255.0 10.13.1.12
Router1(config)# ip route 10.2.1.21 255.255.255.255 10.1.1.254
Note this routes to a specific host!
Router1(config)# ip route 0.0.0.0 0.0.0.0 10.0.4.4
This sets a default route so that any address that does not match one of the other entries will automatically be routed to 10.0.4.4
Router1(config)# no ip route 10.21.0.0 255.255.0.0 10.11.1.4
This removes this route from the table
Display the contents of the routing table on Router1 and Router2 by using the command show ip route and save the output. Add the routing entries to each of the routers so that all the networks are reachable. Display the tables again by using the show ip route command and save the result. Include both sets of results in your report along with a brief explanation.
At this point, all boxes should be able to communicate with each other. Send a ping command from PC1 to all the other interfaces (3 other linux boxes and 4 ports on the routers). If not all of the addresses are reachable, you will need to troubleshoot the network and try to determine where the problem is. When you have successfully debugged the network, repeat the ping from PC1 to the 3 other linux boxes and the four ports and save the output. Include it in your report with a brief explanation.
Now move PC4 from its network to the network that connects the two routers. Note that its IP address must be changed to match the network that it will now be on. Start wireshark on PC4. Send a ping from PC3 to PC1. Look at the packets from the ping on wireshark. Carefully look at the MAC address and the IP address of the ping and the response. Check to see what the MAC addresses of PC1, PC3 and the two routers are. Attach your wireshark results to your report along with an explanation of what you have found.
In your report, give a brief overview of what you have covered and learned. Include the appropriate output along with explanations for each portion of the lab. Be sure to have both an introduction and a conclusion to your report. Be sure to disconnect all wires and remove all files that you created. Finally, reset the tables for the routers and reboot the machines so the lab will be ready for the next group.