关于dhcp中继-现在先不说中继怎么配置,先帮忙看看配置文件哪里有问题
实验环境一台dhcp服务器,ip为10.0.0.1,一台中继服务器eth0:10.0.0.254,eth1:20.0.0.254,并且dhcp服务器网关为10.0.0.254
现需要dhcp服务器为10.0.0.0/24网段和20.0.0.0/24网段分配ip
我在dhcp服务器装好了dhcpd,但dhcpd服务怎么也起不来,望高人看一下/etc/dhcpd.conf文件和日志,现在先不说中继怎么配置,先帮忙看看配置文件哪里有问题。我没有dns服务器,但应该不是这个问题吧??
/etc/dhcpd.conf
ddns-update-style interim;
ignore client-updates;
subnet 10.0.0.0 netmask 255.255.255.0 {
# --- default gateway
option routers 10.0.0.254;
option subnet-mask 255.255.255.0;
range 10.0.0.2 10.0.0.99
option nis-domain "domain.org";
option domain-name "domain.org";
option domain-name-servers 10.0.0.100;
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 10.0.0.2 10.0.0.99;
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;
# }
}
subnet 20.0.0.0 netmask 255.255.255.0 {
# --- default gateway
option routers 20.0.0.254;
option subnet-mask 255.255.255.0;
range 20.0.0.2 20.0.0.99
option nis-domain "aa.com";
option domain-name "aa.com";
option domain-name-servers 20.0.0.100;
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 20.0.0.2 20.0.0.99;
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;
# }
}
错误日志:
Aug 11 03:56:14 localhost dhcpd: For info, please visit http://www.isc.org/sw/dhcp/
Aug 11 03:56:14 localhost dhcpd: /etc/dhcpd.conf line 11: semicolon expected.
Aug 11 03:56:14 localhost dhcpd: option
Aug 11 03:56:14 localhost dhcpd: ^
Aug 11 03:56:14 localhost dhcpd: /etc/dhcpd.conf line 41: semicolon expected.
Aug 11 03:56:14 localhost dhcpd: option
Aug 11 03:56:14 localhost dhcpd: ^
Aug 11 03:56:14 localhost dhcpd: Configuration file errors encountered -- exiting
貌似是说期望一个分号,可我这明明有分号啊
现需要dhcp服务器为10.0.0.0/24网段和20.0.0.0/24网段分配ip
我在dhcp服务器装好了dhcpd,但dhcpd服务怎么也起不来,望高人看一下/etc/dhcpd.conf文件和日志,现在先不说中继怎么配置,先帮忙看看配置文件哪里有问题。我没有dns服务器,但应该不是这个问题吧??
/etc/dhcpd.conf
ddns-update-style interim;
ignore client-updates;
subnet 10.0.0.0 netmask 255.255.255.0 {
# --- default gateway
option routers 10.0.0.254;
option subnet-mask 255.255.255.0;
range 10.0.0.2 10.0.0.99
option nis-domain "domain.org";
option domain-name "domain.org";
option domain-name-servers 10.0.0.100;
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 10.0.0.2 10.0.0.99;
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;
# }
}
subnet 20.0.0.0 netmask 255.255.255.0 {
# --- default gateway
option routers 20.0.0.254;
option subnet-mask 255.255.255.0;
range 20.0.0.2 20.0.0.99
option nis-domain "aa.com";
option domain-name "aa.com";
option domain-name-servers 20.0.0.100;
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 20.0.0.2 20.0.0.99;
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;
# }
}
错误日志:
Aug 11 03:56:14 localhost dhcpd: For info, please visit http://www.isc.org/sw/dhcp/
Aug 11 03:56:14 localhost dhcpd: /etc/dhcpd.conf line 11: semicolon expected.
Aug 11 03:56:14 localhost dhcpd: option
Aug 11 03:56:14 localhost dhcpd: ^
Aug 11 03:56:14 localhost dhcpd: /etc/dhcpd.conf line 41: semicolon expected.
Aug 11 03:56:14 localhost dhcpd: option
Aug 11 03:56:14 localhost dhcpd: ^
Aug 11 03:56:14 localhost dhcpd: Configuration file errors encountered -- exiting
貌似是说期望一个分号,可我这明明有分号啊
作者: ourstory 发布时间: 2011-08-11
看到那个^了嘛,那就是错误啊
[ 本帖最后由 摇滚风 于 2011-8-11 09:03 编辑 ]
[ 本帖最后由 摇滚风 于 2011-8-11 09:03 编辑 ]
作者: 摇滚风 发布时间: 2011-08-11
还有那第一个range,我很郁闷为啥重新编辑帖子新加上去的内容不会显示出来
作者: 摇滚风 发布时间: 2011-08-11
range少分号啊
作者: ourstory 发布时间: 2011-08-11
我*就是少个分号,耽误我这么半天,谢了
作者: ourstory 发布时间: 2011-08-11
怪不得说期望一个分号呢- -
作者: ourstory 发布时间: 2011-08-11
把文件的11行和41行再看看,提示说这2行缺分号
作者: dn833 发布时间: 2011-08-11
嗯谢谢已经找出原因了,太粗心了
作者: ourstory 发布时间: 2011-08-11
还是那句话! 留意细节部分!
作者: jie071218 发布时间: 2011-08-11