歡迎您光臨本站 註冊首頁

請問在Linux下做DHCP多作用域時配置是這樣寫嗎?

←手機掃碼閱讀     火星人 @ 2014-03-04 , reply:0

請問在Linux下做DHCP多作用域時配置是這樣寫嗎?

這是試題上的.兩塊網卡.一塊是10.0.5.11.一塊是10.0.1.11
不做超級作用域.但是要做多個作用域.
我是直接在/etc/dhcpd.conf 中寫入修改一個作用域..然後複製好多行.修改下一個IP作用域.但是這樣一直啟動不起來.單獨一個作用域可以的.就是去掉一個.
配置如下,請問我這樣做多作用域對嗎?:ddns-update-style interim;
ignore client-updates;

subnet 10.0.5.0 netmask 255.255.255.0 {
                                      {
# --- default gateway
        option routers                  10.0.5.1;
        option subnet-mask              255.255.255.0;

        option nis-domain               "domain.org";
        option domain-name              "domain.org";
        option domain-name-servers      192.168.1.1;

        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.5.100 10.0.5.200;
        default-lease-time 21600;
        max-lease-time 43200;

        # we want the nameserver to appear at a fixed address
        host ns {
                {ext-server marvin.redhat.com;
                hardware ethernet 12:34:56:78:AB:CD;
                fixed-address 207.175.42.254;
        }
}       }
}ubnet 10.0.1.0 netmask 255.255.255.0 {
                                      {
# --- default gateway
        option routers                  10.0.1.1;
        option subnet-mask              255.255.255.0;

        option nis-domain               "domain.org";
        option domain-name              "domain.org";
        option domain-name-servers      192.168.1.1;

        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;

"/etc/dhcpd.conf" 59L, 1629C                                  21,2-9       顶章       range dynamic-bootp 10.0.1.100 10.0.1.200;
        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;
        }
}
     如有回答.不勝感激
《解決方案》

我找到原因了.是因為
host ns {
                next-server marvin.redhat.com;
                hardware ethernet 12:34:56:78:AB:CD;
                fixed-address 207.175.42.254;
這一段話的作用.一個配置文件中貌似只能有一段這個話.
但不知道這樣表達的是什麼意思.這段話是dhcp保留地址吧.
但是為什麼一個一個配置文件只能寫一個保留地址呢?難道兩個作用域也只能寫一個保留地址?
請求大神為我解答一下.不勝感激!
《解決方案》

這段話是dhcp保留地址.
你可以寫多個host那樣的配置啊,比如host ns2 ......
《解決方案》

回復 3# chenyx
我去試試.我就是兩個DHCP的作用域里都有這段話反而啟動不起來.
不知道是不是  ns 後面需要跟編號的問題.

   
《解決方案》

那個是個例子,ns可以隨便修改
《解決方案》

回復 3# chenyx

非常感謝.果然是那樣.
果然是HOST這一行的配置問題.我這裡沒有該這一行的ns.
改過來可以正常啟動
不勝感激
   

[火星人 ] 請問在Linux下做DHCP多作用域時配置是這樣寫嗎?已經有524次圍觀

http://coctec.com/docs/service/show-post-12756.html