Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm running Ubuntu 10.04 on my home router which has multiple network interfaces. I have dhcpd configured to provide addresses from 192.168.1.0/24 subnet on certain interface. However, I'd like to also provide addresses from 192.168.2.0/24 subnet for another interface. How can I configure dhcpd to do so? Or, if I use another DHCP server software, for example, dnsmasq - how can that be configured to do the same thing?

share|improve this question
add comment

1 Answer 1

up vote 5 down vote accepted

In (I believe) /etc/default/dhcp3-server, add the line

INTERFACES="eth0 eth1"

Now in the dhcpd.conf configuration file, you define two different subnet and the respective options.

subnet 192.168.1.0 netmask 255.255.255.0 {
    option subnet-mask 255.255.255.0;
    option routers 192.168.1.1;
    range 192.168.1.100 192.168.1.200;
}

subnet 192.168.2.0 netmask 255.255.255.0 {
    option subnet-mask 255.255.255.0;
    option routers 192.168.2.1;
    range 192.168.2.100 192.168.2.200;

}

This assumes of course that one interface is addressed correctly on 192.168.1.0 and the other interface is addressed correctly on 192.168.2.0.

share|improve this answer
1  
Damn, you beat me to it! +1. Just note that the filenames may have changed. Debian renamed dhcp-server to isc-dhcp-server, but I'm not sure how recently that happened and whether or not Ubuntu 10 includes the renamed packages. –  Alexios May 2 '12 at 12:42
    
Oh that was on the surface! But that implies that the interfaces must belong to networks they give the addresses from (which is not the problem). –  mbaitoff May 2 '12 at 18:42
    
hi guys sorry for interrupt, I need a help on dhcp server. Could you check this one unix.stackexchange.com/questions/140387/… –  rajcoumar Jul 3 at 7:47
add comment

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.