2

I think DHCP isn't working because the GIADDR is not the source IP address, as this page says it should be:

[The DHCP relay agent] Changes the source IP address of the DHCPDISCOVER message to the IP address of the interface on which the broadcasted DHCPDISCOVER was received.

Requests go through but the replies don't come back to the client or relay agent.

The setup: I've got a hypervisor with dnsmasq on a VM. The hypervisor acts as my router and relay agent for the locally-connected switch (client subnet).

  • dnsmasq (10.0.0.5)
  • client subnet: 192.168.0.0/24
  • router/relay agent (dhcp-helper):
    • client-subnet interface: eth1.2 (192.168.0.1)
    • DHCP-VM interface: venet0 (10.0.0.1)
    • WAN interface: eth0 (1.2.3.4)

Based on the packet captures from the dnsmasq VM, it looks like the problem is that the DHCPDISCOVER is being sent from eth0 (WAN interface) but, like the protocol stipulates, is being replied to via GIADDR (eth1.2).

14:28:33.152534 IP (tos 0x0, ttl 64, id 42501, offset 0, flags [none], proto UDP (17), length 328)
1.2.3.4.67 > 10.0.0.5.67: [udp sum ok] BOOTP/DHCP, Request from de:ad:be:ef:ca:fe, length 300, hops 1, xid 0xbebfc411, Flags [none] (0x0000)
  Gateway-IP 192.168.0.1
  Client-Ethernet-Address de:ad:be:ef:ca:fe
  Vendor-rfc1048 Extensions
    Magic Cookie 0x63825363
    DHCP-Message Option 53, length 1: Discover
    Parameter-Request Option 55, length 13: 
      Subnet-Mask, BR, Time-Zone, Classless-Static-Route
      Domain-Name, Domain-Name-Server, Hostname, YD
      YS, NTP, MTU, Option 119
      Default-Gateway
    Client-ID Option 61, length 7: ether de:ad:be:ef:ca:fe

14:28:36.153602 IP (tos 0xc0, ttl 64, id 40806, offset 0, flags [none], proto UDP (17), length 332)
10.0.0.5.67 > 192.168.0.1.67: [udp sum ok] BOOTP/DHCP, Reply, length 304, hops 1, xid 0xbebfc411, Flags [none] (0x0000)
  Your-IP 192.168.0.29
  Server-IP 127.0.0.2
  Gateway-IP 192.168.0.1
  Client-Ethernet-Address de:ad:be:ef:ca:fe
  Vendor-rfc1048 Extensions
    Magic Cookie 0x63825363
    DHCP-Message Option 53, length 1: Offer
    Server-ID Option 54, length 4: 127.0.0.2
    Lease-Time Option 51, length 4: 43200
    RN Option 58, length 4: 21600
    RB Option 59, length 4: 37800
    Subnet-Mask Option 1, length 4: 255.255.255.0
    BR Option 28, length 4: 192.168.0.255
    Domain-Name-Server Option 6, length 4: 127.0.0.2
    Domain-Name Option 15, length 10: "example.net"
    Default-Gateway Option 3, length 4: 192.168.0.1

It seems to me that the source IP address should be the GIADDR (192.168.0.1). I don't see how to configure this in dhcp-helper the DHCP relay agent. Any ideas how to resolve the problem?

closed as off-topic by Ron Maupin Mar 19 '18 at 18:35

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "NE is a site for to ask and provide answers about professionally managed networks in a business environment. Your question falls outside the areas our community decided are on topic. Please visit the help center for more details. If you disagree with this closure, please ask on Network Engineering Meta." – Ron Maupin
If this question can be reworded to fit the rules in the help center, please edit the question.

1

[The DHCP relay agent] Changes the source IP address of the DHCPDISCOVER message to the IP address of the interface on which the broadcasted DHCPDISCOVER was received.

This is incorrect. The relay agent forwards the DHCPDISCOVER packet as a broadcast or unicast packet to the DHCP server. The source address of the packet will change, but it will be the source address of the interface on the same network as the DHCP server.

The GIADDR, unless it is 0.0.0.0, will not change. Otherwise, the relay will change GIADDR to the IP of the interface on which the original DHCPDISCOVER was received.

Not the answer you're looking for? Browse other questions tagged or ask your own question.