3

I have a VLAN composed of multiple subnets, and I would like to use DHCP to centralize IP address designation.

The DHCP server (100.100.25.88) is a Debian machine on the subnet 100.100.25.64/27. I would like to assign IP addresses to machines in the subnet 100.100.68.0/24. The ultimate goal is to enable PXE booting on all machines in the 100.100.68.0/24 subnet.

Below is my dhcpd.conf file,

# DHCP Configuration file
use-host-decl-names on;
ddns-update-style interim;
ignore client-updates;
next-server 100.100.25.88;

# Subnet of DHCP server
subnet 100.100.25.64 netmask 255.255.255.224 {
        option subnet-mask              255.255.255.224;
        range dynamic-bootp             100.100.25.66 100.100.25.94;
        default-lease-time              21600;
        max-lease-time                  43200;
        option domain-name-servers      100.100.25.69, 100.100.44.21;
        option routers                  100.100.25.65;
        filename "pxelinux.0";
}

# Subnet of client machines
subnet 100.100.68.0 netmask 255.255.255.0 {
        range dynamic-bootp             100.100.68.10 100.100.68.200;
        option subnet-mask              255.255.255.0;
        default-lease-time              21600;
        max-lease-time                  43200;
        option domain-name-servers      100.100.25.69, 100.100.44.21;
        option routers                  100.100.68.1;
        option broadcast-address        100.100.68.255;
        filename "pxelinux.0";
        allow unknown-clients;
}

The way I understand DHCP, the DHCP server should be broadcasting packets to broadcast address specified for the second subnet, 100.100.68.255. No clients are able to retrieve an IP address, though. Is this an error in my DHCP configuration, or possibly because the router does not enable DHCP relays?

Thanks!

Ben Webber
  • 63
  • 1
  • 1
  • 7

1 Answers1

4

If you want your DHCP server to receive client requests from other networks, you will need to set up a DHCP relay in each such network, and each relay will need to be configured to forward client requests to your DHCP server. I believe that the ISC DHCP package is capable of providing relay service, but I have never used it in that capacity. Many routers can also be configured to act as DHCP relays on networks they're attached to.

In your case, it seems logical to configure a DHCP relay on 100.100.68.1, since it's a router. However, any server (with a static IP) on the 100.100.68.0/24 network could just as easily fill that role.

(By the way, DHCP servers never broadcast, they always send direct (unicast) messages.)

Steven Monday
  • 13,599
  • 4
  • 36
  • 45
  • Thanks for your quick response, Steven. So, were I to point the `ip helper-address` on the Cisco router at `100.100.68.1` to my DHCP server, DHCP requests on the `100.100.68.0/24` subnet would be filled properly? – Ben Webber Dec 08 '10 at 23:53
  • @Ben: Provided that everything is configured correctly, yes, I believe so. Just be aware that, by default, `ip helper-address` forwards broadcasts for a number of ports/protocols, in addition to DHCP. – Steven Monday Dec 09 '10 at 01:06
  • 2
    How does DHCP decide which scope to use when handing out an IP address? DHCP receives the broadcast request for an IP and DHCP replies via unicast with an IP from one of its scopes. How does it decide which scope to pull the IP from? – Ruisu Sep 21 '11 at 17:34
  • 1
    I asked a similar question (different scope) here, if anyone is interested and if it helps anyone: http://serverfault.com/questions/575897/how-to-configure-linux-dhcp-servier-for-mpls#575930 – bgmCoder Feb 17 '14 at 01:53