LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   issue in DHCP Server (https://www.linuxquestions.org/questions/linux-server-73/issue-in-dhcp-server-946922/)

snoopcd 05-25-2012 08:32 PM

issue in DHCP Server
 
Hi All,
i am trying to install DHCP Server
OS : Fedora 16
DHCP version : DHCP Server 4.2.3-P2

Code:

[root@ark ~]# ls -ltrh /etc/dhcp/dhcpd.conf
-rw-r--r-- 1 root root 1.6K May 26 03:05 /etc/dhcp/dhcpd.conf
[root@ark ~]#

Network Interface Card Configuration:-
sure it is statis IP's
Code:

[root@ark ~]# ifconfig -a
lo        Link encap:Local Loopback 
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:114 errors:0 dropped:0 overruns:0 frame:0
          TX packets:114 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:11614 (11.3 KiB)  TX bytes:11614 (11.3 KiB)

p5p1      Link encap:Ethernet  HWaddr 00:24:81:56:14:E3 
          inet addr:192.168.1.101  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::224:81ff:fe56:14e3/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:17866 errors:0 dropped:1491 overruns:0 frame:0
          TX packets:15265 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:13136772 (12.5 MiB)  TX bytes:2877417 (2.7 MiB)
          Interrupt:17

wlan0    Link encap:Ethernet  HWaddr 00:22:FA:8D:D7:6E 
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

[root@ark ~]#

my dhcpd.conf
Code:

#
# DHCP Server Configuration file.
#  see /usr/share/doc/dhcp*/dhcpd.conf.sample
#  see dhcpd.conf(5) man page
#
ddns-update-style interim
ignore client-update

subnet 192.168.1.0 netmask 255.255.255.0
{

        # the range if ip addresses the server
        # will issue to DHCP enabled PC clisnts
        # booting up on the network

        range 192.168.1.201 192.168.1.220;

        # set the amount of time in secands that
        # a client may keep the IP address

        default-lease-time 86400;
        max-lease-time 86400;

        # set the default gateway to be used by
        # the PC Clients
       
        option routers 192.168.1.101

        # Don't forward DHCP requests from this
        # NIC interface to any other NIC
        # interface
       
        option ip-forwarding off;

        # Set the broadcas address and subnet mask
        # to be used by the DHCP clients

        option broadcast-address 192.168.1.255;
        option subnet-mask 255.255.255.0;

        # Set the NTP server to be used by the
        # DHCP clients
       
        option ntp-servers 192.168.1.100;

        # Set the DNS server to be used by the
        # DHCP clients

        option domain-name-servers 4.2.2.2;

        # if you specify a WINS server for your windows clients,
        # you need to include the following option in the dhcpd.conf file:
       
        option netbios-name-servers 192.168.1.100

        # you can also assign specific IP addresses based on the clients'
        # ethernet MAC address as follows (Host's name is "laser-printer";
       
        host laser-printer
                {
                hardware ethernet 08:00:2b:4c:59:23;
                fixed-address 192.168.1.222;
                }
}
#
# List an unused interface here
#
subnet 192.168.2.0 netmask 255.255.255.0
{
}


doing this commands to start dhcpd service
Code:

[root@ark ~]# systemctl enable dhcpd.service
[root@ark ~]# chkconfig dhcpd on
Note: Forwarding request to 'systemctl enable dhcpd.service'.
[root@ark ~]# systemctl start dhcpd.service
[root@ark ~]# systemctl stop dhcpd.service
[root@ark ~]# systemctl restart dhcpd.service
[root@ark ~]# service dhcpd start
Redirecting to /bin/systemctl  start dhcpd.service
[root@ark ~]# service dhcpd stop
Redirecting to /bin/systemctl  stop dhcpd.service
[root@ark ~]# service dhcpd restart
Redirecting to /bin/systemctl  restart dhcpd.service
[root@ark ~]# systemctl restart dhcpd.service
[root@ark ~]# pgrep dhcpd
[root@ark ~]#

i can't start dhcp service
i got this result

Code:

[root@ark ~]# systemctl status dhcpd.service
dhcpd.service - DHCPv4 Server Daemon
          Loaded: loaded (/lib/systemd/system/dhcpd.service; enabled)
          Active: failed since Sat, 26 May 2012 03:30:47 +0200; 1min 1s ago
        Process: 3110 ExecStart=/usr/sbin/dhcpd -f -user dhcpd -group dhcpd --no-pid $DHCPDARGS (code=exited, status=1/FAILURE)
          CGroup: name=systemd:/system/dhcpd.service
[root@ark ~]#


baronobeefdip 05-25-2012 11:22 PM

there are some things that just don't go in the (or just don't get along with the dhcp daemon) in the subnet declaration, the only things i ever put in there are the
-subnet-mask
-option routers
and
-broadcast-address
on average this is what my dhcpd.conf file looks like
Code:

domain-name-servers 192.168.1.4;
domain-name "baronobeefdip.josh";
max-lease-time 10000;
default-lease-time 1000000;
authoritative;
subnet 192.168.1.0 255.255.255.0 {
range 192.168.1.50 192.168.1.254;
option routers 192.168.1.1;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.1.255;
}


snoopcd 05-26-2012 05:38 PM

Thanks baronobeefdip for you reply
i get trying to do the same as you post before
and trying to restart dhcp service and i got the same result as before
Code:

domain-name-servers 192.168.1.101;
domain-name "ark.alexandercorvinus.com";
max-lease-time 10000;
default-lease-time 1000000;
authoritative;
subnet 192.168.1.0 255.255.255.0 {
range 192.168.1.10 192.168.1.20;
option routers 192.168.1.101;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.1.255;
}


baronobeefdip 05-26-2012 11:55 PM

I am using Debian Squeeze as my server and here is what my dhcpd.conf file looks like, i just tested it and it works, in case the last post had some syntax errors in it try something like this one
Code:

option domain-name-servers 8.8.8.8;
option domain-name "baronobeefdip.josh";
default-lease-time 10000;
max-lease-time 100000;
authoritative;
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.55 192.168.1.254;
option routers 192.168.1.1;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.1.255;
}

what Linux distribution are you using? the dhcpd syntax should remain the same through not only all linux distributions but with all unix-like operating systems (OpenBSD has the same synntax too the difference between all these platforms is that each one is setup differently than all the others)

Normally I don't suggest this for educational purposes, i believe the one sure fire way of learning Linux real well is knowing how something works through the command line and the manual configurations of the text files but whenever something doesn't work out a GUI is a nice thing to have even though you won't always have the luxury of the GUI

my personal favorite gui when it comes to configuring the Linux Servers is WebMin
http://www.webmin.com/
it's a great way to configure server daemons through a web browser, it is also in it's own way remote accessable just type in the ip address along with the port number 10000 in a web browser on another computer and you'll have administrative control over it's daemons. personally i never used webmin for the dhcp server but you can give it a try and see what you think


All times are GMT -5. The time now is 07:19 PM.