[Dnsmasq-discuss] DHCP for multiple subnets - hostname to IP mapping
Simon Kelley
simon at thekelleys.org.uk
Wed Oct 6 16:00:06 BST 2010
Brandl, Tobias wrote:
> Hi,
>
> I'm struggling for a couple of days now with the DHCP setup in my sample
> network environment. Here's what I'm trying to do:
> * I'm setting up an environment where severs should get their IPs via
> DHCP name -> IP mapping (fixed or static IP)
> * Each server has two NICs, one used in a client LAN (192.168.1.0/24)
> and one in a backend LAN (storage access, etc. - 192.168.101.0/24)
> * Each server should get IPs for the different subnets based on the
> hostname provided, e.g.
> ** requesting an IP for server01(.clnt.localnet) via the client LAN
> should be mapped to 192.168.1.10
> ** requesting an IP for server01(.bknd.localnet) via the backend LAN
> should be mapped to 192.168.101.10
>
> I think I've tried almost every combination of dhcp-host, dhcp-range,
> dhcp-fqdn, and /etc/hosts entries without any success.
> I'm either getting "no address available" once the second interface
> comes up or it receives an IP different from the one set in /etc/hosts -
> even though dnsmasq logs show that the name is "known" (matching
> dhcp-host entry found).
>
> Could anyone please help to sort this out?
>
> If needed I will post my dnsmasq.conf and /etc/hosts entries, but maybe
> this can be answered generically.
>
Something like this? Not tested, but I think OK, and certainly a
starting point.
dhcp-range=192.168.1.0,static
dhcp-range=192.168.101.0,static
domain=clnt.localnet,192.168.1.0/24
domain=bknd.localnet.192.168.101.0/24
dhcp-fqdn
dhcp-host=server01,192.168.1.10
dhcp-host=server01,192.168.101.10
dhcp-host=server02,192.168.1.11
dhcp-host=server02,192.168.101.11
etc,
etc
It sounds like you were on the right track, but maybe didn't have the
domains set properly.
Cheers,
Simon.
More information about the Dnsmasq-discuss
mailing list