I have to run command 'sudo dhclient' after every reboot

All we need is an easy explanation of the problem, so here it is.

Since I have changed my router, on one PC I I have to run the command sudo dhclient eno1 after every reboot. I have upgraded to Xubuntu 20.04, but the problem is still present. How can I change that?

Results of ifconfig -a :

eno1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.0.10  netmask 255.255.255.0  broadcast 192.168.0.255
        inet6 fe80::729a:2013:ba7e:ba02  prefixlen 64  scopeid 0x20<link>
        ether a4:5d:36:82:ba:53  txqueuelen 1000  (Ethernet)
        RX packets 8032  bytes 8241625 (8.2 MB)
        RX errors 0  dropped 8  overruns 0  frame 0
        TX packets 5851  bytes 763496 (763.4 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

I am working on eno1 (wired ethernet), and the IP 192.168.0.10 is correct (fixed IP address configured on the router for my MAC address).

@Thomas: There is no file in /etc/netplan directory

@Terrance: No : /etc/dhcpcd.conf doesn’t exist

In /etc/dhcp/dhclient.conf the only lines that are not comments are:

option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;

send host-name = gethostname();
request subnet-mask, broadcast-address, time-offset, routers,
    domain-name, domain-name-servers, domain-search, host-name,
    dhcp6.name-servers, dhcp6.domain-search, dhcp6.fqdn, dhcp6.sntp-servers,
    netbios-name-servers, netbios-scope, interface-mtu,
    rfc3442-classless-static-routes, ntp-servers;
timeout 300;

How to solve :

I know you bored from this bug, So we are here to help you! Take a deep breath and look at the explanation of your problem. We have many solutions to this problem, But we recommend you to use the first method because it is tested & true method that will 100% work for you.

Method 1

Since you are using ifupdown for controlling your network interface make sure that the following 2 lines are added to the /etc/network/interfaces file:

auto eno1
iface eno1 inet dhcp

The first line tells the system to bring up the interface at startup automatically. The second line tells the system that the interface is going to use DHCP instead of static.

Hope this helps!

Note: Use and implement method 1 because this method fully tested our system.
Thank you 🙂

All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply