Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have 2 networks (192.168.1.0/24 & 192.168.2.0/24), and 1 DHCP server.
I need to serve DHCP for 2 networks, but it doesn't work. Second network (192.168.2.0/24) (PC & Notebook) always gets IP from 192.168.1.0/24 range despite that it has 2 ranges. How I should to configure it?

Router OS: Ubuntu Server 10.04
Client OS: Ubuntu 10.04

See UML

share|improve this question

migrated from stackoverflow.com Jun 21 '10 at 2:03

This question came from our site for professional and enthusiast programmers.

    
This should probably be moved to ServerFault.com –  David Smith Jun 19 '10 at 19:08
    
Why do you have two separate subnets? What are you trying to gain by doing this? It isn't clear from your diagram. Does the 'router' have two separate interfaces inside, one for 192.168.1.0 and one for 192.168.2.0 or one interface with both networks? Do you have multiple switches one for each subnet? –  Zoredache Jun 21 '10 at 3:16

2 Answers 2

The problem with two subnets is, how the dhcp server should decide which one to provide. I would give defined host entries for you computers:

host notebook {
    hardware ethernet 00:AB:CD:EF:GG:GG;
    fixed-address 192.168.2.10;
}
share|improve this answer
1  
No, the DHCP server will give an address that corresponds with the NIC where the request was received. This applies by extension to DHCP Proxies, using the NIC where the original DHCP Discover was received. –  Chris S Jun 21 '10 at 2:12

Is the DHCP server dual-homed (has an IP address on both networks)? Your DHCP server should have an interface listening on each subnet: one listening to the 192.168.1.0/24 network and the other listening to the 192.168.2.0/24 network. The startup for dhcpd should be configured to listen on each interface.

Dhcpd also has the option to create a shared network containing both subnets, but I think this will essentially pool your addresses and you won't be able to control which machines receive addresses for a particular subnet.

share|improve this answer
    
+1, You can also use a DHCP proxy if the server isn't on the subnet you want to serve, but it's generally not the best idea. –  Chris S Jun 21 '10 at 2:13

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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