Wednesday, March 11, 2015

DHCP configure

Config DHCP server:
#ip dhcp excluded-address 155.1.146.100 155.1.146.254
#ip dhcp pool DHCP
   #network 155.1.146.0 255.255.255.0
   #default-router 155.1.146.4 155.1.146.6                                     //config 2 default-gateway for redurancy
   #dns-server 155.1.146.4 155.1.146.6
   #lease 0 12


Note: khi cau hinh DHCP, nen cau hinh dhcp exclude truoc dhcp pool, neu khong dai ip trong exclude van se duoc su dung, neu co client nao do request som hon khi exclude apply.

Khi su dung access-list: chu y permit UPD host 0.0.0.0 {ip server} nhăm tranh filter các gói tin discover
And ack

Config DHCP client:
#interface Ethernet0/0
  #ip address dhcp client-id Ethernet0/0



Debug dhcp deital:

  • Gui goi tin DHCP discover tu client, voi source ip add 0.0.0.0 , mac interface e0/0.

DHCP: DHCP client process started: 10
RAC: Starting DHCP discover on Ethernet0/0
DHCP: Try 1 to acquire address for Ethernet0/0
DHCP: allocate request
DHCP: new entry. add to queue, interface Ethernet0/0
DHCP: Client socket is opened
DHCP: SDiscover attempt # 1 for entry:
Temp IP addr: 0.0.0.0  for peer on Interface: Ethernet0/0
Temp  sub net mask: 0.0.0.0
   DHCP Lease server: 0.0.0.0, state: 3 Selecting
   DHCP transaction id: 131F
   Lease: 0 secs,  Renewal: 0 secs,  Rebind: 0 secs
   Next timer fires after: 00:00:04
   Retry count: 1   Client-ID: aabb.cc00.0100
   Client-ID hex dump: AABBCC000100
   Hostname: Rack1R1
DHCP: SDiscover: sending 276 byte length DHCP packet
DHCP: SDiscover 276 bytes
            B'cast on Ethernet0/0 interface from 0.0.0.0


  • Server gui goi tin DHCP offer voi thong tin pool DHCP ma no co, voi soure 155.1.146.6 va dest 255.255.255.255

DHCP: Received a BOOTREP pkt
DHCP: Scan: Message type: DHCP Offer
DHCP: Scan: Server ID Option: 155.1.146.6 = 9B019206
DHCP: Scan: Lease Time: 43200
DHCP: Scan: Renewal time: 21600
DHCP: Scan: Rebind time: 37800
DHCP: Scan: Subnet Address Option: 255.255.255.0
DHCP: Scan: Router Option: 155.1.146.4, 155.1.146.6
DHCP: Scan: DNS Name Server Option: 155.1.146.4, 155.1.146.6
DHCP: rcvd pkt source: 155.1.146.6,  destination:  255.255.255.255
   UDP  sport: 43,  dport: 44,  length: 308
   DHCP op: 2, htype: 1, hlen: 6, hops: 0
   DHCP server identifier: 155.1.146.6
        xid: 131F, secs: 0, flags: 8000
        client: 0.0.0.0, your: 155.1.146.3
        srvr:   0.0.0.0, gw: 0.0.0.0
        options block length: 60

DHCP Offer Message   Offered Address: 155.1.146.3
DHCP: Lease Seconds: 43200    Renewal secs:  21600    Rebind secs:   37800
DHCP: Server ID Option: 155.1.146.6
DHCP: offer received from 155.1.146.6

  • Client gui goi tin request yeu cau cap dia chi ip toi server ma no duoc offer, voi source

DHCP: SRequest attempt # 1 for entry:
Temp IP addr: 155.1.146.3  for peer on Interface: Ethernet0/0
Temp  sub net mask: 255.255.255.0
   DHCP Lease server: 155.1.146.6, state: 4 Requesting
   DHCP transaction id: 131F
   Lease: 43200 secs,  Renewal: 0 secs,  Rebind: 0 secs
   Next timer fires after: 00:00:03
   Retry count: 1   Client-ID: aabb.cc00.0100
   Client-ID hex dump: AABBCC000100
   Hostname: Rack1R1
DHCP: SRequest- Server ID option: 155.1.146.6
DHCP: SRequest- Requested IP addr option: 155.1.146.3
DHCP: SRequest: 288 bytes
DHCP: SRequest: 288 bytes
            B'cast on Ethernet0/0 interface from 0.0.0.0
DHCP: Received a BOOTREP pkt
DHCP: Scan: Message type: DHCP Ack
DHCP: Scan: Server ID Option: 155.1.146.6 = 9B019206
DHCP: Scan: Lease Time: 43200
DHCP: Scan: Renewal time: 21600
DHCP: Scan: Rebind time: 37800
DHCP: Scan: Subnet Address Option: 255.255.255.0
DHCP: Scan: Router Option: 155.1.146.4, 155.1.146.6
DHCP: Scan: DNS Name Server Option: 155.1.146.4, 155.1.146.6
DHCP: rcvd pkt source: 155.1.146.6,  destination:  255.255.255.255
   UDP  sport: 43,  dport: 44,  length: 308
   DHCP op: 2, htype: 1, hlen: 6, hops: 0
   DHCP server identifier: 155.1.146.6
        xid: 131F, secs: 0, flags: 8000
        client: 0.0.0.0, your: 155.1.146.3
        srvr:   0.0.0.0, gw: 0.0.0.0
        options block length: 60


  • Client nhan ACK tu server, qua trinh nhan dia chi ip tu DHCP hoan thanh.

DHCP Ack Message
DHCP: Lease Seconds: 43200    Renewal secs:  21600    Rebind secs:   37800
DHCP: Server ID Option: 155.1.146.6
DHCP: Releasing ipl options:
DHCP: Applying DHCP options:
  Setting default_gateway to 155.1.146.4
  Adding default route 155.1.146.4
  Adding DNS server address 155.1.146.4
  Adding DNS server address 155.1.146.6
DHCP: Sending notification of ASSIGNMENT:
  Address 155.1.146.3 mask 255.255.255.0
DHCP Client Pooling: ***Allocated IP address: 155.1.146.3
Allocated IP address = 155.1.146.3  255.255.255.0

%DHCP-6-ADDRESS_ASSIGN: Interface Ethernet0/0 assigned DHCP address 155.1.146.3, mask 255.255.255.0, hostname Rack1R1


Neu muon e0/0 nhan dhcp voi IP 155.1.146.1
Tren R6 ta config nhu sau:



No comments:

Post a Comment