1

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;
karel
  • 110,292
  • 102
  • 269
  • 299
Phil
  • 51
  • 1
  • 7
  • 1
    Please post your /etc/netplan/*.yaml network config file. – Thomas Aichinger Dec 18 '21 at 09:21
  • Does the file `/etc/dhcpcd.conf` exist? – Terrance Dec 18 '21 at 14:37
  • 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`) – Thomas Ward Dec 18 '21 at 19:16
  • 2
    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. – user68186 Dec 19 '21 at 13:57

1 Answers1

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!

Terrance
  • 39,774
  • 7
  • 116
  • 176
  • 1
    ✔️ Phil iadded [solved] to the question's title before I edited it out, and this was the answer that solved it. – karel Dec 19 '21 at 14:03