Solved

dhcpd.conf setup question

Posted on 2004-09-27
4
3,269 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 125 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

Scale it in WD Gold

With up to ten times the workload capacity of desktop drives, WD Gold hard drives employ advanced technology to deliver among the best in reliability, capacity, power efficiency and performance.

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…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

867 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

18 Experts available now in Live!

Get 1:1 Help Now