Score:0

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

id flag

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;
Thomas Aichinger avatar
cn flag
Please post your /etc/netplan/*.yaml network config file.
Terrance avatar
id flag
Does the file `/etc/dhcpcd.conf` exist?
ru flag
If you are on ubuntu 20.04 then we can configure netplan to do this for you out of the box, which is how it should be unless you're using network manager (the GUI application). Do you want to use Netplan or do you want to use network manager GUI to configure your devices? (Xubuntu has the ability to use one or the other). As it stands, there doesn't appear to be anything controlling DHCP and autoconfigure of the network interface, hence the problem (ifupdown is no longer the default in 20.04 so old mechanisms might not work like `/etc/network/interfaces`)
ar flag
Welcome to Ask Ubuntu. Please don't put [solved] in your question title. Click on the gray check mark ✔️ next to the correct answer and turn it green ✅. This marks the question as answered and will help others.
Score:1
id flag

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!

karel avatar
sa flag
✔️ Phil iadded [solved] to the question's title before I edited it out, and this was the answer that solved it.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.