Cisco Router 'larda DHCP Konfigurasyonu

MerhabaBu Dökümanda DHCP (Dynamic Host Configuration Protocol ) : Basitce dhcp ve Relay agent konfigurasyonuna değineceğiz.

 Cisco Router ‘larda DHCP Konfigurasyonu


R4 serverimiz.

configuring pool———–>

R4(config)#ip dhcp pool LAN
R4(dhcp-config)#network 10.0.0.0 /24
R4(dhcp-config)#default-router 10.0.0.4
R4(dhcp-config)#domain-name ciscotr.net
 exculiding address———->
R4(config)#ip dhcp excluded-address 10.0.0.1 10.0.0.10
R4(config)#
ip address conflictlerini disable etmek———–>

R4(config)#no ip dhcp conflict logging
R4(config)#

R4#sh run int e0/0
Building configuration…
Current configuration : 77 bytes
!
interface Ethernet0/0
ip address 10.0.0.4 255.255.255.0
half-duplex
end

R4#

R1 e gidip e0/0 a ip addresini koyalim

R1#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#int e0/0
R1(config-if)#ip add dhcp
R1(config-if)#end
R1#
*Mar 1 02:04:39.833: %SYS-5-CONFIG_I: Configured from console by console
R1#
*Mar 1 02:04:44.965: %DHCP-6-ADDRESS_ASSIGN: Interface Ethernet0/0 assigned DHCP address 10.0.0.13, mask 255.255.255.0, hostname R1

R1#

R1#show ip interface brief
Interface IP-Address OK? Method Status Protocol
Ethernet0/0 10.0.0.13 YES DHCP up up

Görüldüğü üzere address e0/0 ya verildi bunu gerek consol mesajindan gereksede sh ip int brief outputundan gorebiliyoruz… 

Şimdi r6 gidip bu olayi Debug ile gorelim..

