Thursday, February 23, 2012

Windows Server 2003, 2008 မွာ Command Line ကေန DHCP Install ျပဳလုပ္ပံု


က်ေနာ္တို႔ Windows Server 2003, 2008 အစရွိတဲ႔ Server Version OS ေတြမွာ DHCP Server ရဲ႕ Role ေတြ နဲ႔ DHCP Parameters ေတြျဖစ္တဲ႔ Scope, IP Range အစရွိတာေတြကို Command Line (CMD) ကို အသံုးျပဳျပီး Configure ျပဳလုပ္ႏိုင္တဲ႔ အတြက္ အသံုး၀င္တဲ႔ CMD ေတြျဖစ္ပါတယ္ .. ေအာက္ပါ အဆင္႔ ေတြ အတိုင္း Command Prompt မွာ ျပဳလုပ္ၾကည္႔ပါက မိမိ Install ျပဳလုပ္လိုတဲ႔ DHCP Server တစ္ခုကို အလြယ္တကူ ရရွိမွာပါ ..


DHCP Server Role ကို Install ျပဳလုပ္ရန္

DHCP Server Role တစ္ခု သတ္မွတ္ဖို႔အတြက္ ေအာက္ပါ Command Line ကို Command Prompt မွာ ရုိက္ထည္႔ပါ ...
C:\Users\Administrator>start /w ocsetup DHCPServer
Windows Server 2008 မွာေတာ႔ Server Role အမည္ကို ေအာက္ပါအတိုင္း "DHCPServerCore" လို႔ေပးရပါမယ္
C:\Users\Administrator>start /w ocsetup DHCPServerCore
DHCP Service ကို Automatic ထားဖို႔အတြက္ ေအာက္ပါ Command Line ကို အသံုးျပဳပါ ..
C:\Users\Administrator> sc config dhcpserver start= auto
ျပီးရင္ DHCP Server ကို စတင္ရပါမယ္ ...
C:\Users\Administrator>net start dhcpserver


Add DHCP Server and Authroize in AD

DHCP Server သည္ AD Domain ေအာက္တြင္ Installed ျပဳလုပ္ထားပါက .. Active Directory (AD) မွာ DHCP Server ကို Authorize ျပဳလုပ္ရပါမယ္ ... အဲဒီအတြက္ netsh Command ကို အသံုးျပဳပါတယ္ ..

C:\Users\Administrator>netsh dhcp add server dc1 192.168.0.5
Adding server dc1, 192.168.0.5
Command completed successfully.
DHCP Server သည္ DC1 နာမည္နဲ႔ျဖစ္ျပီး IP Address ကေတာ႔ 192.168.0.5 လို႔ သတ္မွတ္လိုက္ပါ တယ္ .. ျပီးရင္ ေအာက္ပါ Command ကို အသံုးျပဳျပီး DHCP Scope တစ္ခုကို ထည္႔သြင္းပါမယ္ ..
C:\Users\Administrator>netsh dhcp server 192.168.0.5 add scope 192.168.10.0 255.255.255.0 Scope1 Scopevlan10
Command completed successfully.

DHCP scope သည္ 192.168.10.0 255.255.255.0 ျဖစ္ပါတယ္ ..
Scope1 ဆိုတာသည္ Scope Name ျဖစ္ပါတယ္ ..
ScopeVlan10 ဆိုတာ Comment တစ္ခုသာျဖစ္ပါတယ္ ..
Syntax is
netsh dhcp server 192.168.0.5 add scope <Subnet> <Subnet mask> <ScopeName> <Scope comment>
ေအာက္ပါအတိုင္း Scope IP Range ကိုသတ္မွတ္ပါ .. DHCP ကေနျပီး ေအာက္ပါ IP Range အတြင္း သတ္မွတ္ေပးပါမယ္ ..
C:\Users\Administrator>netsh dhcp server 192.168.0.5 scope 192.168.10.0 add ipra nge 192.168.10.1 192.168.10.254
Changed the current scope context to 192.168.10.0 scope.
Command completed successfully.
ဒါဆိုရင္ Scope ျဖစ္တဲ႔ 192.168.10.0 အတြက္ IP Range 192.168.10.1 - 192.168.10.254 ထိရရွိပါ မယ္ ..
Syntax is
netsh dhcp server <Server> scope 192.168.10.0 add iprange <StartIP> <EndIP>
C:\Users\Administrator>netsh dhcp server 192.168.0.5 scope 192.168.10.0 add excluderange 192.168.10.1 192.168.10.25
Changed the current scope context to 192.168.10.0 scope.
Command completed successfully.
Exclusion IP Range ကေတာ႔ 192.168.10.1 to 192.168.10.25 ထိ သတ္မွတ္လိုက္ပါတယ္ ..
Syntax is
netsh dhcp server <Server> scope <Scope> add excluderange <StartExclusion> <End-Exclusion>
Option Code 003 ကိုသတ္မွတ္ပါတယ္ ...
C:\Users\Administrator>netsh dhcp server 192.168.0.5 scope 192.168.10.0 set optionvalue 003 IPADDRESS 10.1.1.1 10.1.1.2
Changed the current scope context to 192.168.10.0 scope.
Command completed successfully.
Gateways ႏွစ္ခုကေတာ႔ 10.1.1.1 & 10.1.1.2 တို႔ဆိုျပီး သတ္မွတ္လိုက္ပါတယ္ .. Option Code 003 ကေတာ႔ Default Router အတြက္ျဖစ္ပါတယ္ ..
Syntax is
netsh dhcp server <Server> scope 192.168.10.0 set optionvalue 003 IPADDRESS <Gateway1> <Gateway2>
Option Code 006 ကို Default DNS Server အတြက္သတ္မွတ္ပါမယ္ ...
C:\Users\Administrator>netsh dhcp server 192.168.0.5 scope 192.168.10.0 set optionvalue 006 IPADDRESS 192.168.0.5 192.168.10.1
Changed the current scope context to 192.168.10.0 scope.
Command completed successfully.
DNS Servers အျဖစ္ 192.168.0.5 & 192.168.10.1 ဆိုျပီးသတ္မွတ္လိုက္ပါတယ္ ...
Syntax is
netsh dhcp server <Server> scope 192.168.10.0 set optionvalue 006 IPADDRESS <Primary DNS> <Secondary DNS>
အခုဆိုရင္ DHCP Server အတြက္ Scope သတ္မွတ္ျခင္းေတြျပီးဆံုးသြားပါျပီ .. ဒါေပမဲ႔ DHCP Scope ကို Activate ျပဳလုပ္ရပါမယ္
C:\Users\Administrator>netsh dhcp server 192.168.0.5 scope 192.168.10.0 set state 1
Changed the current scope context to 192.168.10.0 scope.
Command completed successfully.
အထက္ပါ Command ေတြကို အသံုးျပဳျပီး DHCP Server တစ္ခုကို အလြယ္တကူ တည္ေဆာက္ႏိုင္ ပါတယ္ ..

0 ေ၀ဖန္ခ်က္မ်ား:

Post a Comment