Remote DHCP Server 1

By certskills April 19, 2016 09:15

DHCP plays a huge role in most IPv4 networks. In some cases, the server sits on the same subnet as the client, but in other cases, the DHCP server is remote. When it is remote, you need to configure the DHCP relay agent feature as well. Today’s lab: configure that centralized DHCP server, and make sure the remote clients can get a lease from that server.


For this lab, configure R1 to act as the DHCP server for two remote subnets off routers R2 and R3 as shown in the figure. Specifically:

  • Use a DHCP pool per Subnet (Names: One and Two)
  • Configure the correct default gateway configuration; you decide on the correct values.
  • Configure a DNS IP addresses of and
  • Set the domain name for the network to
  • Set the lease length to 1 day, 2 hours, and 3 minutes long.
  • Prevent the server from assigning to clients the IP addresses used by the routers in those subnets.
  • Assume all router interfaces shown in the lab are up, working and the appropriate interfaces have been configured with IP addresses (per the initial configuration).
  • Assume all routing protocol configuration is correct between routers, so that all routers learn routes for all subnets


Figure 1: Remote DHCP Topology


Initial Configuration

Example 1, 2, 3, and 4 show the beginning configuration state of R1, R2, R3 and SW1.

Example 1: R1 Config

Example 2: R2 Config

Example 3: R3 Config

Example 4: SW1 Config


Answer on Paper, or Maybe Test in Lab

Next, write your answer on paper. Or if you have some real gear or other tools, configure the lab using them.

To test your solution if you happen to try it with CML/VIRL or real gear, use something that will attempt to use DHCP to lease an IPv4 address. On hosts, you can set the host to use DHCP. For instance, on Windows OS’s, use commands like ipconfig /release (to release the lease) and ipconfig /renew (to attempt a new lease). On Linux, try sudo dhclient –r to release, and sudo dhclient to lease a new address.

Alternately, if you have Cisco switches to use, include a switch connected the G0/2 interfaces of both R2 and R3. Then you can make each switch use DHCP for its own management IP address. For example, if R2 is connected to a LAN switch, and the switch used VLAN 1 on all ports, you could configure the commands interface vlan 1 followed by ip address dhcp to make the switch attempt to lease an address to use for interface VLAN 1. The show interfaces vlan 1 command on the switch will then show if the switch obtained its address or not.

Do this Lab with Cisco’s CML (Formerly VIRL)

You can do these labs on paper and still get a lot out of the lab. As an extra help, we have added files for Cisco Modeling Lab – Personal (CML-P). CML-P replaces Cisco Virtual Internet Routing Lab (VIRL) software, in effect serving as VIRL Version 2.

Below, find two files: a file useful with CML-P and another useful with VIRL. (Note that the CML-P file has a .yaml filetype, while the older VIRL file has a VIRL filetype.) Once the file is loaded, CML-P or VIRL will create a lab topology similar to this lab’s topology, with the initial configuration shown in the lab as well.

This lab’s CML file!

This lab’s VIRL file!

The CML/virl topology matches this lab topology exactly. The host info does as well.

Host device info:

This table lists host information pre-configured in CML/VIRL, information that might not be required by the lab but may be useful to you.


IP Address











Handy Host Commands:

To see PC IP address: ifconfig eth1

Ping example: ping -c 4

Trace example: tracepath

To connect to another node within the topology: telnet


Answers: EIGRP for IPv6 1
Answers: Remote DHCP Server 1
By certskills April 19, 2016 09:15
Write a comment


  1. orange September 4, 20:16

    subnet is repeated twice in the diagram.

    Reply to this comment
  2. Tom October 27, 14:01


    Thank you for creating these labs. I am getting a lot of value out of them. I am currently using CML for study practice in lieu of owning Cisco hardware. Unfortunately, when I select the link to download this lab’s CML file, it returns a web page with “error code 300 multiple choices” and offers a link to a zipped VIRL file which I am unable to run on CML.

    I attempted to create the lab in CML from scratch by cutting and pasting the listed initial configurations into the “EDIT CONFIG” menus for the routers and switch. I connected the routers to the eth1 port on the desktops as that seems to be the method in other labs. However, the desktops are not picking up network info from the DHCP server.

    I am not experienced with Linux. However, according to the Cisco CML community blog, the default configuration for the desktops will allow them to pick up the required network settings from a DHCP server (IP address and mask, default gateway, DNS).

    I must be missing something. Maybe the desktops need a default route but can’t get it without having an IP address on the interface first. I just don’t know.

    Any help would be greatly appreciated.


    Reply to this comment
    • certskills Author October 27, 14:12

      Hi Tom,
      Glad you’re finding the labs useful.
      This lab post is about five years old, and we just completed a migration of most of these posts to a revised version of each lab. Try instead this post: which replaces this lab. Same flow to the lab, but there’s an updated .yaml file that should open in the current version of CML. Let me know if you try that.
      Hope this helps,

      Reply to this comment
      • Tom October 27, 14:22

        Hi Wendell,

        Thank you for the quick response. I do see you recently posted updated labs which is great. Just to confirm, the link is .If so, it is coming back with “error code 404”. I did verify the links to Labs 124 and 126 are working by changing the last digit in the URI.


        Reply to this comment
        • certskills Author October 27, 15:47

          Sorry about that. I looked further, and we haven’t migrated this lab to the new format yet. So…
          I looked further into this lab page and found the error that was preventing you from downloading the CML file. It should work now. If not, you might try clearing your cache and reloading this page, or trying another browser for this lab. (The browser may remember that the object isn’t reachable until you clear the cache.)
          Anyway, once you download the CML file, hopefully you can open it in CML and do the lab.

          Reply to this comment
          • Tom October 27, 16:49

            Hi Wendell,

            File download and lab both work perfectly!

            Thank you.



View comments

Write a comment

Comment; Identify w/ Social Media or Email


Subscribe to our mailing list and get interesting stuff and updates to your email inbox.

Thank you for subscribing.

Something went wrong.