R6#debug dhcp det
R6#debug dhcp detail
DHCP client activity debugging is on (detailed)
R6#config t
Enter configuration commands, one per line. End with CNTL/Z.
R6(config)#int e0/0
R6(config-if)#ip add dhcp
R6(config-if)#end
R6#
02:09:58: DHCP: DHCP client process started: 10——>
02:09:58: RAC: Starting DHCP discover on Ethernet0/0
02:09:58: DHCP: Try 1 to acquire address for Ethernet0/0
R6#
02:09:59: %SYS-5-CONFIG_I: Configured from console by console
R6#
02:10:02: DHCP: Shutting down from get_netinfo()
02:10:02: DHCP: Attempting to shutdown DHCP Client
02:10:03: DHCP: allocate request
02:10:03: DHCP: new entry. add to queue
02:10:03: DHCP: SDiscover attempt # 1 for entry:
02:10:03: Temp IP addr: 0.0.0.0 for peer on Interface: Ethernet0/0
02:10:03: Temp sub net mask: 0.0.0.0
02:10:03: DHCP Lease server: 0.0.0.0, state: 1 Selecting
02:10:03: DHCP transaction id: 77071C
02:10:03: Lease: 0 secs, Renewal: 0 secs, Rebind: 0 secs
02:10:03: Next timer fires after: 00:00:02
02:10:03: Retry count: 1 Client-ID: cisco-0030.809a.8de0-Et0/0
02:10:03: Hostname: R6
02:10:03: DHCP: SDiscover: sending 294 byte length DHCP packet
02:10:03: DHCP: SDiscover 294 bytes
R6#
02:10:03: B’cast on Ethernet0/0 interface from 0.0.0.0
R6#
02:10:05: DHCP: Received a BOOTREP pkt
02:10:05: DHCP: Scan: Message type: DHCP Offer
02:10:05: DHCP: Scan: Server ID Option: 10.0.0.4 = A000004
02:10:05: DHCP: Scan: Lease Time: 86400
02:10:05: DHCP: Scan: Renewal time: 43200
02:10:05: DHCP: Scan: Rebind time: 75600
02:10:05: DHCP: Scan: Subnet Address Option: 255.255.255.0
02:10:05: DHCP: Scan: Router Option: 10.0.0.4
02:10:05: DHCP: Scan: Domain Name: ciscotr.net
02:10:05: DHCP: rcvd pkt source: 10.0.0.4, destination: 255.255.255.255
02:10:05: UDP sport: 43, dport: 44, length: 308
02:10:05: DHCP op: 2, htype: 1, hlen: 6, hops: 0
02:10:05: DHCP server identifier: 10.0.0.4
02:10:05: xid: 77071C, secs: 0, flags: 8000
02:10:05: client: 0.0.0.0, your: 10.0.0.14
02:10:05: srvr: 0.0.0.0, gw: 0.0.0.0
02:10:05: options block length: 60
02:10:05: DHCP Offer Message Offered Address: 10.0.0.14
02:10:05: DHCP: Lease Seconds: 86400 Renewal secs: 43200 Rebind secs: 7
R6#5600
02:10:05: DHCP: Server ID Option: 10.0.0.4
02:10:05: DHCP: offer received from 10.0.0.4
02:10:05: DHCP: SRequest attempt # 1 for entry:
02:10:05: Temp IP addr: 10.0.0.14 for peer on Interface: Ethernet0/0
02:10:05: Temp sub net mask: 255.255.255.0
02:10:05: DHCP Lease server: 10.0.0.4, state: 2 Requesting
02:10:05: DHCP transaction id: 77071C
02:10:05: Lease: 86400 secs, Renewal: 0 secs, Rebind: 0 secs
02:10:05: Next timer fires after: 00:00:01
02:10:05: Retry count: 1 Client-ID: cisco-0030.809a.8de0-Et0/0
02:10:05: Hostname: R6
02:10:05: DHCP: SRequest- Server ID option: 10.0.0.4
02:10:05: DHCP: SRequest- Requested IP addr option: 10.0.0.14
02:10:05: DHCP: SRequest placed lease len option: 86400
02:10:05: DHCP: SRequest: 312 bytes
02:10:05: DHCP: SRequest: 312 bytes
02:10:05: B’cast on Ethernet0/0 interface from 0.0.0.0
02:10:05: DHCP: Received a BOOTREP pkt
02:10:05: DHCP: Scan: Message type: DHCP Ack
02:10:05: DHCP: Scan: Server ID Option: 10.0.0.4 = A000004
02:10:05: DHCP: Scan: Lease Time: 86400
02:10:05: DHCP: Scan: Renewal time: 43200
02:10:05: DHCP: Scan: Rebind time: 75600
02:10:05: DHCP: Scan: Subnet Address Option: 255.255.255.0
02:10:05: DHCP: Scan: Router Option: 10.0.0.4
02:10:05: DHCP: Scan: Domain Name: ciscotr.net
02:10:05: DHCP: rcvd pkt source: 10.0.0.4, destination: 255.255.255.255
02:10:05: UDP sport: 43, dport: 44, length: 308
02:10:05: DHCP op: 2, htype: 1, hlen: 6, hops: 0
02:10:05: DHCP server identifier: 10.0.0.4
02:10:05: xid: 77071C, secs: 0, flags: 8000
02:10:05: client: 0.0.0.0, your: 10.0.0.14
02:10:05: srvr: 0.0.0.0, gw: 0.0.0.0
02:10:05: options block length: 60
02:10:05: DHCP Ack Message
02:10:05: DHCP: Lease Seconds: 86400 Renewal secs: 43200 Rebind secs: 75600
02:10:05: DHCP: Server ID Option: 10.0.0.4R6#
R6#
02:10:08: DHCP: Releasing ipl options:
02:10:08: DHCP: Applying DHCP options:
02:10:08: Setting default_gateway to 10.0.0.4
02:10:08: Adding default route 10.0.0.4
02:10:09: Setting default domain to ciscotr.net
02:10:09: DHCP Client Pooling: ***Allocated IP address: 10.0.0.14
02:10:09: Allocated IP address = 10.0.0.14 255.255.255.0
 R6#
02:10:09: %DHCP-6-ADDRESS_ASSIGN: Interface Ethernet0/0 assigned DHCP address 10.0.0.14, mask 255.255.255.0,

hostname R6————>

R6#un all
All possible debugging has been turned off
R6#
 

R6#show ip interface brief
Interface IP-Address OK? Method Status Protocol
Ethernet0/0 10.0.0.14 YES DHCP up up
 

sonuctanda goruldugu uzere dhcp client started debug ile baslayan ve ip assigment ile biten bir debug goruyoruz…ve sh ip int b sonucu 

Birde client dhcp sonuclarini gorelim

R6#sh dhcp server
DHCP server: ANY (255.255.255.255)
Leases: 1
Offers: 1 Requests: 1 Acks: 1 Naks: 0
Declines: 0 Releases: 0 Bad: 0
Subnet: 255.255.255.0 DNS Domain: ciscotr.net
 

