Choose style:

Author Topic: DHCP Issue - Sudo netplan apply - after each boot? [SOLVED]  (Read 221 times)

0 Members and 1 Guest are viewing this topic.

Offline RedWhite Canuck

  • Newly Subscribed
  • *
  • Posts: 11
  • Karma: 2
  • New Forum User
    • View Profile
  • Peppermint version(s): 8R, 9R, 10, 10R
DHCP Issue - Sudo netplan apply - after each boot? [SOLVED]
« on: December 28, 2019, 02:27:44 pm »
I have been setting up 10R on a W530 Lenovo Thinkpad with the Optimus Nvidia and Intel graphics.    I have an external monitor that I use with this laptop so I need the Nvidia drivers working. 

After the initial install, everything was working great with the recommended Nvidia 390 drivers.  However, I tried to install newer Nvidia drivers and the latest that was recommend for my K1000M graphics card was the 415 driver ...so I installed it.   It worked for my laptop screen but would not recognize my external monitor.   Xrandr showed that it was "disconnected" and I had no luck getting it to work.  In addition to not recognizing the external monitor, I lost both network connections:  wifi and ethernet during this Nvidia driver adventure.  Neither would connect individually or when both were turned on.

One other piece of information that may be relevant for this W530 10R install  is that I have ethernet plugged in (cuz it is faster) and wifi enabled so that I can transmit my audio to a bluetooth stereo receiver on the other side of the room.    However, I also have a T500 running Pep 8R that also runs both wifi and ethernet plugged in to connect to the same bluetooth stereo receiver and it just works. 

 After several reboots I managed to get the 390 drivers installed again and I got my external monitor back connected.   However, the only way I could recover my internet connection was to modify etc/netplan/01-network-manager-all.yaml to add the line "dhcp4: true". 

After rebooting, my connection displays a "connected" notification but I have no internet access until I open a terminal and type "sudo netplan apply" which then reconnects with internet access.   However, I would like to know how to  get the internet to connect at boot without the manual command each time.

Following is the output from lshw -C for your reference:

svhp@svhp-W530 ~ $ sudo netplan apply
[sudo] password for svhp:
svhp@svhp-W530 ~ $  sudo lshw -C network
[sudo] password for svhp:
  *-network                 
       description: Ethernet interface
       product: 82579LM Gigabit Network Connection (Lewisville)
       vendor: Intel Corporation
       physical id: 19
       bus info: pci@0000:00:19.0
       logical name: enp0s25
       version: 04
       serial: 3c:97:0e:a0:f2:6b
       size: 1Gbit/s
       capacity: 1Gbit/s
       width: 32 bits
       clock: 33MHz
       capabilities: pm msi bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=e1000e driverversion=3.2.6-k duplex=full firmware=0.13-3 ip=192.168.1.65 latency=0 link=yes multicast=yes port=twisted pair speed=1Gbit/s
       resources: irq:32 memory:f3a00000-f3a1ffff memory:f3a3b000-f3a3bfff ioport:7080(size=32)
  *-network
       description: Wireless interface
       product: Centrino Advanced-N 6205 [Taylor Peak]
       vendor: Intel Corporation
       physical id: 0
       bus info: pci@0000:03:00.0
       logical name: wlp3s0
       version: 34
       serial: 6c:88:14:80:0d:70
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless
       configuration: broadcast=yes driver=iwlwifi driverversion=5.2.15-xanmod11 firmware=18.168.6.1 ip=192.168.1.72 latency=0 link=yes multicast=yes wireless=IEEE 802.11
       resources: irq:34 memory:f3000000-f3001fff
  *-network:0
       description: Ethernet interface
       physical id: 2
       logical name: virbr0
       serial: 52:54:00:eb:71:24
       capabilities: ethernet physical
       configuration: broadcast=yes driver=bridge driverversion=2.3 firmware=N/A link=no multicast=yes
  *-network:1 DISABLED
       description: Ethernet interface
       physical id: 3
       logical name: virbr0-nic
       serial: 52:54:00:eb:71:24
       size: 10Mbit/s
       capabilities: ethernet physical
       configuration: autonegotiation=off broadcast=yes driver=tun driverversion=1.6 duplex=full link=no multicast=yes port=twisted pair speed=10Mbit/s


