Unformatted text preview:

Overview:Hardware requirementsProcedure:PreliminaryPart 1Part 2Clean-upDeliverables:Trouble shooting:Notes:ITIS 3100 – Lab 2RoutersOverview:The purpose of this lab is to introduce the student to some of the functions of a router, specifically bridging communication between two networks. For this lab one router (a Linuxbased system) will be use to connect 2 different networks together and allow them to communicate. The router for this lab will be a low end PC with two NICs installed. The operating system for the router will be Debian Linux.This lab may be done individually or by pairs. If the lab is done in pairs, each student must hand in their own lab report. For pairs each student will “own” one of the networks. They will cooperate to get the clients to communicate through the router. The 3rd octet of their IP address will be assigned by the instructor. See web site or the posting in the lab for your network id. For students working in pairs they will need to work out the address to be shared between their clients.Note: all the examples below use an arbitrary network id of 99.Hardware requirementsEquipment: One Linux router (PC) with 2 NICs Two Switches either a Linksys BEFSX41 or WRT54G Important: only the switch function of the Linksys router will be used Two Client Linux VMs on separate PCs Cat 5e cablesProcedure:PreliminaryEnsure your environment will support the lab- The lab will require 3 computers and 2 Linksys routers overall- Ensure there are enough power outlets and Ethernet cables available- (5 power ports and 4 cables)Part 1The first part of the lab will be setting up two Linux VMs on two separate physical machines. You will be recycling the VMs that were set up in your last lab. You may use either Debian or CentOS (or one of each). VMs are being used so you don’t mess up the base machines for other classes (and also don’t permanently mess up your own VMs). The two VMs will be set up with IP addresses for different network class environments, one for 172.16 (a Class B network) and one for 192.168 (a Class C network).Last saved: 2/7/2008 10:25:00 PMPage 1 of 6ITIS 3100 – Lab 2RoutersAfter the machines are set up they will be connected together via a switch to show they cannot communicate since they are in different networks. In Part 2 of this lab they will be connected via a router and communication will be enabled.Note: Depending on how Linux was set up when the OS was installed, DHCP may or may not be enabled for your NIC cards. (DHCP is an automatic IP address assigner). Having DCHP enabled on either your VM client or on the NIC cards on the router will make the lab impossible to run. One of the steps you will need to do for each of the VMs and the Router is to ensure DHCP is not enabled. The following method of checking and, if need be, changing is valid for Debian Linux:- Locate the interfaces configuration fileo /etc/network/interfaces- View the contents:o Look for the iface line e.g. iface eth0 inet dhcpo If it has static at the end its probably ok, if there is the dhcp change it to static Use vi, vim or another editor of your choice Change dchp to statico Add lines, if needed, to assign an address and a netmask to the NIC for that iface Use man interfaces to find the command(s) to do that- Save the file and restart the network card(s) as neededo /etc/init.d/networking restartLab steps:1. Configure VM1s IP environment change to root user■ su (or su -) Configure the IP address to a Class B (172.16.99.1 – 172.16.99.253), e.g. 172.16.99.10. Remember to change the 99 to your own network id. See the IP table on the web page.■ ifconfig eth0 172.16.99.102. Configure VM2s IP environment Configure the IP address to a Class C (192.168.99.1 – 192.168.99.253), e.g. 192.168.99.10■ ifconfig eth0 192.168.99.103. Connect the two VMs together and test- Connect VM1 and VM2 together with a Linksys Router- Use only the switched part (ports 1 and 2) - See 4. Ping to verify the two VMs cannot communicate From VM1■ ping self, for example ping 172.16.99.10■ ping other ping 192.168.99.10 Last saved: 2/7/2008 10:25:00 PMPage 2 of 6ITIS 3100 – Lab 2Routers From VM2■ ping self, for example ping 192.168.99.10■ ping other ping 172.16.99.10 5. Optional Bonus (+2pts)- Change the net mask for both VMs to /1- Repeat the pings and note the results- Return the net masks to normal Figure 1Part 2Add the Linux router to the network and make necessary changes to the VM IP configurations. The router and the VM systems will be reconfigured to allow communications between the two disparate networks.Lab Steps:6. Configure the Linux router IP- Log onto the router - Userid: student PW: student- Change to root user su root pw: rootpw Configure the gateway for 172.16.99.0 network■ ifconfig eth0 172.16.99.254 Configure the gateway for 192.16.99.0 network■ ifconfig eth1 192.168.99.254  Enable the ip forward function in Linux (very important!)■ ip forwarding can be enabled for this session by the following command: echo 1 > /proc/sys/net/ipv4/ip_forwardLast saved: 2/7/2008 10:25:00 PMPage 3 of 6ITIS 3100 – Lab 2Routers■ ip forwarding can be permanently enabled by the following: find the sysctl.conf file (usually in the /etc directory) find and uncomment the following line: # net.ipv4.ip_forward = 1 The actual parameter on the line may vary by Linux distribution, read the comments to understand which command enables ip forwarding Use the ifconfig and route commands to verify■ ifconfig■ route7. Modify VM1s IP add default gateway for eth0 (very important!)■ route add default gw 172.16.99.254 use route command to verify the routing table■ route8. Modify VM2s IP add default gateway for eth0 (very important!)■ route add default gw 192.168.99.254 use route command to verify the routing table■ route9. Physically connect the system together- The Debian router will be inserted between the two VMs- See Figure 210.Test connections11.Ping to verify the two VMs can now communicateNote: you may need to wait a short while (1-2 minutes) for the route tables to establish connections. ping self, for example (just for the fun of it)■ ping 172.16.99.10 ping the gateway■ ping 172.16.99.254 ping other■ ping 192.168.99.10 Clean-up12.Return everything to normal- Uncable all hardware and reconnect the pc to the wall port- Put away the


View Full Document

UNCC ITIS 3100 - Study Notes

Download Study Notes
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Study Notes and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Study Notes 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?