pick host entries depending on interface address?

Simon Hobson dhcp1 at thehobsons.co.uk
Fri Jan 8 16:29:43 UTC 2010


Antonio Goméz Soto wrote:

>I have the following problem:
>
>- given a linux system on a base network serving multiple sites
>- VoIP phones from different brands, that need different DHCP options.
>
>I didn't want to match on vendor-specific options, so initially I
>auto-generated the following file from the phone database:
>
>group { # Company empty
>   group { # Building office
>     option time-offset 3600;
>     shared-network OFFICENET {
>       subnet 10.0.0.0 netmask 255.255.255.0 { # OFFICE_IPNET
>         option routers 10.0.0.1;
>         range 10.0.0.100 10.0.0.200;
>         host phone-4-on-OFFICENET { # Aastra 55i
>           hardware ethernet 00:08:5D:19:73:4A;
>           option tftp-server-name "http://10.0.0.1/ps/aastra/cfg";
>         }
>         etcetera

NOTE - HOST STATEMENTS ARE GLOBAL IN SCOPE. As is 
stated on this list quite regularly, and in the 
warning I believe dhcpd now emits when starting 
up with a config like yours. Put simply they will 
NOT work like you are expecting. To be more 
specific, if you embed host statements in 
anything but the global scope then you will get 
option inheritance issues that you almost certain 
do not want.


>How do I get it to server the proper tftp-server-name values depending
>on the phones' vlan?

Do you want different options for different 
classes of device ? If not, then you can do 
something as simple as this :

subnet .... {
   option tftp-server-name "something" ;
   ...
}
subnet .... {
   option tftp-server-name "something else" ;
   ...
}

-- 
Simon Hobson

Visit http://www.magpiesnestpublishing.co.uk/ for books by acclaimed
author Gladys Hobson. Novels - poetry - short stories - ideal as
Christmas stocking fillers. Some available as e-books.



More information about the dhcp-users mailing list