1

I have a datacenter network in which I need to test DHCP across subnets. I have a smart switch which is configured to rebroadcast DHCP requests in any subnet to the broadcast address in my admin network, 10.1.0.255.

As nothing is yet managed by DHCP, I have installed dhcpd on a RHEL7 server at 10.1.0.4, which is wisdom.metro.mydomain.com:

shared-network metro {
    option domain-name "metro.mydomain.com";
    option domain-name-servers 10.0.1.3, 10.0.2.3;

    # admin network
    subnet 10.1.0.0 netmask 255.255.255.0 {
        option broadcast-address 10.1.0.255;
        option subnet-mask 255.255.255.0;
        option routers 10.1.0.1;
        authoritative;
    }

    # mysql database network
    subnet 10.1.1.0 netmask 255.255.255.0 {
        option broadcast-address 10.1.1.255;
        option subnet-mask 255.255.255.0;
        option routers 10.1.1.1;
        authoritative;
    }
}

# static leases
host johnrambo {
    option host-name "johnrambo.metro.mydomain.com";
    hardware ethernet 00:01:02:03:04:05;
    fixed-address 10.1.1.4;
}

I am attempting to test that DHCP will resolve properly by following the journal for the dhcpd.service unit on my DHCP host (ie journalctl -u dhcpd.service -f).

On johnrambo, which is running RHEL6, I have installed dhcping and can send DHCP requests to the server like so:

# dhcping -s 10.1.0.4 -h 00:01:02:03:04:05
no answer

On wisdom, I can see that it at least received the DHCP request:

Sep 01 12:18:54 wisdom.metro.mydomain.com dhcpd[29530]: DHCPREQUEST for 0.0.0.0 from 00:01:02:03:04:05 via em1: ignored (not authoritative).

If I request an explicit IP address with -c 10.1.1.4, I get an answer:

Sep 01 12:33:52 wisdom.metro.mydomain.com dhcpd[29530]: DHCPREQUEST for 10.1.1.4 from 00:01:02:03:04:05 via em1
Sep 01 12:33:52 wisdom.metro.mydomain.com dhcpd[29530]: DHCPACK on 10.1.1.4 to 00:01:02:03:04:05 via em1
Sep 01 12:33:52 wisdom.metro.mydomain.com dhcpd[29530]: DHCPRELEASE of 10.1.1.4 from 00:01:02:03:04:05 via em1 (not found)

If I attempt to broadcast from johnrambo to its own broadcast address 10.1.1.255 or to the broadcast address of wisdom's subnet 10.1.0.255, I do not see any logs generated.

Therefore, I'm seeing two discrete problems here:

  1. dhcping either doesn't do broadcasting, dhcpd on wisdom isn't listening for broadcasts, or something else is happening which prevents everything.
  2. Unless I specifically request an address, dhcpd on wisdom doesn't reply.

My end-goal is to setup DHCP with only static leases for PXE boots in my datacenter, which is contingent on cross subnet DHCP broadcasts working. If I can't send a DHCP request to the broadcast address on my network, the host will not get an IP and will not PXE boot.

Is there a better way to test DHCP, and what am I doing wrong in my dhcpd config?

  • You should be using a DHCP Relay Agent for this, not trying to get broadcast traffic to transit your router. – joeqwerty Sep 1 '16 at 21:13
  • @joeqwerty That might be what is configured here, lemme find out. – Naftuli Kay Sep 1 '16 at 21:36
  • Apparently, the problem is that dhcping doesn't support sending DISCOVER packets. – Naftuli Kay Sep 1 '16 at 22:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.