Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

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

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).

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

@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;

>Solution :

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!

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading