Local DHCP Server 1

certskills
By certskills April 13, 2016 09:05

Configuring a local DHCP server on a router removes the need for one DHCP configuration feature, but you still need to navigate all the DHCP server features. Today’s lab gives you a chance to practice. Follow the usual drill – and if you have a place to test, do it, and make sure the clients do indeed lease an IP address!

Requirements

Configure a DHCP server on R1 for the subnets that reside in VLANs 10 and 20. and VLANs. In particular:

  • 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 10.1.1.1 and 10.1.1.2
  • Set the domain name for the network to example.com.
  • Set the lease length to 7 days long.
  • Prevent the server from assigning R1’s IP addresses to clients for the subnets supported by the DHCP server.
  • Assume all router interfaces shown in the lab are up and working.
  • Assume that the ROAS configuration of R1 is correct.
  • Assume that SW1 has correctly configured trunks and VLANs for all interfaces.

 

Figure 1: ROAS with two VLAN’s (CL124.jpg)

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: SW1 Config

 

Answer on Paper, or Maybe Test in Lab

To test your solution if you happen to try it with 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 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 whether the switch obtained its address.

 

Do this Lab with Cisco’s 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 the Virtual Internet Routing Lab (VIRL) software as well. The .VIRL file found here is a file that when used with VIRL will load a lab topology similar to this lab’s topology, with the initial configuration shown in the lab as well. This section lists any differences between the lab exercise and the .VIRL file’s topology and configuration.

Download this lab’s VIRL file!

The .VIRL topology matches the lab topology exactly. The host info does as well.

Host device info:

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

Device IP Address User/password
PC1 Set for DHCP cisco/cisco
PC2 Set for DHCP cisco/cisco

 

Handy Host Commands:

To see PC IP address: ifconfig eth1
Ping example: ping -c 4 10.1.1.1
Trace example: tracepath 10.1.1.1
To connect to another node within the topology: telnet 10.1.1.1
To release current IP address: sudo dhclient -r eth1
To acquire new IP address: sudo dhclient -v eth1 (-v = verbose, shows address request)

 

EIGRP for IPv6 1
Answers: EIGRP for IPv6 1
certskills
By certskills April 13, 2016 09:05
Write a comment

2 Comments

  1. Mikhail September 2, 03:01

    Wendell, hello again!
    First of all, i want to mention, that i am not a native english speaker.
    I am struggeling with one problem i cant understand. Just imagine this situation:
    We have only one DHCP server (router) and one dhcp client, connected straight to each other.
    Router has such config:

    int fa0/0
    ip address 192.168.1.1 255.255.255.0
    no shutdown
    ip dhcp pool name
    network 192.168.2(sic).0 255.255.255.0
    default-router 192.168.2.1

    With such config host will never recieve its network configuratons. But i am wondering why? How does differenses between int fa0/0 ip address and dhcp network config influence on the “DORA” communication?
    I understand, that i should either change dhcp network to 192.168.1.0 255.255.255.0 or change fa0/0 ip address to 192.168.2.1 255.255.255.0
    But still, why?

    Reply to this comment
    • CCENTSkills September 7, 10:07

      Hi Mikhail,
      Good to hear from you. Your english is wonderful, by the way!
      To answer your question, let me start with one. Would you agree that the DHCP client, sitting on the same LAN as the router’s F0/0 interface, should have an IP address in subnet 192.168.1.0/24? That’s the main reason why the pool then should list network 192.168.1.0/24 in the DHCP pool. That’s the motivation. Hosts in a subnet should be in the same subnet as the other hosts on the same LAN/VLAN and in the same subnet as the routers connected to the same LAN/VLAN. So that DHCP client needs to be assigned an address in subnet 192.168.1.0/24 in this case, so you need a pool that includes that network.

      As to why the config you listed fails:
      Client sends the Discover
      Arrives at router’s F0/0 interface
      Router changes source IP address to router’s own 192.168.1.1 address
      Router processes DHCP request, noting the source IP address, which identifies the source subnet, compares that address to the DHCP server’s network commands. NONE MATCH. So it makes no DHCP reply.

      I think that last bit may be what you were asking?
      Wendell

      Reply to this comment
View comments

Write a comment

Comment; Identify w/ Social Media or Email

Subscribe

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

Thank you for subscribing.

Something went wrong.

Search

Categories