dhcpd.conf

Hi,
I'm maintaining a linux server which servers more than 100 peoples. I'd like to add dhcpd service to all users.

The server has 3 nic, the ip address is:
1. private IP: 109.10.X.X
2. private IP: 192.168.1.1
3. public IP: 202.X.X.X

I'd like to provide the following dhcpd services:
1. dhcpd on 1 and 2 nic, but not on 3.
2. fixed ip for 109.10 network by host name and workgroup name, the host name may be same for different workgroup
3. dynamic ip for 192.168.1, this is for customers' laptop so they can access internet.

I'm new to dhcpd and linux, would you like to give me a sample dhcpd.conf so I do not need to try by myself? or at least a sample for the 3 conditions.

Best Regards

How can I config the dhcpd.conf?
hk22Asked:
Who is Participating?
 
tdaoudCommented:

Here is a sample of threee NICs with one public not used, and two privates with some fixed assigned IP addresses in each in addition to dynamic ones in each.

To reserve/assign ip addresses you will need the MAC address of the NIC (on windows 95/98 stations you can get it by running the command "winipcfg", and on windows NT/2000 by running the command "ipconfig /all")

#Sample begins here------------------------
#
server-identifier 192.88.5.1;
# default for all subnets, otherwise include in each one
default-lease-time 604800;
#
# public subnet....no dhcp
#
subnet 192.119.X.XXX netmask 255.255.255.248{}
#
# private subnet one
#
subnet 192.88.5.0 netmask 255.255.255.0{
        range  192.88.5.200 192.88.5.254;
        max-lease-time 1209600;
        option domain-name  "domain.name";
        option domain-name-servers 192.88.5.1;
        option routers   192.88.5.1;
        option subnet-mask   255.255.255.0;
        host FixedHost1 {
                hardware ethernet 00:60:04:EC:44:09;
                fixed-address 192.88.5.99;
        }      
        host FixedHost2 {
                hardware ethernet 00:60:04:EC:44:09;
                fixed-address 192.88.5.98;
        }      
}      
#
# private subnet two
#
subnet 192.88.4.0 netmask 255.255.255.0{
        max-lease-time 64800;
        range  192.88.4.100 192.88.4.254;
        option domain-name "domain.name";
        option domain-name-servers  192.88.4.1;
        option routers     192.88.4.1;
        option subnet-mask       255.255.255.0;
        host FixedHost1 {
                hardware ethernet 00:02:02:2c:32:e1;
                fixed-address 192.88.4.88;
        }
        host FixedHost2 {
                hardware ethernet 00:02:02:2c:34:70;
                fixed-address 192.88.4.89;
        }
        host FixedHost3 {
                hardware ethernet 00:02:02:2C:34:5C;
                fixed-address 192.88.4.90;
        }
        host FixedHost4 {
                hardware ethernet 00:15:4b:06:0b:7b;
                fixed-address 192.88.4.91;
        }
}

# Sample ends here

Good Luck

Tarik
0
 
HahoCommented:
here you go, a working sample from our server :)

# Global parameters
server-name "servername.domain.com";

# Interface parameters for private net
subnet 10.0.0.0 netmask 255.0.0.0 {
        range 10.0.0.1 10.0.0.254;
        default-lease-time 2592000;
        max-lease-time 2592000;
        option subnet-mask 255.0.0.0;
        option broadcast-address 10.255.255.255;
        option routers 10.0.0.x;
        option domain-name "domain.com";
        option domain-name-servers 192.x.x.x, 202.x.x.x, 202.x.x.x;
        option netbios-node-type 8;
        option netbios-name-servers 10.0.0.x;


}

# Interface parameters for public net
subnet 202.x.x.0 netmask 255.255.255.0 {
        option broadcast-address 202.x.x.255;
}

Cheers!
0
 
hk22Author Commented:
Hi,
Thanks for your comments.
And I'd like to get more from your sample. Can you show me how can I config to asign fixed ip address for hosts that in specified domain?

BR
0
 
HahoCommented:
got this from the net. this should assign the IP to a hostname..

> Can I use the following configuration:

> host host_name
> {
>      client-hostname "host_name";
>      fixed-address 206.246.50.2;
> }

No, but you can, in v3, do this:

  class "host-name-foo" {
    match if option host-name = "foo";
  }
  pool {
    range 206.246.50.2;
    allow members of "host-name-foo";
  }
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.