Changes

Jump to: navigation, search

NAD710 Lab 2

2,691 bytes added, 11:35, 17 September 2008
Completing this Lab
<h2>NAD710 - Introduction to Networks - Using Linux</h2>
=Reference Material=
[http://cs.senecac.on.ca/~rchan/nad710/0603/notes/week_2_notes.html IP Address Space]
=Objectives=
Lab with the proper hardware and software: T2107 in TEL building.
 
==Please check the following if you are doing this lab in T2107==
 
=== DHCP Client Issue===
If you boot to FC8, by default, the system contacts the DHCP server in the Lab and config its ethernet adpator with the assigned TCP/IP parameters. The DHCP client running on FC8 will renew its TCP/IP lease from the server every few minutes. Since we want to change the IP address of the network interface, we must first stop the DHCP client on the machine.
=== Stopping DHCP Client ===
* First, use the su command to get super-user privileges. Use your login password when prompted:
[joker@localhost ~]$ su -
Password:
[root@host-a ~]#
* The name of the DHCP Client on FC8 is called "dhclient". Use the following to find out the process ID of the running dhclient on the system:
[root@host-a ~]# ps -ef | grep dhclient |grep -v grep
root <font color="red">2030</font> 1 0 15:23 ? 00:00:00 /sbin/dhclient -1 -q -lf
/var/lib/dhclient/dhclient-eth2.leases -pf /var/run/dhclient-eth2.pid eth2
* If the command produces nothing, DHCP client is not running on your system. The number in red (I highlighted it here, the actual output shows no color) is the process number of the DHCP client process. You can use the following "kill" command to try to terminate it:
[root@host-a ~]# kill -15 2030
* Type the following command again to see whether the DHCP client is still running or not:
[root@host-a ~]# ps -ef | grep dhclient |grep -v grep
* If the dhclient still shows up, try the following:
[root@host-a ~]# kill -9 2030
=Procedure=
You need two Linux systems connected to a LAN. Make sure that each system has only ONE network interface card. Label one system as Host-A and the other system as Host-B.
* Boot up both system to Fedora Core 8 (or 9FC9 if you are doing this lab in some other places).
* Login to Host-A and Host-B under a regular user account. Don't login as "root".
* On Host-A, open up two terminal windows, set the title on one terminal windows to "T" and the other to "C". "T" for tcpdump window and "C" for command window.
* Do the same on Host-B as on Host-A.
* Switch to user "root" on all four terminal windows.
* Use the command "ifconfig-a" to find out the name (eth<font color="blue">xx</font>), IP address, broadcast address, netmask and the MAC address of the network device on Host-A and Host-B. Keep this information for later use.
* Use the command "ip addr" on Host-A and Host-B and keep the output for later use.
* Use the "ping" command to check the network connection between Host-A and Host-B. Ask for help if Host-A can not talk to Host-B.
[root@host-b ~]# ping -c 2 [IP address of Host-A] ==Changing IP address on network interface using the ifconfig command==* Commands in the following steps may contain the variable <font color="red">x</font>. If you are doing this lab using your own LAN, you can pick any value between 1 and 254 for <font color="red">x</font>. If you are working in the LUX lab, make sure you are not using the same <font color="red">x</font> value as any other students in the Lab.* On terminal window "C" on Host-A, set the IP address for the network device to 172.16.<font color="red">x</font>.1, netmask to 255.255.255.0, and set the broadcast address to the appropriate value.For example: ifconfig eth<font color="blue">xx</font> 172.16.<font color="red">x</font>.1 netmask 255.255.255.0 broadcast 172.16.<font color="red">x</font>.255* On terminal window "C" on Host-B, set the IP address for the network device to 172.16.<font color="red">x</font>.2, netmask to 255.255.255.0, and set the broadcast address to the appropriate value.For example: ifconfig eth<font color="blue">xx</font> 172.16.<font color="red">x</font>.2 netmask 255.255.255.0 broadcast 172.16.<font color="red">x</font>.255
* Use the "ifconfig" or "ip addr" on Host-A and Host-B to verify the newly assigned addresses. Make changes if necessary. Ask for help if you have any troubles.
* Use the "ping" command to verify the network connection between Host-A and Host-B for the new addresses. Go on to the next step only after a positive result.
 
==List MAC addresses stored in the ARP cache==
* On terminal window "C" on Host-A, enter the following commands and keep the outputs for later use:
arp -n
arp -n
* Do the same on Host-B.
 
==Capturing network packets==
* On terminal window "T" on Host-A, enter the following command and keep the output for later use:
tcpdump -n arp host 172.16.<font color="red">x</font>.1
tcpdump -n arp host 172.16.<font color="red">x</font>.2
* On terminal window "C" on Host-A, enter the following "ping" command and watch the outputs on terminal "T" on Host-A and Host-B.
[root@host-a ~]# ping -c 4 [ip of host-b]
* Do the same on Host-B.
[root@host-b ~]# ping -c 4 [ip of host-a]
* On terminal window "C" on Host-A, enter the command "arp -n", record the MAC address of Host-B and label it as MAC-B.
* On terminal window "C" on Host-B, enter the command "arp -n", record the MAC address of Host-A and label it as MAC-A.
==Turn off ARP on network interface==
* On terminal window "C" on Host-B only, enter the following commands and compare the outputs of the first and last "ifconfig" command and spot the difference(s).
ifconfig eth<font color="blue">xx</font>
* On terminal window "T" on Host-B, terminate the "tcpdump" and retype the last tcpdump command.
* On terminal window "C" on Host-A, send two ping packets to Host-B and watch the outputs to Host-A and Host-B's terminal window "T"s. Record your observation for later use.
== Adding IP to MAC address mapping entries to Host-A and Host-B manually==
* On terminal window "C" on Host-A only, enter the following commands and record the output for later reference:
arp -s 172.16.<font color="red">x</font>.2 MAC-B XX:XX:XX:XX:XX:XX (put replace the Xs with Host-B's MAC hereaddress)
arp -n
* On terminal window "C" on Host-A, send two ping packets to Host-B and record your observation.
* On terminal window "C" on Host-B, enter the following commands and record the output:
arp -s 172.16.<font color="red">x</font>.1 MAC-A XX:XX:XX:XX:XX:XX (put replace the Xs with Host-A's MAC hereaddress)
arp -n
* On terminal window "C" on Host-A, send two ping packets to Host-B and record your observation.
 
==Enable ARP on network interface==
* On terminal window "C" on Host-B, enter the following commands and record your observation:
ifconfig eth<font color="blue">xx</font> down
ifconfig eth<font color="blue">xx</font> arp
ifconfig eth<font color="blue">xx</font> up
arp -n
* Make sure that the tcpdump command is still running on terminal window "T" on Host-B.
=Completing this Lab=
Login Post your answers for this lab to [[NAD710 Lab 2 Answers]] You will be graded according to blackboard (myyour contribution.senecacollege.ca) If you have nothing to add to the answer page, please make some comments of the lab and the answers and complete an online lab 2 quiz after you receive an notification from email them to your instructorprofessor[[Category:LUX]][[Category:NAD]]
1
edit

Navigation menu