cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
506
Views
8
Helpful
20
Replies

DHCP relay with NAT, DHCP server sending DHCPOFFER to wrong IP

AK0
Level 1
Level 1

I configured NAT and DHCP relay in GNS3, and all hosts have end-to-end reachability, I can ping PC44 from PC11 and PC22, and also from PC33 if I configure a static IP address.

On the NAT router (R11), I also configured DHCP relay with 'helper-address' on the LAN interface to which DHCP clients are connected. R11 is directly connected to R22. The DHCP server is on R22. There I configured a DHCP pool for hosts in network 192.168.33.0/24 (LAN connected to R11).

But because I am using NAT (PAT), all traffic from 192.168.33.0/24 is translated into an Inside Global address (200.1.1.1) on R22. The NAT is working. But the DHCP client connected to R11 can't get an IP address from DHCP server R22.

Debug (debug ip dhcp server packet) on R22 shows that DHCPDISCOVER messages are arriving. And DHCPOFFER are being sent.

Debug (debug ip packet detail) on R22 show that packets with source IP of the Inside Global address are arriving on R22, however it also shows that the DHCP server (R22) is sending back a reply to the destination of the leased IP address (for example 192.168.33.102), and not to the public address aka the Inside Global IP.... Is this normal behavior? Or am I missing a configuration setting on R22?

Edit: I added a screenshot of the network topology.

20 Replies 20

It seems like you may have potentially found a solution, unfortunately my router IOS doesn't support the ip dhcp-relay command.

this command in global not per-interface

MHM

All the commands I have are:

R22(config)#ip dhcp?
dhcp  dhcp-client  dhcp-server

 

R22(config)#ip dhcp ?
  aaa                        Configure aaa attributes
  binding                    DHCP address bindings
  bootp                      BOOTP specific configuration
  class                      Configure DHCP classes
  compatibility              Compatibility configuration
  conflict                   DHCP address conflict parameters
  database                   Configure DHCP database agents
  excluded-address           Prevent DHCP from assigning certain addresses
  limit                      Limit DHCP Lease
  limited-broadcast-address  Use all 1's broadcast address
  ping                       Specify ping parameters used by DHCP
  pool                       Configure DHCP address pools
  relay                      DHCP relay agent parameters
  smart-relay                Enable Smart Relay feature
  update                     Configure dynamic updates
  use                        Configure use of certain parameters during
                             allocation
R22(config)#ip dhcp relay ?
  information  Relay agent information option

R22(config)#ip dhcp relay info
R22(config)#ip dhcp relay information ?
  check      Validate relay information in BOOTREPLY
  option     Insert relay information in BOOTREQUEST
  policy     Define reforwarding policy
  trust-all  Received DHCP packets may contain relay info option with zero
             giaddr

 

 

Using the ip dhcp relay source-interface 
under the interface and you can see Now the R3( local DHCP server) send traffic to 100.0.0.2 instead of using 10.0.0.2

that solution for this case if you face it in feature 

MHM

Screenshot (362).png

Screenshot (363).png

That is probably the correct solution, so I will mark it as Accepted.

But my router IOS doesn't support either the ip dhcp relay source-interface interface command nor the global command. These are all the commands available in interface mode:

R11(config-if)#ip dhcp relay ?
  information  DHCP relay information option

 I also did the debug ip udp as you did, and it shows that R22 is sending UDP (DHCP) replies to the wrong IP (192.168.33.1), whereas in your example, it's sending it to the correct IP, so your solution is correct.

R22#debug ip udp 
UDP packet debugging is on
*Mar  1 00:09:55.436: UDP: rcvd src=200.1.1.1(67), dst=200.1.1.2(67), length=372
*Mar  1 00:09:55.444: UDP: sent src=199.1.2.1(67), dst=192.168.33.1(67), length=308
R22#
*Mar  1 00:09:56.449: UDP: rcvd src=200.1.1.1(67), dst=200.1.1.2(67), length=372
*Mar  1 00:09:56.457: UDP: sent src=199.1.2.1(67), dst=192.168.33.1(67), length=308
R22#
*Mar  1 00:09:59.470: UDP: rcvd src=200.1.1.1(67), dst=200.1.1.2(67), length=372
*Mar  1 00:09:59.470: UDP: sent src=199.1.2.1(67), dst=192.168.33.1(67), length=308

 

Yes me too, 
I try in eve-ng and couldnot find command then I go to gns3 and find command apply and share result

sorry this command I think depend on HW and SW 

MHM