3

I recently got a new cable modem and my internet connection is no longer working. I suspect I need to renew my IP address. How can I renew my address?

The command ifconfig returns:

bash: ifconfig: command not found

The command dhclient returns:

bash: dhclient: command not found

I am using Debian 7 (Wheezy).

------- ANSWER

It appears the problem was that I was trying to mess with the network using my user account, which I did not realize was not a good idea. I must have been logged in as root when I did it before. The easy solution is:

sudo /sbin/dhclient eth0

This command reset my connection and my Debian system has network connectivity again. The key thing, as the answer below noted, is that user accounts do not normally have /sbin in the path, so you have to give the explicit path to dhclient if you using it via a user account.

  • Being in user mode is not a typo and can definitely be reproduced. This is a common type of error that could (and does) affect many people. This is a useful question. – Tyler Durden May 29 '16 at 12:41
  • I can't see why this wouldn't be on topic. The answer is simple /sbin isn't in the path. 6,125 people came here and the answer is well upvoted. Clearly it's useful. And, I can reproduce it. – Evan Carroll Apr 18 at 19:30
  • The most probable reasons are: 1) /sbin and /usr/sbin are not in your PATH, check it with an echo "$PATH" command 2) ifconfig is obsolete, today we use ip 2) dhclient is not installed on all systems. – peterh Apr 18 at 20:07
5

If it's installed, dhclient would be in /sbin, which normally is not in your user path. If you do

sudo su -

then your path would have that directory:

/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

However, ifconfig also lives in that directory, so it seems likely you do not have that installed. The package (if you have a CD for installing...) is isc-dhcp-client

1

Install it with aptitude install dhcp-client.

You should refer to its official documentation for reference.

  • I know how to install stuff. It's difficult to use aptitude when you do not have network connectivity. In any case, dhclient was on the machine so this is a non-answer. – Tyler Durden May 29 '16 at 12:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.