R6#sh dhcp lease
Temp IP addr: 10.0.0.14 for peer on Interface: Ethernet0/0
Temp sub net mask: 255.255.255.0
DHCP Lease server: 10.0.0.4, state: 3 Bound
DHCP transaction id: 77071C
Lease: 86400 secs, Renewal: 43200 secs, Rebind: 75600 secs
Temp default-gateway addr: 10.0.0.4
Next timer fires after: 11:54:42
Retry count: 0 Client-ID: cisco-0030.809a.8de0-Et0/0
Hostname: R6
 
R6#

server tarafi sonuclari…

R4#sh ip dhcp binding
Bindings from all pools not associated with VRF:
IP address Client-ID/ Lease expiration Type
Hardware address/
User name
10.0.0.13 0063.6973.636f.2d30. Mar 02 1993 02:04 AM Automatic
3062.302e.3634.3764.
2e64.3532.302d.4574.
302f.30
10.0.0.14 0063.6973.636f.2d30. Mar 02 1993 02:10 AM Automatic
3033.302e.3830.3961.
2e38.6465.302d.4574.
302f.30
R4#

R4#sh ip dhcp server statistics
Memory usage 14362
Address pools 1
Database agents 0
Automatic bindings 2
Manual bindings 0
Expired bindings 0
Malformed messages 0
Secure arp entries 0
Message Received
BOOTREQUEST 0
DHCPDISCOVER 4
DHCPREQUEST 4
DHCPDECLINE 0
DHCPRELEASE 5
DHCPINFORM 0

Message Sent
BOOTREPLY 0
DHCPOFFER 4
DHCPACK 4
DHCPNAK 0
R4#

 Reserving address to host—————————>

r1
R1(config-if)#ip add dhcp

r4

R4#debug ip dhcp server pac
—>debug yapiyoruz cunku bize client id si lazim mac addresi degil…
R4#
R4#
R4#
02:29:39: DHCPD: DHCPDISCOVER received from client 0063.6973.636f.2d30.3062.302e.3634.3764.2e64.3532. 302d.4574.302f.30 on interface Ethernet0/0.
R4#
R4#
R4#config t
Enter configuration commands, one per line. End with CNTL/Z.
R4(config)#do un all
All possible debugging has been turned off
R4(config)#ip dhcp pool RESERVE
R4(dhcp-config)#host 10.0.0.5 255.255.255.0
R4(dhcp-config)#$f.2d30.3062.302e.3634.3764.2e64.3532.302d .4574.302f.30
R4(dhcp-config)#default
R4(dhcp-config)#default-router 10.0.0.4
R4(dhcp-config)#dom
R4(dhcp-config)#domain-name ciscotr.com
R4(dhcp-config)#end
R4#

10.0.0.5 in r1 int e0/0 na assign olmasi bekleniyor…

 R1#sh ip int b
Interface IP-Address OK? Method Status Protocol
Ethernet0/0 10.0.0.5 YES DHCP up up
ve iste orada…

r4
R4#sh ip dhcp binding
Bindings from all pools not associated with VRF:
IP address Client-ID/ Lease expiration Type
Hardware address/
User name
10.0.0.5 0063.6973.636f.2d30. Infinite Manual
3062.302e.3634.3764.
2e64.3532.302d.4574.
302f.30
R4#
02:31:56: %SYS-5-CONFIG_I: Configured from console by console
R4#
ip helper(windowscular iyi bilir Relay agent)
eger dhcp server adresleri verilecek olan hostlarin subnet segmentine direk bagli degilse bu yonteme bas vurulur…

simdi r5 server.

R5#ping 10.0.0.4

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.0.0.4, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 28/29/32 ms
R5#
R5#
R5#config t
Enter configuration commands, one per line. End with CNTL/Z.
R5(config)#ip dhcp pool RELAY-AGENT
R5(dhcp-config)#netw 10.0.0.0 /24
R5(dhcp-config)#domain-name ciscotr.com
R5(dhcp-config)#default-router 10.0.0.4
R5(dhcp-config)#end
R5#

 r4 relay agentimiz………
R4#
R4#config t
Enter configuration commands, one per line. End with CNTL/Z.
R4(config)#int e0/0
R4(config-if)#ip helper-address 155.1.45.5
R4(config-if)#end
R4#
r1 ve r6 clientR1#config t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#int e0/0
R1(config-if)#ip address dhcp
R1(config-if)#end
R1#
*Mar 1 02:49:59.311: %SYS-5-CONFIG_I: Configured from console by console
R1#
*Mar 1 02:50:01.727: %DHCP-6-ADDRESS_ASSIGN: Interface Ethernet0/0 assigned DHCP address 10.0.0.1, mask 255.255.255.0, hostname R1

