cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1815
Views
0
Helpful
8
Replies

Does switch uses interface IP/vlan IP when sending DHCP request?

getaway51
Level 2
Level 2

Hi,

 

When switch forward DHCP request to ip-helper (DHCP server), does it use loopback IP/interface IP/vlan IP?

May i know what is the settings in procedures, e.g when a client connected in vlan 20 tries to get DHCP?

any quick sample config?

 

8 Replies 8

Giuseppe Larosa
Hall of Fame
Hall of Fame

Hello getaway51,

the IP address of the L3 interface that received the DHCP request is placed in an internal field named gi address.

the packet is changed:

destination address from 255.255.255.255 to DHCP server unicast address (the one specified on the ip helper-address command)

the source address is changed from 0.0.0.0 to the IP address of the outgoing interface on the best path to the DHCP server.

 

The DHCP server uses the gi-address to find the correct DHCP scope to use to pick up a free IP address to be given to the client.

 

Hope to help

Giuseppe

 

if client is connected to vlan 10. What would be the gi address?

is it the int vlan 10 ip address?

Normally, yes. This also assumes there's an IP Helper that forwards the request.

BTW, by default, if GW also has secondary IPs, the only the main IP will be sent to the DHCP server.

I am sorry, what is mean by secondary and primary address? If the client connected via access mode to vlan 10, what is the gi address use for dhcp request to dhcp server?

is it the ip address configured under int vlan 10?

Possibly I shouldn't have mentioned secondary interfaces addresses, as likely I've confused you.

An interface can have "primary" address (just one) and zero, one or many additional "secondary" addresses. With an SVI, it allows a VLAN interface to support multiple networks concurrently.

Is the int vlan ip or interface ip use as gi primary address?

Hello getaway51,

>>

if client is connected to vlan 10. What would be the gi address?

is it the int vlan 10 ip address?

Absolutely yes, it is the L3 interface that receives the original not routable DHCP discovery from the client.

See also Martin's answer.

Populating the gi-address field is necessary to make the DHCP server able to choice the correct DHCP pool.

The translated packet may have a source IP address that is different from the gi-address this is why this internal field exists.

The loopback address is never used in DHCP relay operations.

 

Hope to help

Giuseppe

 

Martin L
VIP
VIP

sometimes wikipedia explains it well.

 

The relay agent stores its own IP address in field GIADDR field of the DHCP packet. The DHCP server uses the GIADDR-value to determine the subnet on which the relay agent received the broadcast, and allocates an IP address on that subnet. When the DHCP server replies to the client, it sends the reply to the GIADDR-address, again using unicast. The relay agent then retransmits the response on the local network.

from https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol

Review Cisco Networking for a $25 gift card