Solved

dhcpd.conf

Posted on 2001-06-12
4
1,737 Views
Last Modified: 2012-06-27
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?
0
Comment
Question by:hk22
  • 2
4 Comments
 
LVL 1

Expert Comment

by:Haho
ID: 6184831
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
 

Author Comment

by:hk22
ID: 6184963
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
 
LVL 1

Expert Comment

by:Haho
ID: 6185271
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
 
LVL 3

Accepted Solution

by:
tdaoud earned 200 total points
ID: 6198138

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

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now