Network connections disconnects and connects with a new one

Hi,
I have one ethernet connection called Wired connection 1. This one is started when I boot. Automatically the VPN connection is started as well.
They both use enp2s0 as network device.
Sometimes, I see a notification after a while that a new ethernet connection, called enp2so, has connected, which means the normal one plus the VPN are disconnected.
I then open network manager settings, delete the new enp2s0 connection and connect manually to “Wired connection 1”, which starts the VPN again.

I never had this on other distro’s and I wonder what might cause this. It’s not the end of the world, but when it happens often it is a nuisance.

inxi -Fxz
Network:   Card-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet driver: r8169 v: 2.3LK-NAPI 
           port: d000 bus ID: 02:00 
           IF: enp2s0 state: up speed: 1000 Mbps duplex: full mac: <filter> 
           IF-ID-1: tun0 state: unknown speed: 10 Mbps duplex: full mac: N/A

I now see that tun0 (VPN) is set to 10Mbps but I guess that must be a mistake, since I have a 1Gbps network connection.

/sbin/lspci -nnk
02:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 09)
        Subsystem: ASUSTeK Computer Inc. P8 series motherboard [1043:8505]
        Kernel driver in use: r8169
        Kernel modules: r8169

What can cause the creation of a new network connection and disconnecting the old one?

https://imgur.com/a/S8e5ow9
https://imgur.com/a/3pnp5SX
https://imgur.com/a/S8e5ow9

Is it reproducable in the sense that it happens after each boot, f.e. after VPN connect?
Anything visible through dmesg? journalctl?
Could it be that something is triggered twice, due to some misconfiguration, f.e. VPN started through script and through systemd?

You should start with displaying configured network interfaces
Run the following command when you don’t have a VPN connection, when you have a VPN connection and perhaps again after you believe your machine has re-created the VPN connection.

ip addr

TSU

Reproducable? Well, it did happen a couple of times in the past week, but it’s hard to say when (after being up how long).
I uses network manager as can be seen on the pictures I added. The ethernet connection starts the VPN automatically through the setting in NM.

I will check dmesg and journactl when it happens again to see if I can find something what caused it.

Thanks.

**[User: jan] @ [Server: opensuse-desktop] - [Directory: ~]**
**$** ip addr
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: enp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 74:d0:2b:9d:de:b0 brd ff:ff:ff:ff:ff:ff
    inet 192.168.2.221/24 brd 192.168.2.255 scope global noprefixroute enp2s0
       valid_lft forever preferred_lft forever
    inet6 fe80::3e2a:a457:c544:453d/64 scope link noprefixroute  
       valid_lft forever preferred_lft forever
3: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN group default qlen 100
    link/none  
    inet 10.17.10.6 peer 10.17.10.5/32 brd 10.17.10.6 scope global noprefixroute tun0
       valid_lft forever preferred_lft forever
    inet6 fe80::9d6c:3d88:38f6:4182/64 scope link stable-privacy  
       valid_lft forever preferred_lft forever
**[User: jan] @ [Server: opensuse-desktop] - [Directory: ~]**
**$**  
**[User: jan] @ [Server: opensuse-desktop] - [Directory: ~]**
**$** ip addr
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: enp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 74:d0:2b:9d:de:b0 brd ff:ff:ff:ff:ff:ff
    inet 192.168.2.221/24 brd 192.168.2.255 scope global noprefixroute enp2s0
       valid_lft forever preferred_lft forever
    inet6 fe80::3e2a:a457:c544:453d/64 scope link noprefixroute  
       valid_lft forever preferred_lft forever
**[User: jan] @ [Server: opensuse-desktop] - [Directory: ~]**
**$**  
**[User: jan] @ [Server: opensuse-desktop] - [Directory: ~]**
**$** ip addr                                                                                                                                                   
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: enp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 74:d0:2b:9d:de:b0 brd ff:ff:ff:ff:ff:ff
    inet 192.168.2.221/24 brd 192.168.2.255 scope global noprefixroute enp2s0
       valid_lft forever preferred_lft forever
    inet6 fe80::3e2a:a457:c544:453d/64 scope link noprefixroute  
       valid_lft forever preferred_lft forever
4: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN group default qlen 100
    link/none  
    inet 10.67.10.6 peer 10.67.10.5/32 brd 10.67.10.6 scope global noprefixroute tun0
       valid_lft forever preferred_lft forever
    inet6 fe80::ed7f:256c:d84d:3c8/64 scope link stable-privacy  
       valid_lft forever preferred_lft forever
**[User: jan] @ [Server: opensuse-desktop] - [Directory: ~]**


Data for loopback and enp2s0 are 3 times the same, but the data for the TUN (VPN) is different after I switched it on again.

That looks like a timing issue. I’m almost sure a second instance of the Network manager is triggered by VPN not having the eth0 connection yet and trying to start it. But, I could be wrong, just remember a similar issue, some months ago.

How did you set the ‘on boot’ start of the eth0 connection?

How do you invoke the networkmanager? cli ? Applet?

I use the System settings module to setup the network (right-click on the network icon in the system-tray). In there I select:
Automatically connect this network when it is available
All users may connect to this network
Automatically connect to VPN when using this connection

So the ethernet connection is started, a moment later the VPN is up and it can take 10 minutes, maybe half an hour when suddenly the notification comes that I use enp2so connection now instead of the normal Wired connection with the VPN attached to it. It’s not during boot that things go wrong, it’s much later.

I don’t know if your regular network connection is interrupted which would also disconnect your secondary (VPN) connection, but in each case your network services recognizes your machine with its MAC and IPv6 address, it continues to use the same IPv4 address.

