Bug 26983 - Deletion of resolv.conf entries by disconnecting a second interface (using networkmanager)
Summary: Deletion of resolv.conf entries by disconnecting a second interface (using ne...
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: 7
Hardware: All Linux
Priority: Normal normal
Target Milestone: ---
Assignee: Mageia Bug Squad
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-07-21 22:19 CEST by papoteur
Modified: 2020-07-25 22:21 CEST (History)
5 users (show)

See Also:
Source RPM:
CVE:
Status comment:


Attachments
Trace in journal from networkmanager (350.11 KB, text/plain)
2020-07-21 22:23 CEST, papoteur
Details

Description papoteur 2020-07-21 22:19:06 CEST
I have a wired connection and a wifi one. When the two connection are already started, and when I disconnect the wifi interface, I lost the Internet access. By inspecting /etc/resolv.conf, I see that the line nameserver is deleted. 
I need to disconnect and connect again the wired interface to recover Internet connection. 

Here are version of /etc/nameserver:
with both connections, Internet working:
# Generated by NetworkManager
search home YZenbook.home
nameserver 192.168.1.1

Power off wifi:
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)                                              
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN

Then disconnecting wired interface:
# Generated by NetworkManager                                                                                               
search YZenbook.home

What is bad is that resolv.conf is wrongly configured although a connection is available.

Both interfaces are connecting to an Internet router from my provider through DHCP. The router provides the DNS service.

I don't know if the wrong step is from networkmanager or if another tool is interfering.
I have set networkmanager following the wiki: https://wiki.mageia.org/en/Switching_to_networkmanager
Comment 1 papoteur 2020-07-21 22:23:20 CEST
Created attachment 11757 [details]
Trace in journal from networkmanager

This log starts at boot when the two interfaces are active and comprises a restart of networkmanager to enables trace, wifi disconnection , wired disconnection and wired reconnection.
Comment 2 Martin Whitaker 2020-07-21 23:52:25 CEST
I don't know if this is your problem, but the instructions on the Wiki seem incomplete. This is what I do to switch to using NetworkManager:

  systemctl disable network
  systemctl disable network-up
  systemctl enable NetworkManager.service
  systemctl enable NetworkManager-wait-online.service

In my experience, if you don't disable the legacy network service, it can interfere.

CC: (none) => mageia

Comment 3 Lewis Smith 2020-07-22 20:58:14 CEST
Thank you for the wisdom injection, Martin.
Papoteur, can you try what Martin suggests. If that works, I will tweak the wiki.

CC: (none) => lewyssmith

Comment 4 Olav Vitters 2020-07-22 21:27:14 CEST
Should we maybe have NetworkManager.service "conflict" with network and network-up? Though seems those aren't systemd bits.

CC: (none) => olav

Comment 5 Jani Välimaa 2020-07-22 22:11:23 CEST
(In reply to Martin Whitaker from comment #2)
> I don't know if this is your problem, but the instructions on the Wiki seem
> incomplete. This is what I do to switch to using NetworkManager:
> 
>   systemctl disable network
>   systemctl disable network-up
>   systemctl enable NetworkManager.service
>   systemctl enable NetworkManager-wait-online.service
> 
> In my experience, if you don't disable the legacy network service, it can
> interfere.

It's better to mask network and network-up services instead of disabling or they will be enabled again after next initscripts update.

CC: (none) => jani.valimaa

Comment 6 Dave Hodgins 2020-07-22 23:22:49 CEST
Instead of disabling or masking them, you can also set ...
$ grep -i networking /etc/sysconfig/network
NETWORKING=no

That will cause both the network and network-up init.d scripts to exit almost
immediately.

I use the net.ifnames=0 kernel parameter since I only have one nic, and ...
$ cat /lib/systemd/network/10-eth0.network 
[Match]
Name=eth0

[Network]
Description=LAN_NIC
DNS=127.0.0.1
DNS=192.168.10.101
DNS=8.8.8.8
Domains=x3.hodgins.homeip.net
IPv6AcceptRouterAdvertisements=false
LinkLocalAddressing=no

[Address]
Address=192.168.10.2/16

[Route]
Gateway=192.168.10.11

I find this faster than using either the network or NetworkManager services.

CC: (none) => davidwhodgins

Comment 7 papoteur 2020-07-23 10:24:56 CEST
Hello,
I have masked network and network-up.
I have also enabled NetworkManager-wait-online.service since this was not yet the case.
Wait and see. (I have not yet the time to do wide tests).
Comment 8 papoteur 2020-07-24 07:58:56 CEST
This seems a lot better!
Thanks all.
I have updated the wiki with these instruction for masking services.
Comment 9 Lewis Smith 2020-07-25 20:14:15 CEST
Can this bug be closed now ?
Comment 10 papoteur 2020-07-25 22:21:01 CEST
Yes

Status: NEW => RESOLVED
Resolution: (none) => FIXED


Note You need to log in before you can comment on or make changes to this bug.