Windows XP Windows 7 Windows 2003 Windows Vista Windows教程綜合 Linux 系統教程
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟件教程
 Windows教程網 >> 電腦軟件教程 >> 服務器技術 >> 服務器綜合 >> DHCP服務器配置

DHCP服務器配置

日期:2017/1/23 16:29:29      編輯:服務器綜合

DHCP安裝1
1:首先安裝dhcp-3.0.5-18.el5包
2:安裝過後然後通過rpm -qc dhcp 查看他可以配置的文檔
3:找到/etc/dhcpd.conf這個文檔並且編輯
4:用vim編輯器編輯 vim /etc/dhcpd.conf
進去之後看到此文本是空的,不過可以看到注釋的一句話 (#   see /usr/share/doc/dhcp*/dhcpd.conf.sample )大概意思是:參考/usr/share/doc/dhcp*/dhcpd.conf.sample
5:參考上步的/usr/share/doc/dhcp*/dhcpd.conf.sample文檔,在vim etc/dhcpd.conf中執行:r /usr/share/doc/dhcp*/dhcpd.conf.sample 讀取這個文檔中的內容
6:修改現在的/etc/dhcpd.conf文檔
1 #
  2 # DHCP Server Configuration file.
  3 #   see /usr/share/doc/dhcp*/dhcpd.conf.sample 
  4 #
  5 ddns-update-style interim;
  6 ignore client-updates;
  7 option domain-name-servers 222.88.88.88,222.85.85.85;                                        (超級作用域的DNS服務器)
  8 subnet 192.168.60.0 netmask 255.255.255.0 {                                                   (一個普通作用域的網段,子網掩碼)
  9
 10 # --- default gateway
 11         option routers                  192.168.60.254;                                         (網關)
 12         option subnet-mask              255.255.255.0;                                           (子網掩碼)
 13
 14         option nis-domain               "domain.org";
 15         option domain-name              "test";                                                   (作用域的名字)
 16         filename                        "pxelinux.0";
 17         option time-offset              -18000; # Eastern Standard Time
 18 #       option ntp-servers              192.168.1.1;
 19 #       option netbios-name-servers     192.168.1.1;
 20 # --- Selects point-to-point node (default is hybrid). Don't change this unless
 21 # -- you understand Netbios very well
 22 #       option netbios-node-type 2;
 23
 24         range dynamic-bootp 192.168.60.1 192.168.60.10;
 25         default-lease-time 21600;
 26         max-lease-time 43200;
 27
 28         # we want the nameserver to appear at a fixed address
 29         #host AAA{
 30         #       next-server marvin.redhat.com;
 31         #       hardware ethernet 00:0C:29:68:2F:9D;
 32         #       fixed-address 192.168.60.2;
 33         #}


 34 }
 35 subnet 192.168.70.0 netmask 255.255.255.0 {
 36
 37 # --- default gateway
 38         option routers                  192.168.70.254;
 39         option subnet-mask              255.255.255.0;
 40
 41         option nis-domain               "domain.org";
 42         option domain-name              "test1";
 43         filename                        "pxelinux.0";
 44         option time-offset              -18000; # Eastern Standard Time
 45 #       option ntp-servers              192.168.1.1;
 46 #       option netbios-name-servers     192.168.1.1;
 47 # --- Selects point-to-point node (default is hybrid). Don't change this unless
 48 # -- you understand Netbios very well
 49 #       option netbios-node-type 2;
 50
 51         range dynamic-bootp 192.168.70.1 192.168.70.10;
 52         default-lease-time 21600;
 53         max-lease-time 43200;
 54
 55         # we want the nameserver to appear at a fixed address
 56 #       host AAA{
 57 #               next-server marvin.redhat.com;
 58 #               hardware ethernet 00:0C:29:68:2F:9D;
 59 #               fixed-address 192.168.60.2;
 60 #       }
 61 }
 62 subnet 192.168.10.0 netmask 255.255.255.0 {                                           (62-63這是一個空作用域,主要是為了匹配主機的IP地址)
 63 }
其中#表示注釋部分
這是本人機器上的dhcp配置,裡面需要做部分修改,我在這裡做了兩個作用域一個都是192.168.60.0網段的,另一個是192.168.70.0網段的,也可以把他們做成一個超級作用域不過要添加一條命令
在第7行後面添加一行“shared-network AAA(超級作用域的名字){ ”,然後在最後一行再寫一行“}”,最後wq保存退出。
 
作者“愚人小記”

Copyright © Windows教程網 All Rights Reserved