CentOS 5.5 DHCP伺服器安裝指南

來源:互聯網
上載者:User

CentOS 5.5 DHCP伺服器安裝指南:

1.直接用yum -y dhcp安裝好dhcp rpm軟體包。也可以到http://pbone.net上下載即可。

2.安裝好之後就是拷貝設定檔dhcpd.conf檔案,在/usr/share/doc/dhcp-3.0/dhcpd.conf.example 把這個樣本檔案拷重新命名拷貝到 /etc/dhcpd.conf即可



3.vi /etc/dhcpd.conf 內容如下這個是我已經修改好的,只要修改這個檔案即可。

下載dhcpd.conf for CentOS 5.5

ddns-update-style interim;
ignore client-updates;

subnet 192.168.10.0 netmask 255.255.255.0 { //subnet一個子網中的用戶端,動態地指定ip地址,則在此subnet聲明中,必須包含一組ip位址範圍。

# --- default gateway
option routers 192.168.10.15; //網關地址
option subnet-mask 255.255.255.0;//子網路遮罩

option nis-domain "my.lk.org";
option domain-name "my.lk.org";
option domain-name-servers 202.101.172.35; //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). Dont change this unless
# -- you understand Netbios very well
# option netbios-node-type 2;

range dynamic-bootp 192.168.10.128 192.168.10.254; //位址集區pool範圍地址
default-lease-time 21600;//預設的ip租用時間期限單位為秒

max-lease-time 43200;//ip租用最長的期限單位為秒

# we want the nameserver to appear at a fixed address //用來綁定伺服器的mac物理地址。
host ns {
next-server stationx.example.com;
hardware ethernet 00:0C:29:7E:7F:86;
fixed-address 192.168.10.223;
}
}

4.service dhcpd start 即可啟動,如果想開機啟動可以ntsysv 服務當中選擇dhcpd星號即可。

設定檔也可以寫成以下形式:

#//192.168.10.*
subnet 192.168.10.0 netmask 255.255.255.0 {
option routers 192.168.10.15; 網關
option subnet-mask 255.255.255.0; //子網路遮罩
option broadcast-address 192.168.10.255; //廣播位址
option domain-name-servers
202.101.172.xx,202.101.172.4.xx
range dynamic-bootp 192.168.10.20 192.168.10.150; //位址集區範圍
default-lease-time 21600;
max-lease-time 43200;
}
 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.