On the other hand,
Your VPN interface is re-made each time and is assigned a new IPv4 and IPv6 address.

You should determine whether you’e having basic network connection issues.

TSU

That’s because in the router I connected the MAC addresses of all devices to fixed IP addresses so with every boot they have the same address. Still in the computers I use DHCP for easier setup.

fwiw

The same has been seen on this PC. The setup is,

  • only 1 connection named as “vkd-wired”
  • manual connection only via networkmanager
  • vpn not used

The network change from “vkd-wired” to “enp2s0” is
only noticed because the network icon disappears from
the Status and Notifications panel

When this has occurred, 3 or 4 times in the last week,
enp2s0 is Disconnected and vkd-wired re-Connected,
after which the icon re-appears

This event occurs randomly so tracking has not
as yet been pursued

It has not occurred yet since updating sw this
morning as shown below

os
Kernel: 4.18.12-2.ga880bd8-default x86_64 bits: 64
Desktop: KDE Plasma 5.13.5
Distro: openSUSE Tumbleweed 20181001
Network: Realtek RTL8111/8168/8411
PCI Express Gigabit Ethernet driver: r8169
IF: enp2s0 state: up speed: 100 Mbps duplex: full mac: <filter>

NB.
Network card and driver is a common factor.

Well, it’s not exactly the same cause here the original connection does not return, no matter how long I wait.

@knurpht and @tsu:
I just had the symptom again, almost immediately at start and I did the two codes: dmesg and journalctl -q but apart from lines of text in with the connection is started I see nothing about it being disconnected again and enp2s0 taking over.
Is there any other command I can use to see more info about the network status?

Is there any other command I can use to see more info about the network status?

You could watch in a terminal window like this

sudo journalctl -fu NetworkManager

or review after the event with an editor perhaps

sudo journalctl -u NetworkManager > output.txt

Do you have an unwanted connection defined?

ls -l /etc/NetworkManager/system-sconnections/

No, only the two I mentioned earlier:

 ls -l /etc/NetworkManager/system-connections/                               
total 8
-rw------- 1 root root 601 Oct  3 17:42  Netherlands
-rw------- 1 root root 361 Oct  3 17:46 'Wired connection 1'

Connection enp2so just appears and when I manually re-connect ‘Wired connection 1’ enp2s0 will disappear as if it was never there.

Misunderstanding, the Disconnect and re-Connect is done manually.
If no commands are given the connection stays on enp2s0.

This event has occurred 4 times in the last hour. On one occasion at least the icon showed disconnected although still connected to enp2s0.

nm is set to allow auto negotiate the connection. Its assumed the router is automatically changing parameters and this causes the change of connection.
Although from the PC side nothing appears to have changed with respect to addressing.

I did not set auto-negotiation, I just selected 1000Mb/s and full duplex.

Jan.

Does ethtool report as expected?

/usr/sbin/ethtool enp2s0

I get this:

/usr/sbin/ethtool enp2s0
Settings for enp2s0:
        Supported ports:  TP MII ]
        Supported link modes:   10baseT/Half 10baseT/Full  
                                100baseT/Half 100baseT/Full  
                                1000baseT/Half 1000baseT/Full  
        Supported pause frame use: No
        Supports auto-negotiation: Yes
        Supported FEC modes: Not reported
        Advertised link modes:  10baseT/Half 10baseT/Full  
                                100baseT/Half 100baseT/Full  
                                1000baseT/Half 1000baseT/Full  
        Advertised pause frame use: Symmetric Receive-only
        Advertised auto-negotiation: Yes
        Advertised FEC modes: Not reported
        Link partner advertised link modes:  10baseT/Half 10baseT/Full  
                                             100baseT/Half 100baseT/Full  
                                             1000baseT/Full  
        Link partner advertised pause frame use: Symmetric
        Link partner advertised auto-negotiation: Yes
        Link partner advertised FEC modes: Not reported
        Speed: 1000Mb/s
        Duplex: Full
        Port: MII
        PHYAD: 0
        Transceiver: internal
        **Auto-negotiation: on**
Cannot get wake-on-lan settings: Operation not permitted
        Current message level: 0x00000033 (51)
                               drv probe ifdown ifup
        Link detected: yes

When I look at the NM settings I see that the tickbox is not marked. Is there another way to switch auto-negotiation off?

Can you confirm this via the connection profile?

cat /etc/NetworkManager/system-connections/'Wired connection 1'

Can you also confirm that wicked is not active?

sudo systemctl status wicked

This situation has now been resolved here.

the issue was caused by the line in etc/sysconfig/network/config being changed to CHECK_DUPLICATE_IP=“no” (supposedly to speed up booting)

and

the PC ip address (static addressing) being given to another device in the router

hence if the other device was ON, a connection with that address could not be established and then the router re-allocating the connection to a free address

thus the attempt to establish a connection via “vdk-wired” failed but was possible with a different address via “enp2s0”

the cmd ip address though still gave the connection as via the demanded static address and not the new address automatically allocated by the router

resolution
the device addresses allocated in the router were set to different values and the devices themselves set to auto for addressing in NM

now ip address gives
inet 192.168.178.124/24 brd 192.168.178.255 scope global dynamic noprefixroute enp2s0

and the router states

192.168.178.128

if confused by the above, you are not alone

router used: “FRITZ!Box 6490 Cable”
conclusion: user manual needs to be read thoroughly

Nice you got it solved, and reported back. My guess is you’re using the big “Z” as a provider … :slight_smile: