Сервер DHCP
-
Admiral83
Сервер DHCP
Есть проблемки с работой DHCP.
У меня Федора 4. При установке dhcpd не поставился. Ставлю его с диска федоры:
rpm -ihv dhcp-3.0.2-12.rpm
он опять ругается что нет цифровой подписи, но все ставит.
Файл /etc/dhcpd.conf почему-то не создал. Ладно создаю его сам:
subnet 192.168.2.0 netmask 255.255.255.0 {
range 192.168.2.50 192.168.2.150
}
Запускаю
# /etc/rc.d/init.d/dhcpd start
Запускается dhcpd [сбой]
И ничего он не запускается. Что делать?
У меня Федора 4. При установке dhcpd не поставился. Ставлю его с диска федоры:
rpm -ihv dhcp-3.0.2-12.rpm
он опять ругается что нет цифровой подписи, но все ставит.
Файл /etc/dhcpd.conf почему-то не создал. Ладно создаю его сам:
subnet 192.168.2.0 netmask 255.255.255.0 {
range 192.168.2.50 192.168.2.150
}
Запускаю
# /etc/rc.d/init.d/dhcpd start
Запускается dhcpd [сбой]
И ничего он не запускается. Что делать?
-
Admiral83
Re: Сервер DHCP
Поставил на файл права -rw-rw-rw- все равно пишет в логах то же самое.
Вот файл /etc/rc.d/init.d/dhcpd:
Цитата:
# Source function library.
. /etc/rc.d/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
. /etc/sysconfig/dhcpd
# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0
[ -f /usr/sbin/dhcpd ] || exit 0
CF='/etc/dhcpd.conf'
if [[ "$DHCPDARGS" = *-cf* ]]; then
CF=`echo $DHCPDARGS | sed 's/^.*-cf[\ \ ]*//;s/[\ \ ].*$//';`;
fi;
[ -f "$CF" ] || exit 0
if [ ! -f /var/lib/dhcp/dhcpd.leases ] ; then
touch /var/lib/dhcp/dhcpd.leases
[ -x /sbin/restorecon ] && [ -d /selinux ] && /sbin/restorecon /var/lib/dhcp/dhcpd.leases
fi
RETVAL=0
prog="dhcpd"
configtest()
{
CFA=''
if [[ "$DHCPDARGS" = *-cf* ]]; then
CFA=`echo $DHCPDARGS | sed 's/^.*-cf[\ \ ]*/-cf/;s/[\ \ ].*$//;s/-cf/-cf /'`;
fi;
/usr/sbin/dhcpd -t $CFA
return $?
}
start() {
# Start daemons.
echo -n $"Starting $prog: "
daemon /usr/sbin/dhcpd ${DHCPDARGS} 2>/dev/null
RETVAL=$?
echo
if [ $RETVAL -eq 0 ]; then
touch /var/lock/subsys/dhcpd
if [ -x /usr/bin/logger ]; then
/usr/bin/logger -t dhcpd 'dhcpd startup succeeded'
fi;
else
if [ -x /usr/bin/logger ]; then
/usr/bin/logger -t dhcpd 'dhcpd startup failed'
fi;
fi
return $RETVAL
}
stop() {
# Stop daemons.
echo -n $"Shutting down $prog: "
killproc dhcpd
RETVAL=$?
echo
if [ $RETVAL -eq 0 ]; then
rm -f /var/lock/subsys/dhcpd
if [ -x /usr/bin/logger ]; then
/usr/bin/logger -t dhcpd 'dhcpd shutdown succeeded'
fi;
else
if [ -x /usr/bin/logger ]; then
/usr/bin/logger -t dhcpd 'dhcpd shutdown failed'
fi;
fi
return $RETVAL
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
restart|reload)
configtest || exit $?
stop
start
RETVAL=$?
;;
condrestart)
if [ -f /var/lock/subsys/dhcpd ]; then
stop
start
RETVAL=$?
fi
;;
configtest)
configtest
RETVAL=$?
;;
status)
status dhcpd
RETVAL=$?
;;
*)
echo $"Usage: $0 {start|stop|restart|condrestart|configtest|status}"
exit 1
esac
exit $RETVAL
Причем, если запустить /usr/sbin/dhcpd а потом /etc/rc.d/init.d/dhcpd stop , то он нормально останавливается.
Что тут может быть неправильного?
Вот файл /etc/rc.d/init.d/dhcpd:
Цитата:
# Source function library.
. /etc/rc.d/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
. /etc/sysconfig/dhcpd
# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0
[ -f /usr/sbin/dhcpd ] || exit 0
CF='/etc/dhcpd.conf'
if [[ "$DHCPDARGS" = *-cf* ]]; then
CF=`echo $DHCPDARGS | sed 's/^.*-cf[\ \ ]*//;s/[\ \ ].*$//';`;
fi;
[ -f "$CF" ] || exit 0
if [ ! -f /var/lib/dhcp/dhcpd.leases ] ; then
touch /var/lib/dhcp/dhcpd.leases
[ -x /sbin/restorecon ] && [ -d /selinux ] && /sbin/restorecon /var/lib/dhcp/dhcpd.leases
fi
RETVAL=0
prog="dhcpd"
configtest()
{
CFA=''
if [[ "$DHCPDARGS" = *-cf* ]]; then
CFA=`echo $DHCPDARGS | sed 's/^.*-cf[\ \ ]*/-cf/;s/[\ \ ].*$//;s/-cf/-cf /'`;
fi;
/usr/sbin/dhcpd -t $CFA
return $?
}
start() {
# Start daemons.
echo -n $"Starting $prog: "
daemon /usr/sbin/dhcpd ${DHCPDARGS} 2>/dev/null
RETVAL=$?
echo
if [ $RETVAL -eq 0 ]; then
touch /var/lock/subsys/dhcpd
if [ -x /usr/bin/logger ]; then
/usr/bin/logger -t dhcpd 'dhcpd startup succeeded'
fi;
else
if [ -x /usr/bin/logger ]; then
/usr/bin/logger -t dhcpd 'dhcpd startup failed'
fi;
fi
return $RETVAL
}
stop() {
# Stop daemons.
echo -n $"Shutting down $prog: "
killproc dhcpd
RETVAL=$?
echo
if [ $RETVAL -eq 0 ]; then
rm -f /var/lock/subsys/dhcpd
if [ -x /usr/bin/logger ]; then
/usr/bin/logger -t dhcpd 'dhcpd shutdown succeeded'
fi;
else
if [ -x /usr/bin/logger ]; then
/usr/bin/logger -t dhcpd 'dhcpd shutdown failed'
fi;
fi
return $RETVAL
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
restart|reload)
configtest || exit $?
stop
start
RETVAL=$?
;;
condrestart)
if [ -f /var/lock/subsys/dhcpd ]; then
stop
start
RETVAL=$?
fi
;;
configtest)
configtest
RETVAL=$?
;;
status)
status dhcpd
RETVAL=$?
;;
*)
echo $"Usage: $0 {start|stop|restart|condrestart|configtest|status}"
exit 1
esac
exit $RETVAL
Причем, если запустить /usr/sbin/dhcpd а потом /etc/rc.d/init.d/dhcpd stop , то он нормально останавливается.
Что тут может быть неправильного?
-
BuGfiX
Re: Сервер DHCP
3kLiN
А где его логи? В папке /var искал поиском "dhcp*" - нет логов.
BuGfiX
---------------------------------------------------------------
[root@localhost sbin]# /usr/sbin/dhcpd
Internet Systems Consortium DHCP Server V3.0.2
Copyright 2004 Internet Systems Consortium.
All rights reserved.
For info, please visit
/etc/dhcpd.conf line 3: semicolon expected.
}
^
/etc/dhcpd.conf line 3: unexpected end of file
}
^
Configuration file errors encountered -- exiting
If you did not get this software from ftp.isc.org, please
get the latest from ftp.isc.org and install that before
requesting help.
If you did get this software from ftp.isc.org and have not
yet read the README, please read it before requesting help.
If you intend to request help from the [url=mailto:dhcp-server@isc.org]dhcp-server@isc.org[/url]
mailing list, please read the section on the README about
submitting bug reports and requests for help.
Please do not under any circumstances send requests for
help directly to the authors of this software - please
send them to the appropriate mailing list as described in
the README file.
exiting.
--------------------------------------------------------------------------
Похоже проблемы в 3-ей строке, но там только "}" стоит. Файл точно такой же, как описывал в начале.
А где его логи? В папке /var искал поиском "dhcp*" - нет логов.
BuGfiX
---------------------------------------------------------------
[root@localhost sbin]# /usr/sbin/dhcpd
Internet Systems Consortium DHCP Server V3.0.2
Copyright 2004 Internet Systems Consortium.
All rights reserved.
For info, please visit
http://www.isc.org/sw/dhcp/
/etc/dhcpd.conf line 3: semicolon expected.
}
^
/etc/dhcpd.conf line 3: unexpected end of file
}
^
Configuration file errors encountered -- exiting
If you did not get this software from ftp.isc.org, please
get the latest from ftp.isc.org and install that before
requesting help.
If you did get this software from ftp.isc.org and have not
yet read the README, please read it before requesting help.
If you intend to request help from the [url=mailto:dhcp-server@isc.org]dhcp-server@isc.org[/url]
mailing list, please read the section on the README about
submitting bug reports and requests for help.
Please do not under any circumstances send requests for
help directly to the authors of this software - please
send them to the appropriate mailing list as described in
the README file.
exiting.
--------------------------------------------------------------------------
Похоже проблемы в 3-ей строке, но там только "}" стоит. Файл точно такой же, как описывал в начале.
-
Admiral83
Re: Сервер DHCP
Так, я разобрался в 3-ей строчке - забыл ; поставить.
Теперь запускаю:
---------------------------------------------------------------------------------------------
[root@localhost sbin]# /usr/sbin/dhcpd
Internet Systems Consortium DHCP Server V3.0.2
Copyright 2004 Internet Systems Consortium.
All rights reserved.
For info, please visit
** You must add a global ddns-update-style statement to /etc/dhcpd.conf.
To get the same behaviour as in 3.0b2pl11 and previous
versions, add a line that says "ddns-update-style ad-hoc;"
Please read the dhcpd.conf manual page for more information. **
If you did not get this software from ftp.isc.org, please
get the latest from ftp.isc.org and install that before
requesting help.
If you did get this software from ftp.isc.org and have not
yet read the README, please read it before requesting help.
If you intend to request help from the [url=mailto:dhcp-server@isc.org]dhcp-server@isc.org[/url]
mailing list, please read the section on the README about
submitting bug reports and requests for help.
Please do not under any circumstances send requests for
help directly to the authors of this software - please
send them to the appropriate mailing list as described in
the README file.
exiting.
------------------------------------------------------------------------------
Что это? "ddns-update-style ad-hoc;" В MANе про него ничего нет. У меня пока нет DNS-сервера.
Теперь запускаю:
---------------------------------------------------------------------------------------------
[root@localhost sbin]# /usr/sbin/dhcpd
Internet Systems Consortium DHCP Server V3.0.2
Copyright 2004 Internet Systems Consortium.
All rights reserved.
For info, please visit
http://www.isc.org/sw/dhcp/
** You must add a global ddns-update-style statement to /etc/dhcpd.conf.
To get the same behaviour as in 3.0b2pl11 and previous
versions, add a line that says "ddns-update-style ad-hoc;"
Please read the dhcpd.conf manual page for more information. **
If you did not get this software from ftp.isc.org, please
get the latest from ftp.isc.org and install that before
requesting help.
If you did get this software from ftp.isc.org and have not
yet read the README, please read it before requesting help.
If you intend to request help from the [url=mailto:dhcp-server@isc.org]dhcp-server@isc.org[/url]
mailing list, please read the section on the README about
submitting bug reports and requests for help.
Please do not under any circumstances send requests for
help directly to the authors of this software - please
send them to the appropriate mailing list as described in
the README file.
exiting.
------------------------------------------------------------------------------
Что это? "ddns-update-style ad-hoc;" В MANе про него ничего нет. У меня пока нет DNS-сервера.
-
3kLiN
Re: Сервер DHCP
если использовать dynamic dns не нужно, то можно прописать:
Код:
Код:
Код: Выделить всё
ddns-update-style none;
ddns-updates off;-
Admiral83
Re: Сервер DHCP
Спасибо, теперь начал запускаться:
[root@localhost init.d]# /usr/sbin/dhcpd
Internet Systems Consortium DHCP Server V3.0.2
Copyright 2004 Internet Systems Consortium.
All rights reserved.
For info, please visit
Wrote 0 leases to leases file.
Listening on LPF/eth0/00:50:22:8f:a0:49/192.168.2/24
Sending on LPF/eth0/00:50:22:8f:a0:49/192.168.2/24
Sending on Socket/fallback/fallback-net
Но когда пытаюсь запустить скрипт - ругается и в логах ничего нет:
[root@localhost init.d]# /etc/rc.d/init.d/dhcpd start
Запускается dhcpd: [ СБОЙ ]
В чем может быть проблема?
[root@localhost init.d]# /usr/sbin/dhcpd
Internet Systems Consortium DHCP Server V3.0.2
Copyright 2004 Internet Systems Consortium.
All rights reserved.
For info, please visit
http://www.isc.org/sw/dhcp/
Wrote 0 leases to leases file.
Listening on LPF/eth0/00:50:22:8f:a0:49/192.168.2/24
Sending on LPF/eth0/00:50:22:8f:a0:49/192.168.2/24
Sending on Socket/fallback/fallback-net
Но когда пытаюсь запустить скрипт - ругается и в логах ничего нет:
[root@localhost init.d]# /etc/rc.d/init.d/dhcpd start
Запускается dhcpd: [ СБОЙ ]
В чем может быть проблема?
-
BuGfiX
Re: Сервер DHCP
а в скрипте как вызывается? возможно там конфиг неправильно указан или путь... посмотри вобщем