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?
Add a comment
|
1 Answer
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.
-
1Damn, you beat me to it! +1. Just note that the filenames may have changed. Debian renamed
dhcp-servertoisc-dhcp-server, but I'm not sure how recently that happened and whether or not Ubuntu 10 includes the renamed packages.Alexios– Alexios2012-05-02 12:42:00 +00:00Commented 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).mbaitoff– mbaitoff2012-05-02 18:42:21 +00:00Commented 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.2014-08-07 13:04:43 +00:00Commented Aug 7, 2014 at 13:04
-
Where is the addressing that ties the base+netmask to a particular ethernet interface?Dennis– Dennis2015-04-06 01:49:52 +00:00Commented Apr 6, 2015 at 1:49