R1#

 R1#sh ip int b
Interface IP-Address OK? Method Status Protocol
Ethernet0/0 10.0.0.1 YES DHCP up up
r6 a debug ile bakalimR6#debug dhcp detail
DHCP client activity debugging is on (detailed)
R6#config t
Enter configuration commands, one per line. End with CNTL/Z.
R6(config)#int e0/0
R6(config-if)#ip address dhcp
R6(config-if)#
02:51:39: DHCP: DHCP client process started: 10 —————>
02:51:39: RAC: Starting DHCP discover on Ethernet0/0
02:51:39: DHCP: Try 1 to acquire address for Ethernet0/0
02:51:39: DHCP: allocate request
02:51:39: DHCP: new entry. add to queue
02:51:39: DHCP: SDiscover attempt # 1 for entry:
02:51:39: Temp IP addr: 0.0.0.0 for peer on Interface: Ethernet0/0
02:51:39: Temp sub net mask: 0.0.0.0
02:51:39: DHCP Lease server: 0.0.0.0, state: 1 Selecting ————->
02:51:39: DHCP transaction id: 9D2D05
02:51:39: Lease: 0 secs, Renewal: 0 secs, Rebind: 0 secs
02:51:39: Next timer fires after: 00:00:03
02:51:39: Retry count: 1 Client-ID: cisco-0030.809a.8de0-Et0/0 —————->
R6(config-if)#
02:51:39: Hostname: R6
02:51:39: DHCP: SDiscover: sending 294 byte length DHCP packet
02:51:39: DHCP: SDiscover 294 bytes
02:51:39: B’cast on Ethernet0/0 interface from 0.0.0.0
R6(config-if)#en
02:51:42: DHCP: Received a BOOTREP pkt
02:51:42: DHCP: Scan: Message type: DHCP Offer ——————————>
02:51:42: DHCP: Scan: Server ID Option: 155.1.45.5 = 9B012D05
02:51:42: DHCP: Scan: Lease Time: 86400
02:51:42: DHCP: Scan: Renewal time: 43200
02:51:42: DHCP: Scan: Rebind time: 75600
02:51:42: DHCP: Scan: Subnet Address Option: 255.255.255.0 ——————–>
02:51:42: DHCP: Scan: Domain Name: ciscotr.com ——————————>
02:51:42: DHCP: Scan: Router Option: 10.0.0.4
02:51:42: DHCP: rcvd pkt source: 10.0.0.4, destination: 255.255.255.255 ————————->
02:51:42: UDP sport: 43, dport: 44, length: 308
02:51:42: DHCP op: 2, htype: 1, hlen: 6, hops: 0
02:51:42: DHCP server identifier: 155.1.45.5
02:51:42: xid: 9D2D05, secs: 0, flags: 8000
02:51:42: client: 0.0.0.0, your: 10.0.0.2
02:51:42: srvr: 0.0.0.0, gw: 10.0.0.4
02:51:42: options block length: 60
02:51:42: DHCP Offer Message Offered Address: 10.0.0.2 ————————————–>
02:51:42: DHCP: Lease Seconds: 86400 Renewal secs: 43200 Rebind secs:
R6(config-if)# 75600
02:51:42: DHCP: Server ID Option: 155.1.45.5 ——————————————–>
02:51:42: DHCP: offer received from 155.1.45.5
02:51:42: DHCP: SRequest attempt # 1 for entry:
02:51:42: Temp IP addr: 10.0.0.2 for peer on Interface: Ethernet0/0
02:51:42: Temp sub net mask: 255.255.255.0
02:51:42: DHCP Lease server: 155.1.45.5, state: 2 Requesting
02:51:42: DHCP transaction id: 9D2D05
02:51:42: Lease: 86400 secs, Renewal: 0 secs, Rebind: 0 secs
02:51:42: Next timer fires after: 00:00:01
02:51:42: Retry count: 1 Client-ID: cisco-0030.809a.8de0-Et0/0
02:51:42: Hostname: R6
02:51:42: DHCP: SRequest- Server ID option: 155.1.45.5
02:51:42: DHCP: SRequest- Requested IP addr option: 10.0.0.2
02:51:42: DHCP: SRequest placed lease len option: 86400
02:51:42: DHCP: SRequest: 312 bytes
02:51:42: DHCP: SRequest: 312 bytes
02:51:42: B’cast on Ethernet0/0 interface from 0.0.0.0
02:51:42: DHCP: Received a BOOTREP pkt
02:51:42: DHCP: Scan: Message type: DHCP Ack
02:51:42: DHCP: Scan: Server ID Option: 155.1.45.5 = 9B012D05
02:51:42: DHCP: Scan: Lease Time: 86400
02:51:42: DHCP: Scan: Renewal time: 43200
02:51:42: DHCP: Scan: Rebind time: 75600
02:51:42: DHCP: Scan: Host Name: R6.ciscotr.com.——————————————>
02:51:42: DHCP: Scan: Subnet Address Option: 255.255.255.0
02:51:42: DHCP: Scan: Domain Name: ciscotr.com
02:51:42: DHCP: Scan: Router Option: 10.0.0.4
02:51:42: DHCP: rcvd pkt source: 10.0.0.4, destination: 255.255.255.255
02:51:42: UDP sport: 43, dport: 44, length: 318
02:51:42: DHCP op: 2, htype: 1, hlen: 6, hops: 0
02:51:42: DHCP server identifier: 155.1.45.5
02:51:42: xid: 9D2D05, secs: 0, flags: 8000
02:51:42: client: 0.0.0.0, your: 10.0.0.2
02:51:42: srvr: 0.0.0.0, gw: 10.0.0.4
02:51:42: options block length: 70
02:51:42: DHCP Ack Message
02:51:42: DHCP: Lease Seconds: 86400 Renewal secs: 43200 Rebind secs: 75600
02:51:42: DHCP: Server ID Option: 155.1.45.5
02:51:42: DHCP Host Name Option: R6.ciscotr.com.en
R6(config-if)#e
02:51:45: DHCP: Releasing ipl options:
02:51:45: DHCP: Applying DHCP options:
02:51:45: Setting default_gateway to 10.0.0.4
02:51:45: Adding default route 10.0.0.4
02:51:46: Adding route to DHCP server 155.1.45.5 via Ethernet0/0 10.0.0.4
02:51:46: Setting default domain to ciscotr.com
02:51:46: DHCP Client Pooling: ***Allocated IP address: 10.0.0.2
02:51:46: Allocated IP address = 10.0.0.2 255.255.255.0
R6(config-if)#
02:51:46: %DHCP-6-ADDRESS_ASSIGN: Interface Ethernet0/0 assigned DHCP address 10.0.0.2, mask 255.255.255.0, hostname R6 ————>
R6(config-if)#endR6#sh ip int b
Interface IP-Address OK? Method Status Protocol
Ethernet0/0 10.0.0.2 YES DHCP up up

