Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements
Webcast-Catalyst9k
New Member

Secondary IP Address and DHCP

Hi Friends,

I've configured my router LAN interface with secondary IP address, with & without ip-helper address.

Option (1)

interface GigabitEthernet0/0

description *** To LAN ***

ip address 192.212.32.1 255.255.255.128 secondary

ip address 192.234.212.1 255.255.254.0

Option (2)

interface GigabitEthernet0/0

description *** To LAN ***

ip address 192.212.32.1 255.255.255.128 secondary

ip address 192.234.212.1 255.255.254.0

ip helper-address 192.100.229.201

In Option (1) I've configured DHCP pool for both the subnets (primary & secondary) in the router itself and in Option (2), DHCP pool has been configured on the DHCP server for both the subnets.

My question is, will my PCs get ip address from the secondary subnet pool in Option (1) or Option (2)?

Thanks,

Ameen Ahmed.

1 ACCEPTED SOLUTION

Accepted Solutions

Secondary IP Address and DHCP

Ahmed,

For Option 1: As Milan mentioned, if you have configured a DHCP pool with a primary subnet and a secondary network as well, then first the primary pool would be exhausted and then secondary pool would be used to allocate the ip address. And again I cannot say that I have implemented this in any live scenario but logically it makes sense for the introduction of this "secondary" feature in DHCP pool

For Option 2: There is a way to get ip address for secondary subnet from a DHCP server which is not the router itself. You need to have "ip dhcp smart-relay" command configured in the router which will again use the same basic principle as above i.e first the primary pool would be exhausted and then if the router do not see any response from the DHCP request, then router will send another DHCP request with giaddr set as the secondary ip address configured on the interface. And this I have seen working on live networks

Here is the language mentioned on Cisco website:

If the ip dhcp smart-relay command is configured, the relay agent counts the number of times the client retries sending a request to the DHCP server when there is no DHCPOFFER message from the DHCP server. After three retries, the relay agent sets the gateway address to the secondary address. If the DHCP server still does not respond after three more retries, then the next secondary address is used as the gateway address.

This functionality is useful when the DHCP server cannot be configured to use secondary pools.

http://www.cisco.com/en/US/docs/ios/ipaddr/configuration/guide/iad_dhcp_rly_agt_ps6350_TSD_Products_Configuration_Guide_Chapter.html

Hope it helps.

Neeraj

5 REPLIES

Secondary IP Address and DHCP

Hi,

a small possibility in  Option (1):

"The DHCP server identifies which DHCP address pool to use to service a client request as follows:

If the client is not directly connected (the giaddr field of the DHCPDISCOVER broadcast message is nonzero), the DHCP server matches the DHCPDISCOVER with a DHCP pool that has the subnet that contains the IP address in the giaddr field.

If the client is directly connected (the giaddr field is zero), the DHCP server matches the DHCPDISCOVER with DHCP pools that contain the subnets configured on the receiving interface. If the interface has secondary IP addresses, the subnets associated with the secondary IP addresses are examined for possible allocation only after the subnet associated with the primary IP address (on the interface) is exhausted."

Read details in

http://www.cisco.com/en/US/customer/docs/ios-xml/ios/ipaddr_dhcp/configuration/12-4/config-dhcp-server.html

HTH,

Milan

Secondary IP Address and DHCP

Hi Ameen,

In General when you have multiple scopes for multiple subnets created in DHCP server then the ip helper-address will be one (DHCP server address).

In your case you have created two subnets (primary & secondary) under one LAN interface and pointed ip helper-address to DHCP server.

So if dhcp broadcast / unicast query send from any particular subnet it will directly go to the DHCP server as long as the ip helper-address pointed to that.
So as like above if dhcp broadcast query send from your secondary subnet even it will go directly to DHCP server only as long as the ip helper-address is same.


Hope the above clear and understand you.

Please rate all the helpfull posts.
Regards,
Naidu.

New Member

Secondary IP Address and DHCP

Milan, I had read that in Cisco, but will that work in practical scenario?

Naidu, my question was, wheather the LAN clients get an IP from both the subnet pools or not? or only from the primary subnet pool?

Anyone here have a practical exp over this?

Bronze

Secondary IP Address and DHCP

I think the clients will get ips from primary pool in option 1, because your default-router option in dhcp pool is set to primary ip address and the router doesn't know if the client belongs to secondary pool. If you want clients to get ip addresses from both pools, you may need to configure subinterfaces with dot1q.

In the option 2, i think the DHCP server will use the source ip address of the interface to decide from which pool to assign ip addresses. The reason is that as you know routers does not broadcast traffic. Since a DHCP request is a broadcast, with source ip 0.0.0.0 and destination 255.255.255.255, router will replace the source with its own primary ip address and destination will be the ip helper address configured. DHCP will look at the source and will choose and ip address from the pool configured with network address that includes the source ip address.

More info

http://www.cisco.com/en/US/tech/tk648/tk361/technologies_tech_note09186a00800f0804.shtml

http://allaboutmylife.wordpress.com/2007/10/17/ip-helper-addresses-for-dhcp/

Hope it helps

Eugen

Secondary IP Address and DHCP

Ahmed,

For Option 1: As Milan mentioned, if you have configured a DHCP pool with a primary subnet and a secondary network as well, then first the primary pool would be exhausted and then secondary pool would be used to allocate the ip address. And again I cannot say that I have implemented this in any live scenario but logically it makes sense for the introduction of this "secondary" feature in DHCP pool

For Option 2: There is a way to get ip address for secondary subnet from a DHCP server which is not the router itself. You need to have "ip dhcp smart-relay" command configured in the router which will again use the same basic principle as above i.e first the primary pool would be exhausted and then if the router do not see any response from the DHCP request, then router will send another DHCP request with giaddr set as the secondary ip address configured on the interface. And this I have seen working on live networks

Here is the language mentioned on Cisco website:

If the ip dhcp smart-relay command is configured, the relay agent counts the number of times the client retries sending a request to the DHCP server when there is no DHCPOFFER message from the DHCP server. After three retries, the relay agent sets the gateway address to the secondary address. If the DHCP server still does not respond after three more retries, then the next secondary address is used as the gateway address.

This functionality is useful when the DHCP server cannot be configured to use secondary pools.

http://www.cisco.com/en/US/docs/ios/ipaddr/configuration/guide/iad_dhcp_rly_agt_ps6350_TSD_Products_Configuration_Guide_Chapter.html

Hope it helps.

Neeraj

27787
Views
15
Helpful
5
Replies
CreatePlease to create content