« Last Edit: January 01, 2020, 04:05:25 pm by RedWhite Canuck »

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 26466
  • Karma: 65531
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 10
Re: Sudo netplan apply - after each boot?
« Reply #1 on: December 30, 2019, 07:17:28 pm »
Why are you having to edit /etc/netplan/01-network-manager-all.yaml at all .. that file should be just handing control to network-manager.

Is network-manager not working ?
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline RedWhite Canuck

  • Newly Subscribed
  • *
  • Posts: 11
  • Karma: 2
  • New Forum User
    • View Profile
  • Peppermint version(s): 8R, 9R, 10, 10R
Re: Sudo netplan apply - after each boot?
« Reply #2 on: December 31, 2019, 03:23:40 am »
That is a good question and why I am looking for a solution.   The .yaml file says to "Let Network Manager mange all devices on this system" yet it doesn't do it after a reboot until I run sudo netplan apply.  Something happened when I upgraded/downgraded the Nvidia drivers that knocked out both internet connections (wifi and ethernet).  After that initial reboot, I had no internet connection (wifi or wired).  It notifies me it is connected and it shows a connected wifi symbol in the tray.
 
However, I have no internet on wifi alone, wired alone or both turned on at the same time.  I discovered I could get internet access back by modifying the  01-network-manager-all.yaml file by adding the line dhcp4:true.  (Thanks to Duck Go search)

I found that Once I open a terminal and run "sudo netplan apply" it reconnects and I have internet access and the tray symbol changes to a connected wired symbol.

I am really only concerned with getting rid of the manual internet connection after every reboot.  I have no issues connecting after a suspend/wake.   Any ideas to automate the connection to the internet after a reboot?

PS:  I was trying to include some screen shots but I kept getting errors about exceeding the number of characters and my pics would turn into icons...

Offline RedWhite Canuck

  • Newly Subscribed
  • *
  • Posts: 11
  • Karma: 2
  • New Forum User
    • View Profile
  • Peppermint version(s): 8R, 9R, 10, 10R
Re: Sudo netplan apply - after each boot [Solved]
« Reply #3 on: December 31, 2019, 01:30:48 pm »
I think I discovered my own solution to this networking issue by applying a GRUB tweak from clatterfordslim to improve shutdown time.    :o     (Re: Lenovo ThinkPad X140e ... only beef ... slow shutdown)

I have updated grub several times so I could set up zswap but I have never updated initramfs on this install.   After I made the grub changes, I updated initramfs and then grub.  After that reboot...my internet worked correctly. 

As a wise person once said...    Ya gotta love self healing issues  :)


 

Offline RedWhite Canuck

  • Newly Subscribed
  • *
  • Posts: 11
  • Karma: 2
  • New Forum User
    • View Profile
  • Peppermint version(s): 8R, 9R, 10, 10R
Re: Sudo netplan apply - after each boot?
« Reply #4 on: December 31, 2019, 05:25:31 pm »
I have to take back my previous comment...  The issue is not solved by updating initramfs.

I do not understand why/how I got an interconnection automatically to work after a reboot... once.   

Offline RedWhite Canuck

  • Newly Subscribed
  • *
  • Posts: 11
  • Karma: 2
  • New Forum User
    • View Profile
  • Peppermint version(s): 8R, 9R, 10, 10R
Re: DHCP issue - Sudo netplan apply - after each boot [SOLVED]
« Reply #5 on: January 01, 2020, 04:04:10 pm »
I am confident I have solved my own problem.   I have confirmed successful automatic network connection after 3 consecutive reboots.

I made 2 changes:
  1.  Since Pep9 is also based on 18.04, I compared the network files and folders.   I have set all the network related files on Pep10R to match Pep 9.  However, in the file /etc/NetworkManager/ > NetworkManager.conf, I had to change the line under [ifupdown] managed=true to managed=false to match the Pep9 file.

  2. The following link: https://askubuntu.com/questions/1021884/no-internet-after-upgrade-from-16-04-to-18-04  suggested that I un-comment and modify the DNS entry in /etc/systemd/ > resolved.conf to use  DNS=8.8.8.8.   This suggestion is in the response AFTER the accepted solution.   I know 8.8.8.8 points to google but at least I have internet access.

I have no idea why dhcp quit setting the DNS server on my Pep 10R install.

My original partial solution to add dhcp4: true to the netplan .yaml file also worked but required a manual command after boot.   I could not figure out how to run this command after boot to restore internet access so I am happy using this DNS solution in the resolved.conf file.