How to name department under DHCP server

uknet80
uknet80 used Ask the Experts™
on
Hello Experts,

I have been give a task to configure Linux DHCP server, we have big number of users and different departments. My question is how to name each department under dhcpd.conf file.

Example: as you know below is used to create a range of IP,
    subnet 239.252.197.0 netmask 255.255.255.0 {
      range 239.252.197.10 239.252.197.250;

but I want to specify name of department to make easer to read, not just at comment but also within configuration.  Is that possible?

Thanks
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
perhaps u can assign a (sub) domain name for each IP range
e.g.
subnet 239.252.197.0 netmask 255.255.255.0 {
    range 239.252.197.10 239.252.197.250;
    option domain-name "dept.domainname.local";

}
Are you looking for DNS Names?
Are the different networks on different physical interfaces?

shared-network example.com {
subnet 10.0.0.0 netmask 255.0.0.0 {
pool {
option default-ip-ttl 1;
option default-tcp-ttl 1;
option domain-name "accounts.net";
option domain-name-servers 127.0.0.1;
option ip-forwarding off;
option routers 127.0.0.1;
default-lease-time 300;
max-lease-time 300;
range 10.123.123.1 10.123.123.254;
}
}
subnet 192.168.0.0 netmask 255.255.255.0 {
pool {
option default-ip-ttl 1;
option default-tcp-ttl 1;
option domain-name "supportdepartment.net";
option domain-name-servers 127.0.0.1;
option ip-forwarding off;
option routers 127.0.0.1;
default-lease-time 300;
max-lease-time 300;
range 192.168.0.100 192.168.0.109;
}
}
}

not sure if that is what you are looking for.

You could try using classes, and subclasses, but you will have to either do some mac address definitions, or you can specify per interface, if they are on different Interfaces.

Check
http://linux.die.net/man/5/dhcpd.conf
ye basically what raysonlee said! :)

Author

Commented:
the purpose for my question was for easy reading:
for host you have (host computer_name).
I was wandering if there was any similer variable for subnet too.  I would say best is to use comment #

At the same time can you guys tell me the difference between subnet and pool.
as i can specify range of address withing subnet, then why to have pool?
A range is just a range of addresses.
In a pool declaration you can specify the same range, but the clients are treated differently.

Example:
class "technical" {
  match pick-first-value (option dhcp-client-identifier, hardware);
}
class "accounts" {
  match pick-first-value (option dhcp-client-identifier, hardware);
}
subclass "technical" 11:33:0:2d:7c:40:ad;
subclass "accounts" 1:8:0:2b:a9:cc:e3;
subclass "technical" 1:0:0:c4:aa:29:44;
subnet 10.0.0.0 netmask 255.255.255.0 {
  pool {
    allow members of "technical";
    max-lease-time 340000;
    range 10.0.0.11 10.0.0.50;
  }
  pool {
    allow members of "accounts";
    max-lease-time 6000;
    range 10.0.0.51 10.0.0.100;
  }
}

Open in new window

-------

As you can see the max lease time is different for "Technical"
and "Accounts"

Author

Commented:
in that case mac address must be specified to be directed to different pools.

how about excluding IP address from rang of IP. is that possible or I have to assign a mac address to that IP address to excluded?
You will have to use multiple range statements
range 192.168.1.2 192.168.1.20;
range 192.168.1.23 192.168.1.30;
The above will exclude 21 and 22

Author

Commented:
I am going to ask you one last question, as you have a good knowledge.

My Linux DHCP server take more that 1 minutes to provide IP addresses to client, that happen when i switch PC cable connection with another DHCP server located on another network and switch it back to Linux DHCP server.  the other DHCP server that is located on another devise called MiKroTik provide IP address to client within 3 - 4 seconds. it is located behind routers and firewall.


my Linux DHCP server is on a single segment no router, client connect through switch to DHCP server. Firewall + seLinux has been disabled.

IP address of Linux DHCP server
IP            192.168.2.1
subnet:   255.255.255.0
Gateway: none


DHCP configuration:

#ddns-update-style interim;
athurative;
ddns-update-style none;
#ignore client-updates;

#log-facility local7;

subnet 192.168.2.0 netmask 255.255.255.0 {

# --- default gateway
        option routers                  192.168.2.1;
        option subnet-mask              255.255.255.0;

        range dynamic-bootp 192.168.2.128 192.168.2.254;
        default-lease-time 60;
        max-lease-time 1620;
}


any idea my the Linux DHCP server take that long time to provide IP address?

thanks

Author

Commented:
thanks for your help

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial