title: Fastest way to achieve DHCP on Linux
body: <p><strong>Motivation:</strong> I run wpa_supplicant without a network managing tool because I don't want to force new DHCP leases when my old ones work. This way I can get onto an old network very fast (as soon as wpa_supplicant establishes the lower network layers) if the DHCP lease has not expired.</p>
  
  <p><strong>Problem:</strong> But when the DHCP lease has expired, or if my IP address is from another network, I do need to call upon DHCP. I currently use dhclient, but dhcpcd is another option here. The problem is, even though these DHCP clients run in the background, they don't automatically realize that I need a new IP address, since I've got an old, invalid one.</p>
  
  <p><strong>Question:</strong> Is there a way to very quickly determine if I'm in need of DHCP? E.g. as a reaction to wpa_supplicant or as a response to contacting the standard gateway and realizing a connection isn't available. I can easily run <code>sudo dhclient wlan0</code>, and it gives me the address in one second. But what can I do to automate this process, when necessary?</p>
  
  <p>Making unnecessary DHCP requests is not out of the question, but flooding the DHCP server is.</p>
  
  <p><strong>Elaborate question:</strong> For those of you who use wpa_supplicant directly, how do you DHCP?</p>