dhcp relay doesn't work?please help

Ansis Atteka aatteka at nicira.com
Fri Apr 11 19:57:20 UTC 2014

If I understand correctly, then you are seeing two issues. I think
that one issue is a bug in dhcrelay and the other one could be caused
by misconfigured DHCP server.

1. "dhcp server 2" is not sending response at all to the DHCP relay.

Most likely a misconfigured DHCP server. Also, did you know that DHCP
server usually sends back response to the GIADDR (yes, that is the IP
address on the DHCP relay's interface facing clients and not the IP
address of the interface facing DHCP server. In your case it would be
eth1's IP address or dhcrelay notifies dhcp server about
this address by altering original DHCP request that came from the
client). Make sure that you have a route on DHCP server to GIADDR
( and that DHCP server can actually ping it. If routes are
setup up properly, then take a look at dhcpd log file to assure that
dhcp server was sending response at all.

2. "dhcp server 1" sent response to the DHCP relay, but it got dropped
on the router.

Most likely a bug in dhcrelay. I have seen this behavior on dhcrelay
4.2.4. Here is explanation from code perspective: dhcrelay creates
link-level AF_PACKET socket and bind()s it to the interface facing
clients (in your case it would bind() to eth1). This socket has a read
event handler got_one() that further calls do_relay4() that does the
actual relaying logic. Another socket that dhcrelay creates is
AF_INET. This socket is used ONLY to send DHCP requests to the DHCP
server, but it is NOT USED to read any packets from the DHCP server.
This is because AF_INET socket is using fallback_discard() handler
whenever a packets arrives. This callback, you guessed it right,
simply drops all the packets that server sent. So the conclusion is
that there is no one to pick up packets from dhcp server on eth0
interface. You could try to cange your setup by running dhcrelay on a
dedicated box:

|----------eth1 router eth0---------dhcp_server

In this deployment dhcp_relay would pick up packets from dhcp_server
on it's eth123 interface, because there would be an AF_PACKET socket.

On Mon, Apr 7, 2014 at 1:58 AM, constant <running910 at foxmail.com> wrote:
> Hi all:
>            I'm sorry my English is not good,please be patient.thank you!!
> I'm doing a
> project based on openwrt (SOC: Atheros ar9341) .As the following chart
> shows, I
>  need a router as a dhcp relay agent,so i use isc-dhcp-relay
> dhcp server <------------> eth0 (router) eth1 <------------>dhcp client
> dhcp server ip:       a normal dhcp server
> router eth0 ip:         eth0 get the ip from dhcp server
> router eth1 ip:             static ip,eth1 is directed connected
> to lan,the bridged interface name is br-lan
> I enter the command:
> dhcrelay -i br-lan
> However, even though I tried two available dhcp server, the client can not
> obtain an IP address.
> for dhcp server 1,wireshark shows
> 1) router forwards dhcp discover from client to server         (unicast)
> 2) server replies dhcp offer to router             (broadcast)
> 3) router doesn't send anything to client
> for dhcp server 2,wireshark shows
> 1) router forwards dhcp discover from client to server         (unicast)
> 2)server replies nothing.
> Does anyone have any suggestions? Thank you very much!
> _______________________________________________
> dhcp-users mailing list
> dhcp-users at lists.isc.org
> https://lists.isc.org/mailman/listinfo/dhcp-users

More information about the dhcp-users mailing list