DHCP Client configuration command directory
This
chapter describes the DHCP configuration command. You can use the command
introduced in this chapter to configure and monitor the operation of DHCP
protocol on the router.
For
information about configuration, please refer to “configure DHCP”.
In order to acquire an IP address for the Ethernet interface by Dynamic
host configuration protocol (DHCP), you can use interface configuration command
“ip address dhcp”. You can use “no” form of this command to delete the
acquired IP address.
ip address dhcp
no ip address dhcp
Parameter:
none
Default:
none
Command mode:
Interface configuration mode
Explanation:
Command “ip
address dhcp” allows the interface to acquire IP address by DHCP protocol,
which is extremely useful for the dynamic connection with internet service
provider (ISP) by the Ethernet interface. As long as it acquires the dynamic IP
address, the Ethernet can use port alteration technology (PAT) to implement
network address translation (NAT).
IF the router is
configured command “ip address dhcp”, the router will send “DHCP
Discover” information to the DHCP server on the network.
If the router is
configured command “no ip address dhcp”, the router will send “DHCP
RELEASE” information.
Example:
The following example
enables the ethernet1/1 interface to acquire IP address of the interface by
DHCPprotocol.
!
interface Ethernet1/1
ip address dhcp
Related commands:
ip dhcp client
ip dhcp-server
show dhcp lease
show dhcp server
Configure the parameter of local router DHCP client
ip dhcp client { minlease seconds | retransmit count | select seconds }
no ip dhcp client {
minlease | retransmit | select }
Parameter:
minlease seconds: (Optional)
minimum lease time acceptable, ranges from 60 seconds to 86400 seconds.
retransmit count: (Optional)
retransmit times of protocol packet, range from 1 to 10.
select seconds: (optional)
time inside selected, ranges from 0 to 30.
Default:
minlease:Default
value of parameter “minlease” is 60 seconds.
retransmit:Default
value of parameter “retransmit” is 4 times.
select:Default
value of parameter “select is 0 second.
Command mode:
global
configuration mode
Explanation:
Adjust these
parameters according to the requirement of the network structure and DHCPserver.
If
“no” form of these commands are configured, then these parameters will be
reset to the default value defined by the system.
Example:
The following example configures the minimum leasing time acceptable of
the DHCP client on the router to 100 seconds.
ip dhcp client minlease 100
The following example
configures the retransmit times of the protocol packet of DHCP client on the
router to 3 times.
ip dhcp client retransmit 3
The following example
configures the interval selected of DHCP client on the router to 10 seconds.
ip dhcp client select 10
Related commands:
ip address dhcp
ip dhcp-server
show dhcp lease
show dhcp server
You can use
command “ip dhcp-server” to designate the IP address of DHCP server which
can designate the acknowledged DHCPserver
ip dhcp-server ip-address
no ip dhcp-server ip-address
Parameter:
ip-address: IP
address of DHCPserver.
Default:
Without
any default IP address of DHCPserver.
Command mode:
global
configuration mode
Explanation:
Use this command to
designate an IP address of DHCPserver, the command will not replace the
previously designated IP address of DHCP server.
“No”
forma of this command can be used to clear the previously configured IP address
of DHCPserver.
Example:
The following example
shows how to designate the server with IP address of 192.168.20.1 as the DHCP
server on the router:
ip dhcp-server 192.168.20.1
Related commands:
ip address dhcp
ip dhcp client
show dhcp lease
show dhcp server
You can use command “show dhcp lease” to check the allocated
information of DHCP server used by the current router.
Show dhcp lease
Parameter:
none
Default:
none
Command mode:
管理态
Explanation:
使用此命令可以查看当前路由器所使用的DHCP服务器分配的信息。
Example:
Use this command to
check the allocated information of DHCPserver currently used by the router.
router#show dhcp lease
Temp IP addr: 192.168.20.3 for peer on Interface: Ethernet1/1
Temp sub net mask: 255.255.255.0
DHCP Lease server: 192.168.1.3, state: 4 Rebinding
DHCP transaction id: 2049
Lease: 86400 secs, Renewal: 43200 secs, Rebind: 75600 secs
Temp default-gateway addr: 192.168.1.2
Next timer fires after: 02:34:26
Retry count: 1 Client-ID: router-0030.80bb.e4c0-Et1/1
Related commands:
ip address dhcp
ip dhcp client
ip dhcp-server
show dhcp server
debug dhcp
You can use command
“show dhcp server” to show the acknowledged information of DHCPserver.
show dhcp server
Parameter:
none
Default:
none
Command mode:
supervisor
mode
Explanation:
Use this command to
show the acknowledged DHCPserver information.
Example:
The following example
shows the acknowledged DHCPserver information.
router#show dhcp sever
DHCP server:
255.255.255.255
Leases: 0
Discovers: 62 Requests: 0 Declines: 0 Releases: 0
Offers:
0 Acks: 0 Naks: 0 Bad: 0
Subnet: 0.0.0.0, Domain name:
Related commands:
ip address dhcp
ip dhcp client
ip dhcp-server
show dhcp lease
When
dhcp is functioning on the router, you can use command “debug dhcp” to check
the processing situation of dhcpprotocol.
debug dhcp <detail>
no debug dhcp
<detail>
Parameter:
detail:show
the packet content of DHCPprotocol
Default:
It does not show any
related information by default.
Command mode:
管理态
Explanation:
Show some important
processing information about DHCP processing, example is as follows:
router#debug dhcp
router#2000-4-22 10:50:40
DHCP: Move to INIT state, xid: 0x7
2000-4-22 10:50:40 DHCP:
SDISCOVER attempt # 1, sending 277 byte DHCP packet
2000-4-22 10:50:40
DHCP:
B'cast on Ethernet1/1 interface from 0.0.0.0
2000-4-22 10:50:40 DHCP:
Move to SELECTING state, xid: 0x7
2000-4-22 10:50:46 DHCP:
SDISCOVER attempt # 2, sending 277 byte DHCPpacket
2000-4-22 10:50:46
DHCP: B'cast on Ethernet1/1
interface from 0.0.0.0
2000-4-22 10:50:54 DHCP:
SDISCOVER attempt # 3, sending 277 byte DHCPpacket
Related commands:
show dhcp lease