Linux Quick Tip: Renew a machine’s DHCP lease with dhclient

DHCP allows machines on an IP-based network to automatically obtain configuration information such as IP addresses, subnet masks, router addresses, etc.

If a machine is connected to a network and has received the above-mentioned configuration settings but is unable to access other machines or the Internet, you might need to renew its DHCP lease.

To do this, open a Terminal window and enter this command to remove the current configuration settings:

sudo dhclient -r

… followed by this command to renew them:

sudo dhclient

If the machine is still unable to connect, you can try disabling and re-enabling the network interface:

sudo ifdown eth0
sudo ifup eth0

… or restarting the network service (try either of the commands below):

sudo /etc/init.d/network restart
sudo /etc/init.d/networking restart

 

Related posts:

  1. Ubuntu Linux Quick Tip – Mount a Samba (Windows) file share to a folder
  2. Configuring a Vodafone 3G modem on Ubuntu Linux 9.04 (Jaunty Jackalope)
  3. Darkstat: UNIX Packet-sniffing daemon
  4. Checking which processes are accessing the Internet on a Unix machine
  5. Checking your internal and external IP Addresses on a Unix machine
Twitter Digg Delicious Stumbleupon Technorati Facebook Email

No comments yet... Be the first to leave a reply!

Afrigator