<div dir="ltr"><div><div><div><div><div>Hello.<br><br></div><div>I'm using ISC DHCP package, 4.2.5-P1 version. I have a problem with dhcrelay when using more than one "-i" options.<br></div><div><br></div><div>
<b>Briefly: why requests are forwarded to dhcp-servers only through the last (specified by -i switch) interface?</b><br></div><div><br><br><br></div>1.I have such network scheme:  CLIENTS(net0)<--->RELAY(net0-net1)<--->DHCP_SERVER(net1)<br>

<br></div>2. Dhcp server properly configured and running<br><br></div>3. Dhcp-relay run as this: <b>dhcrelay -i eth1 -i eth0 10.0.1.2</b>, where eth0 is net0, eth1 is net1, 10.0.1.2 - is dhcp server IP.<br><br></div>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.<br>
<br></div><div>5.(GOOD): Now if we run relay as is:<b> dhcrelay -i eth0 -i eth1 10.0.1.2  </b>-all is ok, request is now forwarded to SERVER through eth1 iface.<br><br></div><div>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:<br>

</div><div><br></div><div>if (send_packet((fallback_interface ? fallback_interface : interfaces), NULL, packet, length, ip->addresses[0], &sp->to, NULL) < 0) ....<br><br></div><div>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.<br>
<br>So, behaviour of dhcrelay is different depending on the order of "-i" params..  <br><br></div><div><b>Is it normal? What do you suggest in such situatuion? <br></b><br></div>Thanks.</div>