linux dhcp for window XP clients
Hi!
I want to run dhcp server for windows XP clients. At present I have copied dhcpd.conf.sample from /usr/share/docs/dhcp* to /etc/dhcpd.conf. After that I made little changes to this file as under: ddns-update-style interim; ignore client-updates; subnet 192.168.0.0 netmask 255.255.255.0 { # --- default gateway option routers 192.168.0.1; option subnet-mask 255.255.255.0; # option nis-domain "domain.org"; # option domain-name "domain.org"; option domain-name-servers 4.2.2.2; # option time-offset -18000; # Eastern Standard Time # option ntp-servers 192.168.1.1; # option netbios-name-servers 192.168.1.1; # --- Selects point-to-point node (default is hybrid). Don't change this unless # -- you understand Netbios very well # option netbios-node-type 2; range dynamic-bootp 192.168.0.128 192.168.0.254; default-lease-time 21600; max-lease-time 43200; # we want the nameserver to appear at a fixed address host ns { next-server marvin.redhat.com; hardware ethernet 12:34:56:78:AB:CD; fixed-address 207.175.42.254; } } This is a very basic fonfiguration but dhcpd service is not starting |
What distro are you running? What error message do you get when you try to start the daemon?
FWIW, here's a simple known-good dhcpd.conf from an old box of mine: Code:
ddns-update-style none; |
I am using Fedora 7 as Server
|
Quote:
|
I copied your details into my /etc/dhcpd.conf file but still
the service is getting failed. #service dhcpd restart FAILED Which log file should I refer to for more details and the reason of FAILED service. |
I think you'd need to check /var/log/messages for details.
My guess is you're probably missing your dhcpd.leases file. |
I think when you start the dhcpd daemon if it has some error it shows for sure, then do check and let us know then its easy to help.
thanks |
I checked up my /var/log/messages file and this is what I am getting:
Nov 26 20:05:08 localhost dhcpd: Internet Systems Consortium DHCP Server V3.0.5-RedHat Nov 26 20:05:08 localhost dhcpd: Copyright 2004-2006 Internet Systems Consortium. Nov 26 20:05:08 localhost dhcpd: All rights reserved. Nov 26 20:05:08 localhost dhcpd: For info, please visit http://www.isc.org/sw/dhcp/ Nov 26 20:05:08 localhost dhcpd: Not searching LDAP since ldap-server, ldap-username, ldap-password and ldap-base-dn were not specified in the config file Nov 26 20:05:08 localhost dhcpd: Nov 26 20:05:08 localhost dhcpd: ** You must add a global ddns-update-style statement to /etc/dhcpd.conf. Nov 26 20:05:08 localhost dhcpd: To get the same behaviour as in 3.0b2pl11 and previous Nov 26 20:05:08 localhost dhcpd: versions, add a line that says "ddns-update-style ad-hoc;" Nov 26 20:05:08 localhost dhcpd: Please read the dhcpd.conf manual page for more information. ** Nov 26 20:05:08 localhost dhcpd: Nov 26 20:05:08 localhost dhcpd: This version of ISC DHCP is based on the release available Nov 26 20:05:08 localhost dhcpd: on ftp.isc.org. Features have been added and other changes Nov 26 20:05:08 localhost dhcpd: have been made to the base software release in order to make Nov 26 20:05:08 localhost dhcpd: it work better with this distribution. Nov 26 20:05:08 localhost dhcpd: Nov 26 20:05:08 localhost dhcpd: Please report for this software via the Red Hat Bugzilla site: Nov 26 20:05:09 localhost dhcpd: http://bugzilla.redhat.com Nov 26 20:05:09 localhost dhcpd: Nov 26 20:05:09 localhost dhcpd: exiting. Nov 26 20:07:08 localhost dhcpd: Internet Systems Consortium DHCP Server V3.0.5-RedHat Nov 26 20:07:08 localhost dhcpd: Copyright 2004-2006 Internet Systems Consortium. Nov 26 20:07:08 localhost dhcpd: All rights reserved. Nov 26 20:07:08 localhost dhcpd: For info, please visit http://www.isc.org/sw/dhcp/ Nov 26 20:07:08 localhost dhcpd: Not searching LDAP since ldap-server, ldap-username, ldap-password and ldap-base-dn were not specified in the config file Nov 26 20:07:08 localhost dhcpd: Wrote 0 leases to leases file. Nov 26 20:07:08 localhost dhcpd: Nov 26 20:07:08 localhost dhcpd: No subnet declaration for eth1.5 (192.168.5.5). Nov 26 20:07:08 localhost dhcpd: ** Ignoring requests on eth1.5. If this is not what Nov 26 20:07:08 localhost dhcpd: you want, please write a subnet declaration Nov 26 20:07:08 localhost dhcpd: in your dhcpd.conf file for the network segment Nov 26 20:07:08 localhost dhcpd: to which interface eth1.5 is attached. ** Nov 26 20:07:08 localhost dhcpd: Nov 26 20:07:08 localhost dhcpd: Nov 26 20:07:08 localhost dhcpd: No subnet declaration for eth1.4 (192.168.4.5). Nov 26 20:07:08 localhost dhcpd: ** Ignoring requests on eth1.4. If this is not what Nov 26 20:07:08 localhost dhcpd: you want, please write a subnet declaration Nov 26 20:07:09 localhost dhcpd: in your dhcpd.conf file for the network segment Nov 26 20:07:09 localhost dhcpd: to which interface eth1.4 is attached. ** Nov 26 20:07:09 localhost dhcpd: Nov 26 20:07:09 localhost dhcpd: Nov 26 20:07:09 localhost dhcpd: No subnet declaration for eth1.3 (192.168.3.5). Nov 26 20:07:09 localhost dhcpd: ** Ignoring requests on eth1.3. If this is not what Nov 26 20:07:09 localhost dhcpd: you want, please write a subnet declaration Nov 26 20:07:09 localhost dhcpd: in your dhcpd.conf file for the network segment Nov 26 20:07:09 localhost dhcpd: to which interface eth1.3 is attached. ** Nov 26 20:07:09 localhost dhcpd: Nov 26 20:07:09 localhost dhcpd: Nov 26 20:07:09 localhost dhcpd: No subnet declaration for eth1.2 (192.168.2.5). Nov 26 20:07:09 localhost dhcpd: ** Ignoring requests on eth1.2. If this is not what Nov 26 20:07:09 localhost dhcpd: you want, please write a subnet declaration Nov 26 20:07:09 localhost dhcpd: in your dhcpd.conf file for the network segment Nov 26 20:07:09 localhost dhcpd: to which interface eth1.2 is attached. ** Nov 26 20:07:09 localhost dhcpd: Nov 26 20:07:09 localhost dhcpd: Nov 26 20:07:09 localhost dhcpd: No subnet declaration for eth0 (192.168.15.5). Nov 26 20:07:09 localhost dhcpd: ** Ignoring requests on eth0. If this is not what Nov 26 20:07:09 localhost dhcpd: you want, please write a subnet declaration Nov 26 20:07:09 localhost dhcpd: in your dhcpd.conf file for the network segment Nov 26 20:07:09 localhost dhcpd: to which interface eth0 is attached. ** Nov 26 20:07:09 localhost dhcpd: Nov 26 20:07:09 localhost dhcpd: Nov 26 20:07:09 localhost dhcpd: Not configured to listen on any interfaces! Nov 26 20:07:09 localhost dhcpd: Nov 26 20:07:09 localhost dhcpd: This version of ISC DHCP is based on the release available Nov 26 20:07:09 localhost dhcpd: on ftp.isc.org. Features have been added and other changes Nov 26 20:07:09 localhost dhcpd: have been made to the base software release in order to make Nov 26 20:07:09 localhost dhcpd: it work better with this distribution. Nov 26 20:07:09 localhost dhcpd: Nov 26 20:07:09 localhost dhcpd: Please report for this software via the Red Hat Bugzilla site: Nov 26 20:07:09 localhost dhcpd: http://bugzilla.redhat.com Nov 26 20:07:09 localhost dhcpd: Nov 26 20:07:09 localhost dhcpd: exiting. Nov 26 20:07:15 localhost dhcpd: Internet Systems Consortium DHCP Server V3.0.5-RedHat Nov 26 20:07:15 localhost dhcpd: Copyright 2004-2006 Internet Systems Consortium. Nov 26 20:07:15 localhost dhcpd: All rights reserved. Nov 26 20:07:15 localhost dhcpd: For info, please visit http://www.isc.org/sw/dhcp/ Nov 26 20:07:15 localhost dhcpd: Not searching LDAP since ldap-server, ldap-username, ldap-password and ldap-base-dn were not specified in the config file Nov 26 20:07:15 localhost dhcpd: Wrote 0 leases to leases file. |
Quote:
|
can you just check that which RPM you have the command is
which dhcpd you will have the path for the dhcpd just copy the path in my case it is. /usr/sbin/dhcpd rpm -qf /usr/sbin/dhcpd it will show you the version of DHCP RPM. then if you have your installation CDs, just remove this RPM and install back. for removing DHCP pakcage the command will be rpm -e dhcp-version (which you got from the first command the version name) then look for DHCP rpm from you cds and install it with the command. rpm -ivh dhcp-versionname.rpm then copy the dhcpd.conf file in my pc it resides within /usr/share/doc/dhcpd-versionname/dhcpd.conf.sample copy the file dhcpd.conf.sample file and name it dhcpd.conf the command is cp /usr/share/doc/dhcpd.conf.sample /etc/dhcpd.conf you have the dhcpd.conf file within /etc/ directory for now check, and configuring a dhcpd.conf file is very easy just check that you are using the right subnet and put your DNS entries for your dhcpd server. I hope it will work thanks:) |
If you have more then one interface you must specify which one that dhcpd should use.
Edit /etc/sysconfig/dhcpd and set: DHCPDARGS="eth0" (or whatever eth that you want to use) |
Hi!
Sorry for this bit of delay. After trying all the bits and peices this is what I am getting. I am actually using two interfaces etho (Internet) and eth1(to LAN). Further as advised I have specified eth1 in /etc/sysconfig/dhcpd file. DHCPDARGS="eth0" In var/log/messages file this is what I am getting for dhcpd service. "To which interface eth1 is attached Not configured to listen on any interface". WARNING: Host declarations are global. They are not limited to the scope you declared them in. Dec 5 07:41:39 localhost dhcpd: Not searching LDAP since ldap-server, ldap-username, ldap-password and ldap-base-dn were not specified in the config file Dec 5 07:41:39 localhost dhcpd: Wrote 0 deleted host decls to leases file. Dec 5 07:41:39 localhost dhcpd: Wrote 0 new dynamic host decls to leases file. Dec 5 07:41:39 localhost dhcpd: Wrote 0 leases to leases file. Dec 5 07:41:39 localhost dhcpd: Dec 5 07:41:39 localhost dhcpd: No subnet declaration for eth1 (0.0.0.0). Dec 5 07:41:39 localhost dhcpd: ** Ignoring requests on eth1. If this is not what Dec 5 07:41:39 localhost dhcpd: you want, please write a subnet declaration Dec 5 07:41:39 localhost dhcpd: in your dhcpd.conf file for the network segment Dec 5 07:41:39 localhost dhcpd: to which interface eth1 is attached. ** Dec 5 07:41:39 localhost dhcpd: Dec 5 07:41:39 localhost dhcpd: Dec 5 07:41:39 localhost dhcpd: Not configured to listen on any interfaces! |
Please post the output of:
Code:
ifconfig eth1 |
ifconfig and dhcpd files
#########ifconfig -a ###############
eth0 Link encap:Ethernet HWaddr 00:19:BB:31:F9:4C inet addr:192.168.15.5 Bcast:192.168.15.255 Mask:255.255.255.0 inet6 addr: fe80::219:bbff:fe31:f94c/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:153042 errors:0 dropped:0 overruns:0 frame:0 TX packets:159212 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:173068438 (165.0 MiB) TX bytes:16657644 (15.8 MiB) Interrupt:16 Memory:f8000000-f8012100 eth1 Link encap:Ethernet HWaddr 00:19:BB:31:F9:58 inet6 addr: fe80::219:bbff:fe31:f958/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:81544 errors:0 dropped:0 overruns:0 frame:0 TX packets:88236 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:14641862 (13.9 MiB) TX bytes:69864845 (66.6 MiB) Interrupt:16 Memory:fa000000-fa012100 eth1.2 Link encap:Ethernet HWaddr 00:19:BB:31:F9:58 inet addr:192.168.2.5 Bcast:192.168.2.255 Mask:255.255.255.0 inet6 addr: fe80::219:bbff:fe31:f958/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:74180 errors:0 dropped:0 overruns:0 frame:0 TX packets:79355 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:11722943 (11.1 MiB) TX bytes:60783587 (57.9 MiB) eth1.3 Link encap:Ethernet HWaddr 00:19:BB:31:F9:58 inet addr:192.168.3.5 Bcast:192.168.3.255 Mask:255.255.255.0 inet6 addr: fe80::219:bbff:fe31:f958/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:6846 errors:0 dropped:0 overruns:0 frame:0 TX packets:8728 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:1095862 (1.0 MiB) TX bytes:8327740 (7.9 MiB) eth1.4 Link encap:Ethernet HWaddr 00:19:BB:31:F9:58 inet addr:192.168.4.5 Bcast:192.168.4.255 Mask:255.255.255.0 inet6 addr: fe80::219:bbff:fe31:f958/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:64 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 b) TX bytes:10308 (10.0 KiB) eth1.5 Link encap:Ethernet HWaddr 00:19:BB:31:F9:58 inet addr:192.168.5.5 Bcast:192.168.5.255 Mask:255.255.255.0 inet6 addr: fe80::219:bbff:fe31:f958/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:63 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 b) TX bytes:10238 (9.9 KiB) 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:10995 errors:0 dropped:0 overruns:0 frame:0 TX packets:10995 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:92400536 (88.1 MiB) TX bytes:92400536 (88.1 MiB) eth0 Link encap:Ethernet HWaddr 00:19:BB:31:F9:4C inet addr:192.168.15.5 Bcast:192.168.15.255 Mask:255.255.255.0 inet6 addr: fe80::219:bbff:fe31:f94c/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:3122 errors:0 dropped:0 overruns:0 frame:0 TX packets:3033 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:3849456 (3.6 MiB) TX bytes:329197 (321.4 KiB) Interrupt:16 Memory:f8000000-f8012100 eth1 Link encap:Ethernet HWaddr 00:19:BB:31:F9:58 inet6 addr: fe80::219:bbff:fe31:f958/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:1491 errors:0 dropped:0 overruns:0 frame:0 TX packets:1543 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:193643 (189.1 KiB) TX bytes:1408375 (1.3 MiB) Interrupt:16 Memory:fa000000-fa012100 eth1.2 Link encap:Ethernet HWaddr 00:19:BB:31:F9:58 inet addr:192.168.2.5 Bcast:192.168.2.255 Mask:255.255.255.0 inet6 addr: fe80::219:bbff:fe31:f958/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:260 errors:0 dropped:0 overruns:0 frame:0 TX packets:166 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:27332 (26.6 KiB) TX bytes:67590 (66.0 KiB) eth1.3 Link encap:Ethernet HWaddr 00:19:BB:31:F9:58 inet addr:192.168.3.5 Bcast:192.168.3.255 Mask:255.255.255.0 inet6 addr: fe80::219:bbff:fe31:f958/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:1097 errors:0 dropped:0 overruns:0 frame:0 TX packets:1218 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:127885 (124.8 KiB) TX bytes:1301768 (1.2 MiB) eth1.4 Link encap:Ethernet HWaddr 00:19:BB:31:F9:58 inet addr:192.168.4.5 Bcast:192.168.4.255 Mask:255.255.255.0 inet6 addr: fe80::219:bbff:fe31:f958/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:64 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 b) TX bytes:10284 (10.0 KiB) eth1.5 Link encap:Ethernet HWaddr 00:19:BB:31:F9:58 inet addr:192.168.5.5 Bcast:192.168.5.255 Mask:255.255.255.0 inet6 addr: fe80::219:bbff:fe31:f958/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:63 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 b) TX bytes:10214 (9.9 KiB) 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:4329 errors:0 dropped:0 overruns:0 frame:0 TX packets:4329 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:19411492 (18.5 MiB) TX bytes:19411492 (18.5 MiB) #################dhcpd.conf################### ddns-update-style interim; ignore client-updates; #eth1.2 subnet 192.168.2.0 netmask 255.255.255.0 { # --- default gateway option routers 192.168.2.5; option subnet-mask 255.255.255.0; option nis-domain "domain.org"; option domain-name "domain.org"; option domain-name-servers 4.2.2.2; option time-offset -18000; # Eastern Standard Time range dynamic-bootp 192.168.2.10 192.168.2.254; default-lease-time 21600; max-lease-time 43200; } #eth1.3 subnet 192.168.3.0 netmask 255.255.255.0 { # --- default gateway option routers 192.168.3.5; option subnet-mask 255.255.255.0; option nis-domain "domain.org"; option domain-name "domain.org"; option domain-name-servers 4.2.2.2; option time-offset -18000; # Eastern Standard Time range dynamic-bootp 192.168.3.10 192.168.3.254; default-lease-time 21600; max-lease-time 43200; } #eth1.4 subnet 192.168.4.0 netmask 255.255.255.0 { # --- default gateway option routers 192.168.4.5; option subnet-mask 255.255.255.0; option nis-domain "domain.org"; option domain-name "domain.org"; option domain-name-servers 4.2.2.2; option time-offset -18000; # Eastern Standard Time range dynamic-bootp 192.168.4.10 192.168.4.254; default-lease-time 21600; max-lease-time 43200; } #eth1.5 subnet 192.168.5.0 netmask 255.255.255.0 { # --- default gateway option routers 192.168.5.5; option subnet-mask 255.255.255.0; option nis-domain "domain.org"; option domain-name "domain.org"; option domain-name-servers 4.2.2.2; option time-offset -18000; # Eastern Standard Time range dynamic-bootp 192.168.5.10 192.168.5.254; default-lease-time 21600; max-lease-time 43200; } |
You will need to add each subnet to dhcpdargs like:
DHCPDARGS="eth1.1 eth1.2" The error in post #12 is due to the fact that eth1 is not being assigned an IP address but yet defined in dhcpdargs. eth1, eth1.1, eth1.2 are different subnets even though it is the same physical interface. |
All times are GMT -5. The time now is 02:03 AM. |