DHCP
Tools and Testing > morsectrl
dhcpc [enable | discover | get | clear | renew | rebind | update]
configure DHCP client
enable - enable DHCP client
discover - do a discovery and obtain a lease
get - get the current lease
clear - clear the current lease
renew - renew the current lease
rebind - rebind the current lease
update - send a lease update to the driver
This command is only applicable if the driver has been loaded with enable_dhcp_offload modparam. With this feature enabled the leases can be renewed without having to wake up the host processor. Through this method, assuming a DHCP server is running somewhere on the network, the station should receive, and automatically apply, an IP address within 10 seconds of associating. If currently leased address needs to be updated, it can be triggered with the following morsectrl command:
# morsectrl dhcpc update
Note that this will only apply a lease if enable_dhcpc_offload is set to 1.
The lease can be obtained manually as well but note that this is intended only for testing and verification purposes and should not be used in normal operations. The steps to manually do this:
On an associated, running station, enable the DHCP client with the following morsectrl command:
# morsectrl dhcpc enable
Within 10 seconds, the client should automatically perform a discovery and obtain a lease.
To shortcut this, and perform a discovery now, execute the following command:
# morsectrl dhcpc discover
The lease can be retrieved using:
# morsectrl dhcpc get
To force a DHCP renewal or rebinding sequence with the following commands:
# morsectrl dhcpc renew
# morsectrl dhcpc rebind
Note that if the DHCP client is enabled and does not have a lease, it will attempt a discovery sequence every 1-10 seconds, as per the RFC.
Please note that morsectrl is designed for engineering testing and evaluation purposes only.
Changing the configuration of the device can break regulatory compliance.