DHCP-relay: strange behavour when specifing multiple interfaces
Oleg Gvozdev
jktu17 at gmail.com
Tue Jul 16 07:26:37 UTC 2013
Hello.
I'm using ISC DHCP package, 4.2.5-P1 version. I have a problem with
dhcrelay when using more than one "-i" options.
*Briefly: why requests are forwarded to dhcp-servers only through the last
(specified by -i switch) interface?*
In detail:
1.I have such network scheme:
CLIENTS(net0)<--->RELAY(net0-net1)<--->DHCP_SERVER(net1)
2. Dhcp server properly configured and running
3. Dhcp-relay run as this: *dhcrelay -i eth1 -i eth0 10.0.1.2*, where eth0
is net0, eth1 is net1, 10.0.1.2 - is dhcp server IP.
4.(BAD): When clients try to get lease, relay says: Forwarded BOORREQUEST
for ...MAC... to 10.0.1.2 and request realy forwarded to CLIENT(!!!)
through eth0 iface. And, of couse, no lease is got.
5.(GOOD): Now if we run relay as is:* dhcrelay -i eth0 -i eth1 10.0.1.2 *-all
is ok, request is now forwarded to SERVER through eth1 iface.
I've looked in code and saw, that (i use USE_SOCKETS) in line 724 in file
realy/dhcrelay.c such line ,which send request:
if (send_packet((fallback_interface ? fallback_interface : interfaces),
NULL, packet, length, ip->addresses[0], &sp->to, NULL) < 0) ....
I've not use fallback_interface, so the 1st param to send_packet() is
"struct interface_info *interfaces" array. Then send_packet() just use
sendto(fd,...), where fd - is descriptor of 1st element(1st interface) of
"interfaces" array. Also I use SO_BINDTODEVICE, so send_packet() writes to
different interfaces depending on the order of them in command line , and
in unpredictable order if i do not use "-i" at all.
So, behaviour of dhcrelay is different depending on the order of "-i"
params..
*Is it normal? What do you suggest in such situatuion?
*
Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/dhcp-users/attachments/20130716/0902fd97/attachment.html>
More information about the dhcp-users
mailing list