dhcp v4 server bypassing relay agent ip addr and directly replying to ciaddr

Alan DeKok aland at deployingradius.com
Wed Mar 20 13:06:41 CET 2019


On Mar 20, 2019, at 3:46 AM, Katuri, Vikram <Vikram.Katuri at viasat.com> wrote:
> 
> I am facing a problem with v4 dhcp where the server is not sending replies to the relay agent ip addr(from which it received discover), but rather sending directly to ciaddr(the client that sent discover to the relay agent).

  The debug log shows it's supposed to be send to giaddr, so at least part of the logic is OK.

>      Discover from my client targeted at the relay is making its way to the dhcp server , but the offer packet from the server is bypassing the relay and directly landing onto the client.
> 
> from the pcap it appears that the server (v4) is stripping off the ciaddr and giaddr in the offer packer.
> 
> 
> tcpdump on the server:
> ------------------------
> 
> 07:38:46.865317 IP 10.43.18.35.67 > 10.43.18.95.67: BOOTP/DHCP, Request from 00:a0:bc:00:00:02, length 300
> 07:38:46.867240 IP 10.43.18.95.67 > 10.43.18.124.67: BOOTP/DHCP, Reply, length 300

  OK...

> 07:38:46.869644 IP 10.43.18.35.67 > 10.43.18.95.67: BOOTP/DHCP, Request from 00:a0:bc:00:00:02, length 300
> 07:38:46.870689 IP 10.43.18.95.67 > 10.43.18.124.67: BOOTP/DHCP, Reply, length 300
> 
> .124(client) -- > .35(relay agent) --> .95(server)
>           ^_ _ _ _ _ _ _ _ _ _ _ _ __ _ _ _ |

  OK...

> (0)  Received DHCP-Discover XID 00000000 from 10.43.18.35:67 to 10.43.18.95:67 via eth1 
> (0)    &DHCP-Opcode = Client-Message
> (0)    &DHCP-Hardware-Type = Ethernet
> (0)    &DHCP-Hardware-Address-Length = 6
> ...
> (0)    &DHCP-Gateway-IP-Address = 10.43.18.35

  That's good.

> (0)  Sent DHCP-Offer XID 00000000 from 10.43.18.95:67 to 10.43.18.35:67 via eth1 

  So it's *supposed* to go to giaddr.

> Reply will be unicast to CIADDR from original packet.

  Hmm... that's likely the problem.  It should be automatically using the giaddr field from the original packet, and it's not doing that.

  I'll push a fix.

  Alan DeKok.




More information about the Freeradius-Users mailing list