DHCP relay on DHCP client interface

Klemen Sladic gosturnca at gmail.com
Wed Mar 21 21:47:28 UTC 2018


Hi.

I have two questions regarding running a relay over a DHCP client interface.
I am using ISC-DHCP

*4.3.5.*
My system and interfaces look like:

BOX1                                  BOX2                BOX3(10.210.1.2)
---------------------------           ---------------     ---------------
eth0          eth1        |           | DHCP server |     | DHCP server |
DHCP client   DHCP client |<wireless> | for eth1    |<Eth>| for eth0    |
port 68       port 17787  |           | port 17787  |     | port 67     |
---------------------------           ---------------     ---------------
   \           /
     DHCP relay
      to BOX3

First, eth1 gets a lease from BOX2, configures itself, configures eth0 for
its subnet (obtained as option)
and starts DHCP client on eth0 and DHCP relay between eth0 and eth1.
eth0 should get the IP from BOX3 which is accessible through established
routes.

It goes like this:
1. eth1 get the lease from BOX2 and configures its IP/mask etc.
2. eth1 with a lease also gets a custom option which tells which subnet
eth0 should be in,
and assigns last IP in eth0 subnet to the eth0
3. DHCP client on eth0 is restarted.
4. DHCP relay is restarted - there are few other eth0 VLAN interfaces
included which are not DHCP clients.

Since I am not sure if I am doing this correctly, my questions are:

1. Since the relay can not run on interfaces without IP address how should
I set up eth0?
Currently, I assign it a "reserved" IP from its expected subnet which is
then updated when lease is obtained.
Is this how it should be done? Is there any other way so I would not have
to use this "reserved" IP?

2. When eth1 gets a lease and restarts DHCP client on eth0, sometimes (one
to 10) it happens that
eth0 just won't send out DHCPREQUEST, it sends one and that is it. No
retries, no lease obtained.
Why would it stop sending requests?
Part of the log, eth1 got 192.168.1.3 from BOX2, eth0 sent only one
DHCPREQUES and that was it:

Mar 22 21:38:53 (none) daemon.info dhclient: DHCPACK from 192.168.1.1
Mar 22 21:38:56 (none) daemon.info dhclient: bound to 192.168.1.3 --
renewal in 302912 seconds.
Mar 22 09:38:57 (none) daemon.info dhclient: Killed old client process
binding to user-specified port 68
Mar 22 09:39:06 (none) daemon.info dhclient: DHCPREQUEST on eth0 to
255.255.255.255 port 67
Requesting: mdl0 as upstream: Y downstream: N
Requesting: eth0.1150 as upstream: N downstream: Y
Requesting: eth0.1250 as upstream: N downstream: Y
Requesting: eth0.1350 as upstream: N downstream: Y
Mar 22 09:39:09 (none) daemon.info dhcrelay: Internet Systems Consortium
DHCP Relay Agent 4.3.5
Internet Systems Consortium DHCP Relay Agent 4.3.5
Mar 22 09:39:09 (none) daemon.info dhcrelay: Copyright 2004-2016 Internet
Systems Consortium.
Copyright 2004-2016 Internet Systems Consortium.
Mar 22 09:39:09 (none) daemon.info dhcrelay: All rights reserved.
All rights reserved.
Mar 22 09:39:09 (none) daemon.info dhcrelay: For info, please visit
https://www.isc.org/software/dhcp/
For info, please visit https://www.isc.org/software/dhcp/
Mar 22 09:39:09 (none) daemon.info dhcrelay: Listening on
LPF/eth0.1350/04:a3:16:e2:2e:b8
Listening on LPF/eth0.1350/04:a3:16:e2:2e:b8
Mar 22 09:39:09 (none) daemon.info dhcrelay: Sending on
LPF/eth0.1350/04:a3:16:e2:2e:b8
Sending on   LPF/eth0.1350/04:a3:16:e2:2e:b8
Mar 22 09:39:09 (none) daemon.info dhcrelay: Listening on
LPF/eth0.1250/04:a3:16:e2:2e:b8
Listening on LPF/eth0.1250/04:a3:16:e2:2e:b8
Mar 22 09:39:09 (none) daemon.info dhcrelay: Sending on
LPF/eth0.1250/04:a3:16:e2:2e:b8
Sending on   LPF/eth0.1250/04:a3:16:e2:2e:b8
Mar 22 09:39:09 (none) daemon.info dhcrelay: Listening on
LPF/eth0.1150/04:a3:16:e2:2e:b8
Listening on LPF/eth0.1150/04:a3:16:e2:2e:b8
Mar 22 09:39:09 (none) daemon.info dhcrelay: Sending on
LPF/eth0.1150/04:a3:16:e2:2e:b8
Sending on   LPF/eth0.1150/04:a3:16:e2:2e:b8
Mar 22 09:39:09 (none) daemon.info dhcrelay: Listening on
LPF/mdl0/00:0d:ca:00:0e:15
Listening on LPF/mdl0/00:0d:ca:00:0e:15
Mar 22 09:39:09 (none) daemon.info dhcrelay: Sending on
LPF/mdl0/00:0d:ca:00:0e:15
Sending on   LPF/mdl0/00:0d:ca:00:0e:15
Mar 22 09:39:09 (none) daemon.info dhcrelay: Listening on
LPF/eth0/04:a3:16:e2:2e:b8
Listening on LPF/eth0/04:a3:16:e2:2e:b8
Mar 22 09:39:09 (none) daemon.info dhcrelay: Sending on
LPF/eth0/04:a3:16:e2:2e:b8
Sending on   LPF/eth0/04:a3:16:e2:2e:b8
Mar 22 09:39:09 (none) daemon.info dhcrelay: Sending on   Socket/fallback

!!! LOG ends here ... no repeat to DHCPREQUEST on eth0???

May there be problem with my client config? But same scenario does not
repeat every time, usually works ok.
dhclient.conf for eth0 has:
timeout 300;
retry 60;
reboot 90;
select-timeout 0;
initial-interval 2;

DHCP clients and relay run like this:
/usr/sbin/dhclient -nw -p 17788 -pf /var/run/dhclient-air.pid -cf
/etc/dhcp/dhclient-air.conf -lf /home/db/dhclient-air.leases -sf
/etc/dhclient-air-script eth1
/usr/sbin/dhclient -nw -p 68 -pf /var/run/dhclient.pid -cf
/etc/dhcp/dhclient.conf -lf /home/db/dhclient.leases -sf
/etc/dhclient-script eth0
/usr/sbin/dhcrelay -a -U eth0 -iu eth1 -id eth0.1150 -id eth0.1250 -id
eth0.1350 10.210.1.2

Can someone please comment on this?
Thank you very much.

RegK
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/dhcp-users/attachments/20180322/f466d4c2/attachment.html>


More information about the dhcp-users mailing list