DHCP的配置

[root@chenxi ~]# cat /etc/dhcp/dhcpd.conf
# dhcpd.conf
#
# Sample configuration file for ISC dhcpd
#

# option definitions common to all supported networks...
option domain-name "chenxi"; # 自動分配的域名
option domain-name-servers 144.144.144.144;    #dns地址
#option routers 192.168.8.1 ;    # 網(wǎng)關(guān)服務(wù)

default-lease-time 600;    #服務(wù)器以秒為單位的租期.
max-lease-time 7200;       #客戶端最大要求的租期以秒為單位.

# Use this to enble / disable dynamic dns updates globally.
#ddns-update-style none;

# If this DHCP server is the official DHCP server for the local
# network, the authoritative directive should be uncommented.
#authoritative;

# Use this to send dhcp log messages to a different log file (you also
# have to hack syslog.conf to complete the redirection).
log-facility local7;

# No service will be given on this subnet, but declaring it helps the 
# DHCP server to understand the network topology.
subnet 192.168.9.0 netmask 255.255.255.0 {
    range 192.168.9.10 192.168.9.70;            #分配9.0網(wǎng)端
    option routers 192.168.9.1 ;    # 分配網(wǎng)關(guān)地址;如果這里做了配置默認(rèn)這里優(yōu)先級高
}
subnet 192.168.8.0 netmask 255.255.255.0 {
        range 192.168.8.10 192.168.8.70;           #如果這行注釋表示不分配自己所在的IP網(wǎng)段捆昏;只分配9.0網(wǎng)段地址
    option routers 192.168.8.1 ;    # 網(wǎng)關(guān)地址
}
subnet 10.152.187.0 netmask 255.255.255.0 {

}

# This is a very basic subnet declaration.

subnet 10.254.239.0 netmask 255.255.255.224 {
  range 10.254.239.10 10.254.239.20;
  option routers rtr-239-0-1.example.org, rtr-239-0-2.example.org;
}

# This declaration allows BOOTP clients to get dynamic addresses,
# which we don't really recommend.

subnet 10.254.239.32 netmask 255.255.255.224 {
  range dynamic-bootp 10.254.239.40 10.254.239.60;
  option broadcast-address 10.254.239.31;
  option routers rtr-239-32-1.example.org;
}

# A slightly different configuration for an internal subnet.
subnet 10.5.5.0 netmask 255.255.255.224 {
  range 10.5.5.26 10.5.5.30;
  option domain-name-servers ns1.internal.example.org;
  option domain-name "internal.example.org";
  option routers 10.5.5.1;
  option broadcast-address 10.5.5.31;
  default-lease-time 600;
  max-lease-time 7200;
}

# Hosts which require special configuration options can be listed in
# host statements.   If no address is specified, the address will be
# allocated dynamically (if possible), but the host-specific information
# will still come from the host declaration.
host passacaglia {
  hardware ethernet 0:0:c0:5d:bd:95;    # 表示只要此msck地址我就給你分配下面的地址
  fixed-address 192.168.8.100;
  server-name "toccata.fugue.com";
  option domain-name "internal.example.org";
}

# Fixed IP addresses can also be specified for hosts.   These addresses
# should not also be listed as being available for dynamic assignment.
# Hosts for which fixed IP addresses have been specified can boot using
# BOOTP or DHCP.   Hosts for which no fixed address is specified can only
# be booted with DHCP, unless there is an address range on the subnet
# to which a BOOTP client is connected which has the dynamic-bootp flag
# set.
host fantasia {
  hardware ethernet 08:00:07:26:c0:a5;
  fixed-address fantasia.fugue.com;
}

# You can declare a class of clients and then do address allocation
# based on that.   The example below shows a case where all clients
# in a certain class get addresses on the 10.17.224/24 subnet, and all
# other clients get addresses on the 10.0.29/24 subnet.

class "foo" {
  match if substring (option vendor-class-identifier, 0, 4) = "SUNW";
}

