advanced dhcpd.conf

advanced dhcpd.conf

Erez D erez0001 at gmail.com
Mon Jun 9 18:15:58 IDT 2014


On Mon, Jun 9, 2014 at 10:33 AM, geoffrey mendelson
<geoffreymendelson at gmail.com> wrote:
> On 6/9/2014 10:14 AM, Erez D wrote:
>>
>> i'm trying to match ip to macs
>>
>>
>> e.g.:
>> mac 00:11:22:33:44:01 -> 10.0.5.1
>> mac 00:11:22:33:44:02 -> 10.0.5.2
>> mac 00:11:22:33:44:03 -> 10.0.5.3
>> mac 00:11:22:33:44:04 -> 10.0.5.4
>>
>>
>>
>> it does not seem to work
>> is it possible to do that ?
>>
>>
>> highlights of dhcpd.conf:
>>
>> class "vm" {
>> match if binary-to-ascii (16,8,":",substring(hardware, 1, 5)) =
>> "0:11:22:33:44";
>> set lastMacByte=binary-to-ascii (10,8,":",substring(hardware, 6, 1);
>> set vmName=concat("VM-",lastMacByte);
>> set vmIp=concat("10.0.5.",lastMacByte);
>> }
>>
>
>
> Is this what you want?
>
> host danny3
>         {
>         fixed-address danny3;
>         hardware ethernet  00:11:95:8e:8d:80;
>          option host-name "danny3";
>         }
>
> dann3 resolves to the IP address I want.
>
> Geoff.
>
no, i want:
host vm01 { hardware ethernet 00:11:22:33:44:01 ; fixed-address 10.0.5.1 }
host vm02 { hardware ethernet 00:11:22:33:44:02 ; fixed-address 10.0.5.2 }
host vm03 { hardware ethernet 00:11:22:33:44:03 ; fixed-address 10.0.5.3 }
...
host vm254 { hardware ethernet 00:11:22:33:44:fe ; fixed-address 10.0.5.254 }

> --
> Geoffrey S. Mendelson 4X1GM/N3OWJ
> Jerusalem Israel.
>
>
> _______________________________________________
> Linux-il mailing list
> Linux-il at cs.huji.ac.il
> http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il



More information about the Linux-il mailing list