免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2419 | 回复: 5
打印 上一主题 下一主题

[其他] 请问在Linux下做DHCP多作用域时配置是这样写吗? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2012-06-13 16:48 |只看该作者 |倒序浏览
这是试题上的.两块网卡.一块是10.0.5.11.一块是10.0.1.11
不做超级作用域.但是要做多个作用域.
我是直接在/etc/dhcpd.conf 中写入修改一个作用域..然后复制好多行.修改下一个IP作用域.但是这样一直启动不起来.单独一个作用域可以的.就是去掉一个.
配置如下,请问我这样做多作用域对吗?:
  1. ddns-update-style interim;
  2. ignore client-updates;

  3. subnet 10.0.5.0 netmask 255.255.255.0 {
  4.                                       {
  5. # --- default gateway
  6.         option routers                  10.0.5.1;
  7.         option subnet-mask              255.255.255.0;

  8.         option nis-domain               "domain.org";
  9.         option domain-name              "domain.org";
  10.         option domain-name-servers      192.168.1.1;

  11.         option time-offset              -18000; # Eastern Standard Time
  12. #       option ntp-servers              192.168.1.1;
  13. #       option netbios-name-servers     192.168.1.1;
  14. # --- Selects point-to-point node (default is hybrid). Don't change this unless
  15. # -- you understand Netbios very well
  16. #       option netbios-node-type 2;

  17.         range dynamic-bootp 10.0.5.100 10.0.5.200;
  18.         default-lease-time 21600;
  19.         max-lease-time 43200;

  20.         # we want the nameserver to appear at a fixed address
  21.         host ns {
  22.                 {ext-server marvin.redhat.com;
  23.                 hardware ethernet 12:34:56:78:AB:CD;
  24.                 fixed-address 207.175.42.254;
  25.         }
  26. }       }
  27. }ubnet 10.0.1.0 netmask 255.255.255.0 {
  28.                                       {
  29. # --- default gateway
  30.         option routers                  10.0.1.1;
  31.         option subnet-mask              255.255.255.0;

  32.         option nis-domain               "domain.org";
  33.         option domain-name              "domain.org";
  34.         option domain-name-servers      192.168.1.1;

  35.         option time-offset              -18000; # Eastern Standard Time
  36. #       option ntp-servers              192.168.1.1;
  37. #       option netbios-name-servers     192.168.1.1;
  38. # --- Selects point-to-point node (default is hybrid). Don't change this unless
  39. # -- you understand Netbios very well
  40. #       option netbios-node-type 2;

  41. "/etc/dhcpd.conf" 59L, 1629C                                  21,2-9       顶章       range dynamic-bootp 10.0.1.100 10.0.1.200;
  42.         default-lease-time 21600;
  43.         max-lease-time 43200;

  44.         # we want the nameserver to appear at a fixed address
  45.         host ns {
  46.                 next-server marvin.redhat.com;
  47.                 hardware ethernet 12:34:56:78:AB:CD;
  48.                 fixed-address 207.175.42.254;
  49.         }
  50. }
  51.      
复制代码
如有回答.不胜感激

论坛徽章:
0
2 [报告]
发表于 2012-06-13 18:13 |只看该作者
我找到原因了.是因为
host ns {
                next-server marvin.redhat.com;
                hardware ethernet 12:34:56:78:AB:CD;
                fixed-address 207.175.42.254;

这一段话的作用.一个配置文件中貌似只能有一段这个话.
但不知道这样表达的是什么意思.这段话是dhcp保留地址吧.
但是为什么一个一个配置文件只能写一个保留地址呢?难道两个作用域也只能写一个保留地址?
请求大神为我解答一下.不胜感激!

论坛徽章:
381
CU十二周年纪念徽章
日期:2014-01-04 22:46:58CU大牛徽章
日期:2013-03-13 15:32:35CU大牛徽章
日期:2013-03-13 15:38:15CU大牛徽章
日期:2013-03-13 15:38:52CU大牛徽章
日期:2013-03-14 14:08:55CU大牛徽章
日期:2013-04-17 11:17:19CU大牛徽章
日期:2013-04-17 11:17:32CU大牛徽章
日期:2013-04-17 11:17:37CU大牛徽章
日期:2013-04-17 11:17:42CU大牛徽章
日期:2013-04-17 11:17:47CU大牛徽章
日期:2013-04-17 11:17:52CU大牛徽章
日期:2013-04-17 11:17:56
3 [报告]
发表于 2012-06-14 17:24 |只看该作者
这段话是dhcp保留地址.
你可以写多个host那样的配置啊,比如host ns2 ......

论坛徽章:
0
4 [报告]
发表于 2012-06-15 10:00 |只看该作者
回复 3# chenyx
我去试试.我就是两个DHCP的作用域里都有这段话反而启动不起来.
不知道是不是  ns 后面需要跟编号的问题.

   

论坛徽章:
381
CU十二周年纪念徽章
日期:2014-01-04 22:46:58CU大牛徽章
日期:2013-03-13 15:32:35CU大牛徽章
日期:2013-03-13 15:38:15CU大牛徽章
日期:2013-03-13 15:38:52CU大牛徽章
日期:2013-03-14 14:08:55CU大牛徽章
日期:2013-04-17 11:17:19CU大牛徽章
日期:2013-04-17 11:17:32CU大牛徽章
日期:2013-04-17 11:17:37CU大牛徽章
日期:2013-04-17 11:17:42CU大牛徽章
日期:2013-04-17 11:17:47CU大牛徽章
日期:2013-04-17 11:17:52CU大牛徽章
日期:2013-04-17 11:17:56
5 [报告]
发表于 2012-06-15 11:06 |只看该作者
那个是个例子,ns可以随便修改

论坛徽章:
0
6 [报告]
发表于 2012-06-15 11:08 |只看该作者
回复 3# chenyx

非常感谢.果然是那样.
果然是HOST这一行的配置问题.我这里没有该这一行的ns.
改过来可以正常启动
不胜感激
   
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP