Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
New Member

DHCP over different subnets using secondaries...

Hello,

I have a router with a primary and secondary subnet configured on the one physical interface (192.168.1.0/24 and 172.16.1.0/24 respectively). I have a DHCP server in the primary LAN with the IP address of 192.168.1.254 that I want to use to distribute IP addresses for machines in the secondary subnet with the scope 172.16.1.30-199.

My question is, can it be done? I have read in a previous post that it cannot. Can I use an "IP Helper" on this interface and point it at the DHCP servers IP address?

I have also read that I may need to install a DHCP relay on the server and multihome the NIC card so that it has an IP address for both subnets.

If it cannot be done and I need to do the "multi-homed" NIC approach on the server does anyone know why it doesn't work?

Thanks in advance,

Cameron.

3 REPLIES
New Member

Re: DHCP over different subnets using secondaries...

If I understand you correctly, this is what I think you've got on the interface (say, Ethernet0):

interface ethernet0

ip address 192.168.1.1 255.255.255.0

ip address 172.16.1.1 255.255.255.0 secondary

Assuming I have the right idea, there is no other router clouding the issue, and I'm not completely full of it... Your DHCP server will only serve up leases for the 192.168.1.0 subnet. The reasons:

-The router adds a "hint" to the DHCP request as it forwards it on to the IP HELPER-ADDRESS (DHCP server). The hint is about what subnet the requesting device is on, which can only be derived from what interface the request came from. Knowing that, the only subnet it can give is that of the *primary* IP address.

-The reason is that the router can't differentiate between the primary and secondary subnets on the interface, as the device doesn't have an IP address yet. Therefore, there's no way to tell which subnet the device wants to be on, since both subnets are on the same ethernet network.

So, the DHCP "hint" is why it won't work. The hint is only of the interface's primary subnet.

Now, you can "steer" the hint by swapping which subnet is primary and which is secondary. Like this:

interface ethernet0

ip address 172.16.1.1 255.255.255.0

ip address 192.168.1.1 255.255.255.0 secondary

But only the 172.16.1.0 subnet will be able to have DHCP address service, provided you DO NOT have a scope set up for 192.168.1.0...

Another possible way out is to have a second router, with interface subnets swapped, then play some games with access lists to prevent one router from forwarding DHCP requests from specific MAC addresses, and allowing the other to forward. Seems you'd have to have the DHCP server on a third subnet though. I'm pretty sure you wouldn't want to do that just because it seems like a real hassle.

I think you will probably end up having static addresses only on one subnet, and DHCP addresses on the other. If that's what you intend, either way (but not both) will work, depending on which subnet is primary, and which subnet your DHCP server has a scope for.

Whew! JimW

New Member

Re: DHCP over different subnets using secondaries...

Cameron,

I dont have secondary Ip addresses on one physical interface however I have multiple interfaces on my router which I have one subnet with a DHCP server. My DHCP server has scopes for all 20 subnets that I have. The IP helper addressed is being used on each interface and works perfectly. This forwards all mt bootp requests to the DHCP server. The DHCP Server looks at the gatewayIPHDR info and looks if it has a scope configured for that particular subnet of which the packet came from and then issues an address accordingly. Hope this helps

Joseph

New Member

Re: DHCP over different subnets using secondaries...

Cameron,

What you are asking for is possible and depends on the configuration of your DHCP server. What you want to do is associated the address pool for 172.16.1.30-199 with the subnet 192.168.1.0/24 so that when a DHCP request with the IP Helper Address (aka the GIADDR field in the DHCP request) of 192.168.1.1 comes in to the DHCP server, the server knows to allocate address out of the 172.16.1.30-199 address pool.

This is possible on the Windows 2000 DHCP server and the Cisco Network Registrar DHCP server. On the Windows 2000 DHCP server this is called "super scoping".

You would essential create two address pools and "link" them together. The first address pool would for the 192.168.1.0/24 subnet. You can create the address pool and not assign any addresses to the pool. The second pool would be 172.16.1.30-199. You would then "link" the second pool to the first pool. The DHCP server would see requests with the IP helper address of 192.168.1.1 and start to allocate addresses out of the first pool. When the pool is empty, the DHCP server would start to allocate addresses out fo the second pool.

Good Luck,

490
Views
0
Helpful
3
Replies
CreatePlease to create content