Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3289
  • Last Modified:

dhcpd.conf setup question

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
theaussie
Asked:
theaussie
  • 2
1 Solution
 
jlevieCommented:
# 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
 
theaussieAuthor Commented:
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
 
jlevieCommented:
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
 
uptimecustomercareCommented:
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

[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now