server tarafi.

R5#sh ip dhcp binding
Bindings from all pools not associated with VRF:
IP address Client-ID/ Lease expiration Type
Hardware address/
User name
10.0.0.1 0063.6973.636f.2d30. Mar 02 2002 02:48 AM Automatic
3062.302e.3634.3764.
2e64.3532.302d.4574.
302f.30
10.0.0.2 0063.6973.636f.2d30. Mar 02 2002 02:49 AM Automatic
3033.302e.3830.3961.
2e38.6465.302d.4574.
302f.30
R5#sh ip dhcp server st
R5#sh ip dhcp server statistics
Memory usage 23894
Address pools 1
Database agents 0
Automatic bindings 2
Manual bindings 0
Expired bindings 0
Malformed messages 0
Secure arp entries 0
Message Received
BOOTREQUEST 0
DHCPDISCOVER 2
DHCPREQUEST 2
DHCPDECLINE 0
DHCPRELEASE 3
DHCPINFORM 0
Message Sent
BOOTREPLY 0
DHCPOFFER 2
DHCPACK 2
DHCPNAK 0
R5#sh ip dhcp poolPool RELAY-AGENT :
Utilization mark (high/low) : 100 / 0
Subnet size (first/next) : 0 / 0
Total addresses : 254
Leased addresses : 2
Pending event : none
1 subnet is currently in the pool :
Current index IP address range Leased addresses
10.0.0.3 10.0.0.1 – 10.0.0.254 2
 

2 yorum

  1. biraz sade yapılır degilmi daha karmaşık olamalı daha sade olmalı zaten kafamız karışmış yardım için burdayız

Bir Cevap Yazın

E-posta hesabınız yayımlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir