You are on page 1of 10

LAB DHCP

1. GII THIU DHCP l vit tt ca Dynamic Host Configuration Protocol: Giao thc Cu hnh Host ng DHCP c thit k lm gim thi gian chnh cu hnh cho mng TCP/IP bng cch t ng gn cc a ch IP cho khch hng khi h vo mng. Mt s khi nim cn quan tm DHCP client - My trm DHCP: l mt thit b ni vo mng v s dng giao thc DHCP ly cc thng tin cu hnh nh l a ch mng, a ch my ch DNS. DHCP server - My ch DHCP: l mt thit b ni vo mng c chc nng tr v cc thng tin cn thit cho my trm DHCP khi c yu cu. (c th l router hoc PC Server). BOOTP relay agents - Thit b chuyn tip BOOTP: l mt my trm hoc mt router c kh nng chuyn cc thng ip DHCP gia DHCP server v DHCP client. Binding - Ni kt : l mt tp hp cc thng tin cu hnh trong c t nht mt a ch IP, c s dng bi mt DHCP client. Cc ni kt c qun l bi my ch DHCP. 2. MC CH Bi lab ny s gip cc bn c c k nng cn thit qun tr h thng mng trong vic cp pht a ch IP cho mt mng n gin n phc tp bng cch thit lp mt hoc nhiu DHCP Server trn thit b phn cng Router ca Cisco 3. M T BI LAB Trng hp 1 : DHCP Client kt ni trc tip vi DHCP Server M hnh ny thch hp cho cc m hnh mng nh c cu trc n gian.

Trng hp 2: DHCP Client ni vi DHCP Server thng quan DHCP Relay Agent

M hnh ny thch hp cho cc mng c quy m ln, tri di trn nhiu khu vc khc nhau nh trong mt to nh hoc mt thnh ph, mt quc giaTrong trng hp ny Router c th cu hnh mt hoc nhiu Pool (dy a ch mng) cp pht a ch IP cho nhiu mng khc nhau

4. CU HNH CHI TIT

LAB 1:
Trong bi lab ny Router v my tnh s kt ni trc tip

Cc bc cu hnh Router >ena Router #conf t Router (config)#host DHCPServer DHCPServer (config)#int f 0/0 DHCPServer (config-if)#ip add 192.168.1.1 255.255.255.0 DHCPServer (config-if)#no sh DHCPServer (config-if)#exi DHCPServer (config)#service dhcp // m dch v DHCP trn Router

DHCPServer (config)#ip dhcp pool net192.168.1.0 //nh ngha tn 1 pool DHCPServer (dhcp-config)#network 192.168.1.0 /24 DHCPServer (dhcp-config)#default-router 192.168.1.1 DHCPServer (dhcp-config)#dns-server 10.0.0.1 DHCPServer (dhcp-config)#domain-name test.com DHCPServer (dhcp-config)#lease 2 DHCPServer (dhcp-config-dhcp)#exit DHCPServer (config)#ip dhcp excluded-address 192.168.1.240 192.168.1.254 DHCPServer (config)#end DHCPServer# show ip dhcp binding // kin tra nhng IP cp //thi gian thay IP mi (ngy/gi/pht) //dy IP s cp

Thc hin trn GNS3


Thit lp m hnh nh pha di trn GNS3 Ni cng Fastethernet ca Router vi Card mng ca my tnh. Bi lab ny s dng Card loopback trn my tnh

Tin hnh cu hnh cc bc trn Router nh cc lnh pha trn

Chuyn card mng ca my tnh v ch Obtain an IP address automatically

My tnh nhn c a ch IP nm trong dy a ch m DHCP Server c cu hnh cp pht cho Client

kim tra xem Router cp pht nhng a ch IP ta s dng lnh: DHCPServer# show ip dhcp binding

Nh vy Router cp c 1 a ch IP cho my tnh c a ch vt l Card mng l 0102.004c.4f4f.50 vi a ch l 192.168.1.2 **********************************************************

LAB 2:

Cc bc cu hnh Cu hnh DHCP Server Router >ena Router #conf t Router (config)#host DHCPServer DHCPServer (config)#int s 0/0 DHCPServer (config-if)#ip add 192.168.1.1 255.255.255.0 DHCPServer (config-if)#no sh DHCPServer (config-if)#exit DHCPServer (config)#service dhcp DHCPServer (config)#ip dhcp pool net194.168.1.0 DHCPServer (dhcp-config)#network 194.168.1.0 /24 DHCPServer (dhcp-config)#default-router 194.168.1.1 DHCPServer (dhcp-config)#dns-server 10.0.0.1 DHCPServer (dhcp-config)#domain-name test.com DHCPServer (dhcp-config)#lease 2 DHCPServer (dhcp-config)#exit DHCPServer (config)#ip dhcp excluded-address 194.168.1.240 194.168.1.254 DHCPServer (config)#ip dhcp pool net195.168.1.0 DHCPServer (dhcp-config)#network 195.168.1.0 /24 DHCPServer (dhcp-config)#default-router 195.168.1.1 DHCPServer (dhcp- config)#dns-server 10.0.0.1 DHCPServer (dhcp-config)#domain-name test.com DHCPServer (dhcp-config)#lease 2 DHCPServer (dhcp-config)#exit DHCPServer (config)#ip dhcp excluded-address 195.168.1.240 195.168.1.254 Cu hnh DHCP cp a ch 195.168.1.10 cho my LAPTOP c a ch Physical Address l 0101.0011.1121.21 DHCPServer (config)#ip dhcp pool LAPTOP DHCPServer (dhcp-config)#host 195.168.1.10 255.255.255.0 DHCPServer (dhcp-config)# client-identifier 0101.0011.1121.21 //thi gian thay IP mi (ngy/gi/pht) // m dch v DHCP trn Router //to pool c tn Net192.168.4.0 //dy IP s cp

DHCPServer (dhcp-config)#default-router 195.168.1.1 DHCPServer (dhcp-config)#dns-server 10.0.0.1 DHCPServer (dhc -config)#domain-name test.com DHCPServer (dhcp-config)#lease 3 DHCPServer (config)#end DHCPServer# show ip dhcp binding // kin tra nhng IP cp

Cu hnh R1 lm DHCP Relay Agent

Router>ena Router#conf t Router (config)#hostname Relay-1 Relay-1(config)#int s 0/0 Relay-1(config-if)#ip add 192.168.1.2 255.255.255.0 Relay-1(config-if)#no sh Relay-1(config-if)#exi Relay-1(config)#int s 0/1 Relay-1(config-if)#ip add 193.168.1.1 255.255.255.0 Relay-1(config-if)#no sh Relay-1(config-if)#exi Relay-1(config)#int f 0/0 Relay-1(config-if)#ip add 195.168.1.1 255.255.255.0 Relay-1(config-if)#no sh Relay-1(config-if)#ip helper-address 192.168.1.1 Relay-1(config-if)#exit Relay-1(config)#router rip Relay-1(config-router)#net 192.168.1.0 Relay-1(config-router)#net 193.168.1.0 Relay-1(config-router)#net 195.168.1.0 Relay-1(config-router)#end Cu hnh R2 lm DHCP Relay Agent Router>ena Router#conf t Router (config)#hostname Relay-2 Relay-2(config)#int s 0/1 Relay-2(config-if)#ip add 193.168.1.2 255.255.255.0 Relay-2(config-if)#no sh Relay-2(config-if)#exi

//a ch thuc DHCP Server

Relay-2(config)#int f 0/0 Relay-2(config-if)#ip add 194.168.1.1 255.255.255.0 Relay-2(config-if)#no sh Relay-2(config-if)#ip helper-address 192.168.1.1 Relay-2(config-if)#exit Relay-2(config)#router rip Relay-2(config-router)#net 193.168.1.0 Relay-2(config-router)#net 194.168.1.0 Relay-2(config-router)#end

//a ch thuc DHCP Server

Thc hin trn GNS3


Thit lp m hnh bi Lab nh hnh bn di

Tin hnh cu hnh cc Router nh cc lnh pha trn Cu hnh DHCP Server

Cu hnh DNS Relay Agent-1

Cu hnh DNS Relay Agent-2

5. KT QU THU C Sau khi thc hin cu hnh th nghim 2 bi lab ta c th hiu c k thut cu hnh my ch DHCP trn thit b Router Cisco. Phn bit v hiu hn v m hnh trin khai h thng my ch DHCP trong mt mng t quy m nh n quy m ln

You might also like