Assign fixed addresses for a group of hosts

Reinhard Brandstaedter Reinhard.Brandstaedter at jku.at
Tue Jan 30 12:04:30 UTC 2007


On Tue, 2007-01-30 at 10:55 +0000, Simon Hobson wrote:
> Reinhard Brandstaedter wrote:
> 
> >Is it possible to assign fixed IP addresses based on dhcp-eval
> >expressions?
> >What I want is that a host whose MAC ends in "01" gets the IP .101
and
> >the DNS name jboss-1. Dynamically of course, without multiple host
> >statements. I know this is not very useful in the most common
scenarios
> >but my "jboss" hosts are Xen Virtual machines and I can completely
> >control their MAC addresses so that there are no duplicates (two MACs
> >ending in the same number)
> 
> You could try classes :
> class "1" {< match if mac ends in 01> }
> 
> ...
> 
>    pool {
>      allow members of "1" ;
>      range x.y.z.101 ;
>    }

Well, that's the same as if I'd add a static definition for every host,
which is what I want to avoid.
Assume I have 8 machines with MAC addresses
xx:xx:xx:xx:xx:[01-08]
and I want them to be assigned IP addresses
192.168.1.[101-108]
without explicit "host" entries in the dhcpd.conf.
I'm thinking of a "adaptive host" statement like:

host jboss-$X {
	hardware ethernet xx:xx:xx:xx:xx:$X
	option host-name "jboss-$X";
        ddns-hostname "jboss-$X";
	fixed-address 192.168.1.10$X
}

Where $X is "calculated" via dhcp-eval.

Reinhard




More information about the dhcp-users mailing list