[Dnsmasq-discuss] dnsmasq for 2 networks with different gateways
/ dns servers / addresses /etc
Simon Kelley
simon at thekelleys.org.uk
Mon Aug 22 15:25:37 BST 2005
Eugene Prokopiev wrote:
> Hi,
>
> Help me please to translate this simple dhcpd.conf to dnsmasq:
>
> subnet 192.168.1.0 netmask 255.255.255.0 {
> option routers 192.168.1.1;
> option domain-name "mydomain.ru";
> option domain-name-servers 192.168.1.1;
> host P12 {
> hardware ethernet 00:01:80:0E:2F:8C;
> fixed-address 192.168.1.2;
> }
> }
> subnet 192.168.2.0 netmask 255.255.255.0 {
> option routers 192.168.2.1;
> option domain-name "mydomain.ru";
> option domain-name-servers 192.168.2.1;
> host P22 {
> hardware ethernet 00:01:80:0E:2F:8C;
> fixed-address 192.168.2.2;
> }
> }
>
domain=mydomain.ru
dhcp-range=192.168.1.0,static
dhcp-range=192.168.2.0,static
dhcp-host=00:01:80:0E:2F:8C,192.168.2.2
dhcp-host=00:01:80:0E:2F:8C,192.168.1.2
Is enough, assuming that the dnsmasq is running on the machine which is
the router and DNS server. If it isn't then you need something like this:
domain=mydomain.ru
dhcp-range=net1,192.168.1.0,static
dhcp-range=net2,192.168.2.0,static
dhcp-option=net1,3,192.168.1.1 # router
dhcp-option=net2,3,192.168.2.1
dhcp-option=net1,6,192.168.1.1 # dns server
dhcp-option=net2,6,192.168.2.1
dhcp-host=00:01:80:0E:2F:8C,192.168.2.2
dhcp-host=00:01:80:0E:2F:8C,192.168.1.2
Note that only the dhcp-host line with an address on the correct network
is used, so there's no need to tag those.
HTH
Simon.
More information about the Dnsmasq-discuss
mailing list