Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

dhcpd.conf setup question

Posted on 2004-09-27
4
Medium Priority
?
3,283 Views
Last Modified: 2008-01-09
I have slackware 10 installed on my box with 2 nics.

eth0 is to be used for the internal LAN
eth1 is connected to the internet.

I need a simple configuration for dhcpd.conf that will give out IP's to the local LAN via eth0. Does anybody know of an example file that can used.?

This also needs to be set up so that no IP's are sent via eth1 by mistake.
0
Comment
Question by:theaussie
  • 2
4 Comments
 
LVL 40

Expert Comment

by:jlevie
ID: 12159951
# Global options
option domain-name "your-domain.tld";
option domain-name-servers 10.0.0.1;
                                                                               
authoritative;
ddns-update-style none;
                                                                               
subnet 10.0.0.0 netmask 255.255.255.0 {
  option subnet-mask 255.255.255.0;
  option broadcast-address 10.0.0.255;
  option routers 10.0.0.1;
  range 10.0.0.2 10.0.0.254;
}

Should work after adjustment for your domain and network. You'll want to use 'dhcpd eth0' to restrict the daemon to your inside NIC.
0
 

Author Comment

by:theaussie
ID: 12160070
jlevie - Can you explain what you mean by 'use dhcpd eth0'.

 I have my settings in rc.inet.conf for eth0 as:
# Config information for eth0:
IPADDR[0]="10.0.0.2"
NETMASK[0]=""
USE_DHCP[0]=""
DHCP_HOSTNAME[0]="slackbox"
# Config information for eth1:
IPADDR[1]=""
NETMASK[1]=""
USE_DHCP[1]="yes"
DHCP_HOSTNAME[1]=""

My dhcpd.conf
 # Global options
option domain-name "slackbox";
option domain-name-servers 10.0.0.1;
                                                                               
authoritative;
ddns-update-style none;
                                                                               
subnet 10.0.0.0 netmask 255.255.255.0 {
  option subnet-mask 255.255.255.0;
  option broadcast-address 10.0.0.255;
  option routers 10.0.0.1;
  range 10.0.0.2 10.0.0.254;
}
0
 
LVL 40

Accepted Solution

by:
jlevie earned 500 total points
ID: 12160658
Since your system has eth0 configured for 10.0.0.2 you'll need to use:

subnet 10.0.0.0 netmask 255.255.255.0 {
  option subnet-mask 255.255.255.0;
  option broadcast-address 10.0.0.255;
  option routers 10.0.0.2;
  range 10.0.0.3 10.0.0.254;
}

Also note that  "option domain-name "slackbox";" doesn't specify a valid domain. A domain name must contain at least one '.'. If you don't have a registered domain you could use "option domain-name "slacklocal.org";".

And you'll need to adust the IP specified in "option domain-name-servers". If you are running a DNS server on the Linux box you'd use eth0's IP. Otherwise you'll want to specify the IP of your ISP's name server.

> Can you explain what you mean by 'use dhcpd eth0'.

dhcpd is a daemon, which means that it runs all the time. Someplace during the boot process there has to be a command to start dhcpd and by making sure that the command line that does this uses 'dhcpd eth0' the daemon will only bind to the eth0 interface and thus only offer DHCP to the local network.
0
 
LVL 1

Expert Comment

by:uptimecustomercare
ID: 12258753
All linux system have a sample configuration file for dhcp.Try to locate the file using "find "
or "locate" command."locate" command is faster.

locate  dhcpd.co*

or

find / -name dhcpd.co*  -print


rename or copy  the sample file to  dhcpd.conf and move it to /etc/dhcp or /etc/dhcpd . Edit the file to suit your lan requirements.

restart the dhcpd service.

This is simple and should work.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

885 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