Advanced Internetworking Lab 1 - Dynamic Address Assignment
Advanced Internetworking Lab 1 - Dynamic Address Assignment
IK2215
Lab 1 – Dynamic Address Assignment
rev 1.1
Name: _______________________________________________
Date: _______________________________________________
We encourage you to bring your own laptop (if you have one), but then
you should make sure you have the necessary software installed on your
laptop. Contact your laboration assistant in advance if you have trouble
with this.
NOTE: It is not a requirement that you have the right answers on the
questions. Furthermore, the answers do not have to be extensive; notes
and keywords are good enough! The thing that is important is that you
can show that you have tried to solve them. If you don't understand a
question, write a note on what was unclear!
1
http://www.ietf.org/rfc/rfc2131.txt
2
http://www.ietf.org/rfc/rfc1332.txt
Using ordinary PCs as DHCP servers works excellent, since the DHCP
software that we will use (from the Internet Software Consortium (ISC 3 )
runs on several Unix systems such as Linux and FreeBSD. In this lab
instruction we will assume that you will use a PC running Linux, however,
there should be no significant difference if you have a PC running
FreeBSD, if you would like to use it instead.
2. Overview
• Preparation
• Lab setup
• Stateless address autoconfiguration in IPv6
• DHCP
3. Preparation
3.1. Reading Material
In order to be able to complete the lab on schedule you need to prepare.
Below is a list of reading material that you must complete before coming
to the lab.
3
http://www.isc.org
Question 4 Let's say that you have a router that you would like to act as
DHCP relay agent, and that you would like the relay agent to forward
DHCP queries to a DHCP server with IP address 10.0.0.2. (See Figure 4.)
What command line argument(s) would you give to dhcrelay3 in order to
make this work?
Answer:
4. Lab setup
There are 4 groups in total, 4-6 persons per group. Each group should
have the following equipment:
• 3 hubs
• 10 straight cables
• 5 laptops (We will provide 3 laptops, which means that each group
will need to use 2 of their own laptops)
The lab assistants have prepared an IPv6 router (R1-R4) on your network,
but not yet informed it to route packets and advertise its network prefix.
(To perform the route advertisement we use the radvd software. If you
want to try it out yourself you could, e.g., install the radvd 'deb' (Debian)
or 'rpm' (RedHat) packages, but that is out of the scope for this lab.)
6. DHCP
In this first part of the lab you will take a closer look at Dynamic Host
Configuration Protocol (DHCP). You will work in groups of 4-6 students
during this part.
Question: Did the client get the same address as before or some other
address?
Answer:
You might have noticed in the previous exercise that it takes some time
from when a DHCP server receives a DHCP Discover message until it
replies with a DHCP Offer. If not, stop and restart the DHCP client on (C)
again and watch the traffic with wireshark on the monitoring machine
(M).
During this time the DHCP server sends probe message(s) to verify that
no-one is already using the address before handing it out. The DHCP
standard says that this is done by sending an ICMP Echo Request
message, but what you see is probably just an ARP Request message.
(The behavior is a bit unpredictable due to the content of the ARP cache.)
Now you should establish the setup shown in figure 3. It is the same setup
as before, but with an additional machine, the bad guy (B). The aim with
this exercise is to watch what happens when a DHCP server attempts to
1. Assign an address to host “C”: Before you attach the bad guy
machine (B) to the network, host “C” should be assigned an address
from the server. For the purpose of this exercise, it is important that
the lease time is low (e.g. 1-2 minutes). Note the IP address
assigned to “C”, then stop the DHCP client on host C.
2. Assign the same address to host “B”: Now be a really bad guy
and configure (manually) the IP address of machine (B) to be the
address that the client (C) earlier leased sudo ifconfig eth0
<ipAddressOfC>.
3. Clear ARP cache in DHCP server (S): In the DHCP server (S),
delete any remaining entry of ipAddressOfC in the ARP cache using
command sudo arp -d <ipAddressOfC>. Without this step the DAD
will most probably fail, unless you wait until the entry in the ARP
cache at the server (S) times out itself.
4. Restart the DHCP client on C: Start the DHCP client on host “C”
again, and observe the messages exchanged on the LAN. Also
observe the /var/log/daemon.log file on the DHCP server.
5. Answer all the question below
6. Call the lab assistant to show your result.
Question: Will (C) get the same address again, or will it be assigned
some other address?
Answer:
Question: How does the DHCP server treat an address that it detects as
in use, although no-one is leasing it from the server? (Except from looking
in the /var/log/daemon.log file you could also watch the
Although the DHCP Relay and the DHCP Server can be multiple hops
apart, we will use the setup shown in figure 4 to illustrate this feature. To
make this work you will also have to do some additional network
configuration just to make routing work properly.
1. Configure the two routers (R1 and R2) with appropriate IP addresses
for both of their Ethernet interfaces (use ifconfig as usual).
2. Enable routing on both R1 an R2 by using a command “sudo sysctl
-w net.ipv4.ip_forward=1” (If you want routing to be enabled at
startup you could edit the file /etc/sysctl.conf.)
Question: In Figure 4, why do you want to have a DHCP relay rather than
DHCP server?
Answer:
1. Find out the MAC address of one of your hosts. Update your
dhcpd.conf so that this host will be assigned an address
permanently, e.g., 10.0.0.30. Using DHCP this way can be a nice
way to configure IP addresses of hosts instead of forcing the users
to enter this information manually (with higher probability of errors).
host bob {
hardware ethernet 00:E0:00:97:E7:B8;
deny booting;
}
5. Start dhclient on that host (Bob) and verify that it does not get any
address assigned.
6. Call the lab assistant to show your result.
7. Last step
Now do the following:
End of Lab 1