shared-network 224-29 {
  subnet 10.17.224.0 netmask 255.255.255.0 {
    option routers rtr-224.example.org;
  }
  subnet 10.0.29.0 netmask 255.255.255.0 {
    option routers rtr-29.example.org;
  }
  pool {
    allow members of "foo";
    range 10.17.224.10 10.17.224.250;
  }
  pool {
    deny members of "foo";
    range 10.0.29.10 10.0.29.230;
  }
}
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末隧甚,一起剝皮案震驚了整個濱河市,隨后出現(xiàn)的幾起案子超陆,更是在濱河造成了極大的恐慌诗越,老刑警劉巖九杂,帶你破解...
    沈念sama閱讀 221,888評論 6 515
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件祷嘶,死亡現(xiàn)場離奇詭異,居然都是意外死亡脖捻,警方通過查閱死者的電腦和手機阔逼,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 94,677評論 3 399
  • 文/潘曉璐 我一進(jìn)店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來地沮,“玉大人嗜浮,你說我怎么就攤上這事∧σ桑” “怎么了危融?”我有些...
    開封第一講書人閱讀 168,386評論 0 360
  • 文/不壞的土叔 我叫張陵,是天一觀的道長雷袋。 經(jīng)常有香客問我吉殃,道長,這世上最難降的妖魔是什么楷怒? 我笑而不...
    開封第一講書人閱讀 59,726評論 1 297
  • 正文 為了忘掉前任蛋勺,我火速辦了婚禮,結(jié)果婚禮上率寡,老公的妹妹穿的比我還像新娘迫卢。我一直安慰自己,他們只是感情好冶共,可當(dāng)我...
    茶點故事閱讀 68,729評論 6 397
  • 文/花漫 我一把揭開白布乾蛤。 她就那樣靜靜地躺著,像睡著了一般捅僵。 火紅的嫁衣襯著肌膚如雪家卖。 梳的紋絲不亂的頭發(fā)上,一...
    開封第一講書人閱讀 52,337評論 1 310
  • 那天庙楚,我揣著相機與錄音上荡,去河邊找鬼。 笑死馒闷,一個胖子當(dāng)著我的面吹牛酪捡,可吹牛的內(nèi)容都是我干的。 我是一名探鬼主播纳账,決...
    沈念sama閱讀 40,902評論 3 421
  • 文/蒼蘭香墨 我猛地睜開眼逛薇,長吁一口氣:“原來是場噩夢啊……” “哼!你這毒婦竟也來了疏虫?” 一聲冷哼從身側(cè)響起永罚,我...
    開封第一講書人閱讀 39,807評論 0 276
  • 序言:老撾萬榮一對情侶失蹤啤呼,失蹤者是張志新(化名)和其女友劉穎,沒想到半個月后呢袱,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體官扣,經(jīng)...
    沈念sama閱讀 46,349評論 1 318
  • 正文 獨居荒郊野嶺守林人離奇死亡,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點故事閱讀 38,439評論 3 340
  • 正文 我和宋清朗相戀三年羞福,在試婚紗的時候發(fā)現(xiàn)自己被綠了惕蹄。 大學(xué)時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片。...
    茶點故事閱讀 40,567評論 1 352
  • 序言:一個原本活蹦亂跳的男人離奇死亡治专,死狀恐怖焊唬,靈堂內(nèi)的尸體忽然破棺而出,到底是詐尸還是另有隱情看靠,我是刑警寧澤,帶...
    沈念sama閱讀 36,242評論 5 350
  • 正文 年R本政府宣布液肌,位于F島的核電站挟炬,受9級特大地震影響,放射性物質(zhì)發(fā)生泄漏嗦哆。R本人自食惡果不足惜谤祖,卻給世界環(huán)境...
    茶點故事閱讀 41,933評論 3 334
  • 文/蒙蒙 一、第九天 我趴在偏房一處隱蔽的房頂上張望老速。 院中可真熱鬧粥喜,春花似錦、人聲如沸橘券。這莊子的主人今日做“春日...
    開封第一講書人閱讀 32,420評論 0 24
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽旁舰。三九已至锋华,卻和暖如春,著一層夾襖步出監(jiān)牢的瞬間箭窜,已是汗流浹背毯焕。 一陣腳步聲響...
    開封第一講書人閱讀 33,531評論 1 272
  • 我被黑心中介騙來泰國打工, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留磺樱,地道東北人纳猫。 一個月前我還...
    沈念sama閱讀 48,995評論 3 377
  • 正文 我出身青樓,卻偏偏與公主長得像竹捉,于是被迫代替她去往敵國和親芜辕。 傳聞我的和親對象是個殘疾皇子,可洞房花燭夜當(dāng)晚...
    茶點故事閱讀 45,585評論 2 359

推薦閱讀更多精彩內(nèi)容