8

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.

3
  • 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. May 29, 2016 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. Apr 18, 2019 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, 2019 at 20:07

2 Answers 2

10

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

Some systems that are lacking dhclient still have the basic busybox implementation of dhcp client:

udhcpc
1
  • thanks for mentioning udhcpc I wasn't able to find single reference for it .
    – Salem F
    Feb 5, 2021 at 14:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .