|
對(duì)于命令行來說,相信很多朋友都不陌生。那么用命令行怎么進(jìn)行DHCP的配置呢?不知道這個(gè)方法大家是否都會(huì)用。那么這里我們就來詳細(xì)了解一下吧。
在一些設(shè)置中,我們可以不拘泥一種方式。這里我們講解一下用命令行來設(shè)置DHCP的有關(guān)內(nèi)容。一臺(tái)windows 2000 server,單機(jī)環(huán)境,安裝了DHCP服務(wù),讓我們用命令行的方式來配置一臺(tái)DHCP服務(wù)器吧
1、首先進(jìn)入命令行DHCP配置模式
1.F:>netsh
2.netsh>DHCP
3.DHCP>server 192.168.0.1 //192.168.0.1是你需要管理的DHCP服務(wù)器的地址
4.DHCP server>
2、
1.DHCP server>show scope
作用域總的數(shù)目: 0
命令成功完成。察看目標(biāo)上作用域配置的情況,此時(shí)是沒有scope的。
3、用命令行添加一個(gè)scope
1.DHCP server>add scope 192.168.0.0 255.255.255.0 192.168.0.0 MyComment
好的,我們?cè)趍mc中察看DHCP,看出現(xiàn)了什么變化,好大一個(gè)藍(lán)色的感嘆號(hào)的scope,里面什么配置都沒有別慌我們繼續(xù)下去(當(dāng)時(shí),我就是亂慌了半天,浪費(fèi)時(shí)間)
4、
1.DHCP server>scope 192.168.0.1
將當(dāng)前作用域上下文改變到 192.168.0.1 作用域。
5、
1.DHCP server scope>add iprange 192.168.0.2 192.168.0.254 DHCP
用命令行添加一個(gè)分配地址范圍
6、
1.DHCP server scope>add excluderange 192.168.0.1 192.168.0.1
2.
3.DHCP server scope>add excluderange 192.168.0.241 192.168.0.254
添加兩個(gè)排除范圍192.168.0.1,192.168.0.241-192.168.0.254
7、
1.DHCP server scope>add reservedip 192.168.0.240 08002b30369B Mr.Wu Mr.wu both
添加一個(gè)保留ip,給了MAC 08002b30369B ,保留的名字稱為Mr.Wu
8、
1.DHCP server scope>set optionvalue 003 ipaddress 192.168.0.1
2.
3.DHCP server scope>set optionvalue 006 ipaddress 192.168.0.1
在這個(gè)scope中添加兩個(gè)作用域選項(xiàng)003和006
9、DHCP server scope>set reservedoptionvalue 192.168.0.240 003 ipaddress 192.168.0.1
設(shè)置保留地址192.168.0.240的作用域選項(xiàng)003
現(xiàn)在scope 192.168.0.0配置結(jié)束了,你也可以配置別的選擇的項(xiàng)目,看你的需要了
此時(shí)在mmc中把scope 192.168.0.0刷新一下,一切都正常了
10、同樣方法配置兩個(gè)scope 192.168.1.0和192.168.2.0
11、用命令行配置superscope
1.F:>netsh
2.netsh>DHCP
3.DHCP>server 192.168.0.1
4.DHCP server>scopt 192.168.0.0
5.DHCP server scope>set superscope 192.168.0-192.168.2 1
6.
7.F:>netsh
8.netsh>DHCP
9.DHCP>server 192.168.0.1
10.DHCP server>scopt 192.168.1.0
11.DHCP server scope>set superscope 192.168.0-192.168.2 1
刷新DHCP服務(wù)器,看看多了些什么東西
12、添加class
1.DHCP server>add class workgroup1 workgroup1 ClassForWorkgroup1 0這樣就添加了一個(gè)用戶class
13、添加,配置多播作用域
1.DHCP server>add mscope 224.0.0.0 mscope 40 2.DHCP server>mscope 224.0.0.0
3.DHCP server mscope>add iprange 224.0.0.1 224.0.0.10
4.DHCP server mscope>add excluderange 224.0.0.1 224.0.0.1
14、dump的問題
1.netsh DHCP server 192.168.0.1 dump >>e:1.txt12 |
【收藏】【打印】【進(jìn)入論壇】 |
|
|
|
|
|
|
|