5

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?

1 Answer 1

6

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.

4
  • 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. Commented May 2, 2012 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). Commented May 2, 2012 at 18:42
  • @rajcoumar instead of hijacking other threads and bugging people, why don't you actually provide the information you were asked for? I am deleting your comment since it is completely inappropriate to comment on a 3 year old post requesting help with something completely different. Commented Aug 7, 2014 at 13:04
  • Where is the addressing that ties the base+netmask to a particular ethernet interface? Commented Apr 6, 2015 at 1:49

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.