從書上學來的,是以是轉載了
[[email protected] ~]# cp -p /usr/share/doc/dhcp-3.0.1/dhcpd.conf.sample /etc/dhcpd.conf //預設DHCP主配置檔案dhcpd.conf沒有在/etc/下面,需要複制模闆到/etc/下,可以使用find / -name dhcpd.conf.sample /etc/ [[email protected] ~]# cat /etc/dhcpd.conf ddns-update-style interim; ignore client-updates; subnet 192.168.0.0 netmask 255.255.255.0 { //使用者可以用subnet語句通知DHCP伺服器,把伺服器可以配置設定的IP位址範圍限制在規定的子網内。Subnet語句包含了表示子網路遮罩的netmask # --- default gateway option routers 192.168.0.1; //設定網關和路由器的IP位址 option subnet-mask 255.255.255.0; //設定子網路遮罩 option nis-domain "domain.org"; option domain-name "domain.org"; //設定DNS域名 option domain-name-servers 192.168.1.1; //設定DNS伺服器的IP位址(可多個) 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 192.168.0.128 192.168.0.254; //通過range語句,可以指定動态配置設定給庫互動的IP位址範圍。在range語句中需要知道位址段的首位址和尾位址(可設多個範圍) default-lease-time 21600; //指定用戶端IP位址預設租用的時間長度是多少(以秒為機關) max-lease-time 43200; //設定客戶最長租用IP位址時間(以秒為機關) # we want the nameserver to appear at a fixed address host ns { //給某些主機綁定固定IP(可設定多個) next-server marvin.redhat.com; //設定用于定義伺服器從影到檔案裝副的主機名,一般不用(僅用于設定無盤工作站) hardware ethernet 12:34:56:78:AB:CD; //需設定固定IP的網卡的MAC位址 fixed-address 207.175.42.254; //對指定的MAC位址配置設定IP位址 } }
轉載于:https://blog.51cto.com/kennywong/223329