0

Apologies if this has been beaten to death. I've done about 6 hours of searching and testing myself and pulling my hair out.

After a backup, I reluctantly agreed to upgrade from 18.04 to 20.04. Aside from having to fix a few custom packages, things were generally OK.

First issue was a lack of DNS. I honestly can't remember now how I fixed it. However, I think it's related to my main issue.

I run this host in a static IP configuration. However, upon upgrade, I see a secondary address via DHCP on the ethernet interface (enp0s3). No matter what I do, I can't seem to shake it.

Even more odd: Within Gnome (which I've always avoided before), if I delete that connection (called enp0s3), it just comes back on its own. "Wired Connection 1" is my static interface.

Another possible clue, even if I slide the slider to disable the network connection, it just slides back over to enabled/green on its own within a few seconds.

I'm wondering if I'm getting conflicts between NetworkManager, Netplan, or Networkd

Thanks for any insight.

sudo lshw -C network

  *-network
       description: Ethernet interface
       product: 82540EM Gigabit Ethernet Controller
       vendor: Intel Corporation
       physical id: 3
       bus info: pci@0000:00:03.0
       logical name: enp0s3
       version: 02
       serial: 08:00:27:ab:a2:8f
       size: 1Gbit/s
       capacity: 1Gbit/s
       width: 32 bits
       clock: 66MHz
       capabilities: pm pcix bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=e1000 driverversion=7.3.21-k8-NAPI duplex=full ip=192.168.34.25 latency=64 link=yes mingnt=255 multicast=yes port=twisted pair speed=1Gbit/s
       resources: irq:9 memory:f0000000-f001ffff ioport:d010(size=8)

cat /etc/network/interfaces

# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback

cat /etc/netplan/*.yaml

# Let NetworkManager manage all devices on this system
network:
  version: 2
  renderer: NetworkManager

ip a

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 08:00:27:ab:a2:8f brd ff:ff:ff:ff:ff:ff
    inet 192.168.34.25/24 brd 192.168.34.255 scope global noprefixroute enp0s3
       valid_lft forever preferred_lft forever
    inet 192.168.34.12/24 brd 192.168.34.255 scope global secondary noprefixroute enp0s3
       valid_lft forever preferred_lft forever
    inet6 fe80::80e1:7fc:b61a:cd41/64 scope link noprefixroute
       valid_lft forever preferred_lft forever

root@homeauto03:/etc/NetworkManager/system-connections# ls -altr

total 12
drwxr-xr-x 7 root root 4096 Nov 30 21:09  ..
-rw------- 1 root root  393 Dec  1 13:47 'Wired connection 1.nmconnection'
drwxr-xr-x 2 root root 4096 Dec  1 16:24  .

root@homeauto03:/etc/NetworkManager/system-connections# cat Wired\ connection\ 1.nmconnection

[connection]
id=Wired connection 1
uuid=358648bf-1c3e-3704-995a-300a184d0445
type=ethernet
autoconnect-priority=-999
interface-name=enp0s3
permissions=
timestamp=1606848238

[ethernet] mac-address-blacklist=

[ipv4] address1=192.168.34.12/24,192.168.34.1 dns=8.8.8.8;8.8.4.4; dns-search= ignore-auto-dns=true method=manual

[ipv6] addr-gen-mode=stable-privacy dns-search= method=auto

[proxy] root@homeauto03:/etc/NetworkManager/system-connections#

tbully@homeauto03:~$ ip a

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 08:00:27:ab:a2:8f brd ff:ff:ff:ff:ff:ff
    inet 192.168.34.12/24 brd 192.168.34.255 scope global noprefixroute enp0s3
       valid_lft forever preferred_lft forever
    inet 192.168.34.25/24 brd 192.168.34.255 scope global secondary noprefixroute enp0s3
       valid_lft forever preferred_lft forever
    inet6 fe80::80e1:7fc:b61a:cd41/64 scope link noprefixroute
       valid_lft forever preferred_lft forever
tbully@homeauto03:~$

Manager Settings ipv4

TEMPORARY SOLUTION

  1. executed systemctl stop dhcpcd.service
  2. removed connection profile in NetworkManager
  3. noted that both pings stopped working - .12 (static) and .25 (dhcp) assigned
  4. also noted that the enable button didn't go back to green on its own (and connection being re-enabled) did not occur as it did before
  5. recreated the manual ipv4 connection (.12).
  6. pings started back up for .12
  7. noted that .25 (or any other dhcp address) did not reassign
  8. excuted systemctl disable dhcpcd.service
  9. survived reboot

Reveresed these steps (re-enabled the DHCP client) and the problem returned.

Nuke option but it'll work for now until I (or someone) can figure out a more proper solution.

Tejas Lotlikar
  • 2,945
  • 5
  • 17
  • 26
  • Where are you seeing a "secondary address"? Edit your question and show me sudo lshw -C network and cat /etc/network/interfaces and cat /etc/netplan/*.yaml and a screenshot of the IPv4 panel for your Wired Connection. – heynnema Dec 01 '20 at 19:30
  • Thanks for the response. See edits! – Travis Bully Dec 01 '20 at 20:50
  • How many "Wired Connection" profiles do you have? – heynnema Dec 01 '20 at 22:57
  • Just the one. (See edit) – Travis Bully Dec 01 '20 at 23:06
  • Forget (remove) the "Wired Connect 1", reboot, recreate a new static "Wired Connection", and see if you still get an IP of 192.168.34.25. – heynnema Dec 01 '20 at 23:09
  • Doing that drops my .12 (static) address and automatically creates a new "Wired Connection" with DHCP enabled. It happens before I even reboot. I'm considering following this: https://askubuntu.com/questions/1031709/ubuntu-18-04-switch-back-to-etc-network-interfaces But that seems like a nuclear approach. – Travis Bully Dec 01 '20 at 23:31
  • If you do a ip a what dhcp address did it pick up? Using that same Wired Connection profile, change it from dhcp to static, like you had before, reboot, and do the ip a again, and let's see what is different. – heynnema Dec 01 '20 at 23:40
  • It just grabs the same address from the DHCP server (same MAC and lease is still valid). It does "light up" back on .12 again. However the DHCP address remains bound to the interface and even survives reboots. Aside from burning an address, this would just be an annoyance. However it screws up other services (NFS mounts, etc). Crazy. – Travis Bully Dec 01 '20 at 23:46
  • I don't understand "light up". What happened when you changed Wired Connection back to static, and what did ip a show? – heynnema Dec 01 '20 at 23:52
  • It just bound the new static IP to the interface along side the DHCP address.... See edit. – Travis Bully Dec 01 '20 at 23:54
  • Is your router set to hand out specific IPs to specific MAC addresses? Do you have access to a Ubuntu Live DVD/USB? – heynnema Dec 01 '20 at 23:56
  • Have you modified /etc/dhcp/dhclient.conf? – heynnema Dec 01 '20 at 23:59
  • Just verified. No. Only thing uncommented in that file is the "request" section and "timeout". It hasn't been touched since 10-12-2017. Unfortunately, I do not have access to an Ubuntu Live DVD/USB. Appreciate you thinking through this with me, btw. Thank you. Kill the DHCP client? Again, nuclear, I suppose. – Travis Bully Dec 02 '20 at 00:04
  • Which did you verify... the router... or the dhclient.conf file? No nuclear fixes from me... not yet... – heynnema Dec 02 '20 at 00:05
  • Sorry. I verified the dhclient.conf file. I do not have MAC reservations set in the router. This started after the upgrade. It's interesting to watch. I have pings running for both .12 (static) and .25 (dhcp). When I create the new profile in NetworkManager, I see the new static address come up immediately and the .25 goes away. After 4-5 seconds, .25 reappears even though it isn't found in the NetworkManager configs (nor is DHCP). – Travis Bully Dec 02 '20 at 00:08
  • Is there ANY way to get yourself a Ubuntu Live DVD/USB? – heynnema Dec 02 '20 at 00:09
  • Not off-hand. I suppose I could make one. Why? – Travis Bully Dec 02 '20 at 00:09
  • I want to boot to the Ubuntu Live and then ip a and see if the problem still occurs. If it does, then we know there's nothing wrong with the software or setup on the computer. – heynnema Dec 02 '20 at 00:10
  • What did you do to "fix" the DNS after the update? – heynnema Dec 02 '20 at 00:14
  • Ah. That will be difficult as this is a virtual machine (Oracle Virtual Box). I believe I added my DNS servers (Google) to /etc/resolvconf/resolv.conf.d/head file. I ran nmcli connection show "Wired connection 1" and verified I'm set to ipv4 "manual". However I see both addresses bound to the interface with no mention of it being via DHCP. Baffled. IP4.ADDRESS[1]: 192.168.34.12/24 IP4.ADDRESS[2]: 192.168.34.25/24 – Travis Bully Dec 02 '20 at 00:24
  • Tried the following. It worked for a few seconds and then came back: ip addr del 192.168.34.25/24 dev enp0s3 – Travis Bully Dec 02 '20 at 00:30
  • I guess you found a workaround... good for you! – heynnema Dec 02 '20 at 00:53
  • Do you have the dhcpcd package installed? (And if so, how/why?) This has been a frequent source of unexplained extra IP addresses on users' systems, unrelated to netplan itself. – slangasek Dec 02 '20 at 00:54
  • If by "dhcpcd package" you mean "dhcpcd.service", then I guess, yes I do. I don't know how and certainly don't need DHCP for this application. To be honest, this host is (was) a "set it and forget it" server that just runs a few things for my home automation stuff. It gets backed up daily but I really have no business tinkering around in there. LOL! It's been solid for a few years until this upgrade. – Travis Bully Dec 02 '20 at 01:01
  • This was going to be my next test but I'll hold short for now for more feedback: [link]https://serverfault.com/questions/1006634/nmcli-set-static-ip-address-without-the-dhcp – Travis Bully Dec 02 '20 at 01:04

0 Answers0