Page 1 of 1

DHCP error

Posted: Thu May 31, 2012 11:29 am
by benningtonr
No DHCPOFFERs were received.

command = check_dhcp!

Any Ideas?

Re: DHCP error

Posted: Thu May 31, 2012 12:22 pm
by scottwilkerson
Is there an active DHCP server on your network?

Does the DHCP server have available IP's to allocate?

Re: DHCP error

Posted: Thu May 31, 2012 12:25 pm
by benningtonr
Yes and yes

Re: DHCP error

Posted: Thu May 31, 2012 12:38 pm
by scottwilkerson
it could be a firewall issue. To test you can do

Code: Select all

cd /usr/local/nagios/libexec
service iptables stop
./check_dhcp
service iptables start

Re: DHCP error

Posted: Thu May 31, 2012 1:12 pm
by benningtonr
I am guessing this is ok?

[root@helpdesk27 libexec]# service iptables stop
iptables: Flushing firewall rules: [ OK ]
iptables: Setting chains to policy ACCEPT: filter [ OK ]
iptables: Unloading modules: [ OK ]
[root@helpdesk27 libexec]# ./check_dhcp
OK: Received 1 DHCPOFFER(s), max lease time = 0 sec.
[root@helpdesk27 libexec]# service iptables start
iptables: Applying firewall rules: [ OK ]
[root@helpdesk27 libexec]#

Re: DHCP error

Posted: Thu May 31, 2012 1:47 pm
by lmiltchev
Yes, this was a firewall issue. It's working now:
[root@helpdesk27 libexec]# ./check_dhcp
OK: Received 1 DHCPOFFER(s), max lease time = 0 sec.
I believe you need to open UDP ports 67 & 68 in iptables.

Re: DHCP error

Posted: Thu May 31, 2012 2:36 pm
by benningtonr
i need to open them on the nagios?

Re: DHCP error

Posted: Thu May 31, 2012 2:40 pm
by benningtonr
[root@helpdesk27 ~]# iptables --list
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT icmp -- anywhere anywhere
ACCEPT all -- anywhere anywhere
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ssh
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:http
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:https
REJECT all -- anywhere anywhere reject-with icmp-host-prohibited

Chain FORWARD (policy ACCEPT)
target prot opt source destination
REJECT all -- anywhere anywhere reject-with icmp-host-prohibited

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

Re: DHCP error

Posted: Thu May 31, 2012 2:45 pm
by scottwilkerson
benningtonr wrote:i need to open them on the nagios?
Yes.

Run

Code: Select all

iptables -I INPUT -i eth0 -p udp --dport 67:68 --sport 67:68 -j ACCEPT

Re: DHCP error

Posted: Fri Jun 01, 2012 8:13 am
by benningtonr
Great, that worked, thank you