Laggy NetworkManager

Hello!

I am experiencing very laggy behaviour of NetworkManager on Manjaro with i3. The main issue is very “long” connection to VPN. After clicking “NetworkManager → VPN Connections → name_of_vpn” from context menu in i3 the window of NetworkManager opens. On other computers and on Ubuntu on the same computer this window remains open less than a second, everything successfully connects and that’s basically it. But on Manjaro this window is opened for, like, 10+ seconds, unresponding (and the NetworkManager does not respond either during this time). After that, though, everything becomes normal: connection is successful, NetworkManager becomes available again, everything is fine. But the long duration of the actual connection and unresponsiveness of NetworkManager really pisses me off. I repeat, on other systems, I did not have this issue, VPN is perfectly fine and the connection speed (after the connection has been made) is perfectly fine, so it is some inner problem of NetworkManager on Manjaro. How can I fix it?

openvpn - Trouble connecting to VPN using network-manager, while command line works - Unix & Linux Stack Exchange

Unfortunately, this is my problem. In my case, VPN connections work perfectly fine. The problem is that after pressing “connect” NetworkManager become unresponsive for approximately 10 seconds. And because of that, the connection procedure takes 10+ seconds. On Ubuntu, at the same time, the connection procedure is instant.

A little bit more info: I looked at journalctl -u NetworkManager and there, after I press “connect” these logs appear:

фев 09 18:28:55 ROG NetworkManager[795]: <info>  [1644420535.4955] audit: op="connection-activate" uuid="00dfee21-ae42-46c4-a185-8167887f3bf6" name="Skoltech" pid=1677 uid=1000 result="success"
фев 09 18:28:55 ROG NetworkManager[795]: <info>  [1644420535.5004] vpn-connection[0x560598316130,00dfee21-ae42-46c4-a185-8167887f3bf6,"Skoltech",0]: Started the VPN service, PID 4238
фев 09 18:28:55 ROG NetworkManager[795]: <info>  [1644420535.5135] vpn-connection[0x560598316130,00dfee21-ae42-46c4-a185-8167887f3bf6,"Skoltech",0]: Saw the service appear; activating connection
фев 09 18:29:17 ROG NetworkManager[795]: <info>  [1644420557.0720] vpn-connection[0x560598316130,00dfee21-ae42-46c4-a185-8167887f3bf6,"Skoltech",0]: VPN connection: (ConnectInteractive) reply received
фев 09 18:29:17 ROG NetworkManager[795]: <info>  [1644420557.0735] manager: (vpn0): new Tun device (/org/freedesktop/NetworkManager/Devices/6)
фев 09 18:29:17 ROG NetworkManager[795]: <info>  [1644420557.0760] vpn-connection[0x560598316130,00dfee21-ae42-46c4-a185-8167887f3bf6,"Skoltech",0]: VPN plugin: state changed: starting (3)
фев 09 18:29:17 ROG openconnect[4496]: Connected to 89.106.174.122:443
фев 09 18:29:17 ROG openconnect[4496]: SSL negotiation with 89.106.174.122
фев 09 18:29:17 ROG openconnect[4496]: Server certificate verify failed: signer not found
фев 09 18:29:17 ROG openconnect[4496]: Connected to HTTPS on 89.106.174.122 with ciphersuite (TLS1.0)-(DHE-CUSTOM1024)-(AES-128-CBC)-(SHA1)
фев 09 18:29:17 ROG openconnect[4496]: Got CONNECT response: HTTP/1.1 200 OK
фев 09 18:29:17 ROG openconnect[4496]: CSTP connected. DPD 30, Keepalive 20
фев 09 18:29:17 ROG openconnect[4496]: Connected as 10.30.240.19, using SSL, with DTLS in progress
фев 09 18:29:17 ROG openconnect[4496]: Established DTLS connection (using GnuTLS). Ciphersuite (DTLS0.9)-(DHE-CUSTOM)-(AES-128-CBC)-(SHA1).
фев 09 18:29:18 ROG openconnect[4496]: SIOCSIFMTU: Operation not permitted
фев 09 18:29:18 ROG NetworkManager[795]: <info>  [1644420558.1636] vpn-connection[0x560598316130,00dfee21-ae42-46c4-a185-8167887f3bf6,"Skoltech",0]: VPN connection: (IP Config Get) reply received.
фев 09 18:29:18 ROG NetworkManager[795]: <info>  [1644420558.1645] vpn-connection[0x560598316130,00dfee21-ae42-46c4-a185-8167887f3bf6,"Skoltech",5:(vpn0)]: VPN connection: (IP4 Config Get) reply received
фев 09 18:29:18 ROG NetworkManager[795]: <info>  [1644420558.1648] vpn-connection[0x560598316130,00dfee21-ae42-46c4-a185-8167887f3bf6,"Skoltech",5:(vpn0)]: Data: VPN Gateway: 89.106.174.122
фев 09 18:29:18 ROG NetworkManager[795]: <info>  [1644420558.1649] vpn-connection[0x560598316130,00dfee21-ae42-46c4-a185-8167887f3bf6,"Skoltech",5:(vpn0)]: Data: Tunnel Device: "vpn0"
фев 09 18:29:18 ROG NetworkManager[795]: <info>  [1644420558.1649] vpn-connection[0x560598316130,00dfee21-ae42-46c4-a185-8167887f3bf6,"Skoltech",5:(vpn0)]: Data: IPv4 configuration:
фев 09 18:29:18 ROG NetworkManager[795]: <info>  [1644420558.1649] vpn-connection[0x560598316130,00dfee21-ae42-46c4-a185-8167887f3bf6,"Skoltech",5:(vpn0)]: Data:   Internal Address: 10.30.240.19
фев 09 18:29:18 ROG NetworkManager[795]: <info>  [1644420558.1649] vpn-connection[0x560598316130,00dfee21-ae42-46c4-a185-8167887f3bf6,"Skoltech",5:(vpn0)]: Data:   Internal Prefix: 22
фев 09 18:29:18 ROG NetworkManager[795]: <info>  [1644420558.1649] vpn-connection[0x560598316130,00dfee21-ae42-46c4-a185-8167887f3bf6,"Skoltech",5:(vpn0)]: Data:   Internal Point-to-Point Address: 10.30.240.19
фев 09 18:29:18 ROG NetworkManager[795]: <info>  [1644420558.1649] vpn-connection[0x560598316130,00dfee21-ae42-46c4-a185-8167887f3bf6,"Skoltech",5:(vpn0)]: Data:   Static Route: 195.133.216.192/26   Next Hop: 0.0.0.0
фев 09 18:29:18 ROG NetworkManager[795]: <info>  [1644420558.1649] vpn-connection[0x560598316130,00dfee21-ae42-46c4-a185-8167887f3bf6,"Skoltech",5:(vpn0)]: Data:   Static Route: 178.238.124.128/28   Next Hop: 0.0.0.0
фев 09 18:29:18 ROG NetworkManager[795]: <info>  [1644420558.1649] vpn-connection[0x560598316130,00dfee21-ae42-46c4-a185-8167887f3bf6,"Skoltech",5:(vpn0)]: Data:   Static Route: 10.0.0.0/8   Next Hop: 0.0.0.0
фев 09 18:29:18 ROG NetworkManager[795]: <info>  [1644420558.1649] vpn-connection[0x560598316130,00dfee21-ae42-46c4-a185-8167887f3bf6,"Skoltech",5:(vpn0)]: Data:   Static Route: 10.30.240.0/22   Next Hop: 0.0.0.0
фев 09 18:29:18 ROG NetworkManager[795]: <info>  [1644420558.1649] vpn-connection[0x560598316130,00dfee21-ae42-46c4-a185-8167887f3bf6,"Skoltech",5:(vpn0)]: Data:   Internal DNS: 10.17.11.100
фев 09 18:29:18 ROG NetworkManager[795]: <info>  [1644420558.1649] vpn-connection[0x560598316130,00dfee21-ae42-46c4-a185-8167887f3bf6,"Skoltech",5:(vpn0)]: Data:   Internal DNS: 10.17.11.200
фев 09 18:29:18 ROG NetworkManager[795]: <info>  [1644420558.1650] vpn-connection[0x560598316130,00dfee21-ae42-46c4-a185-8167887f3bf6,"Skoltech",5:(vpn0)]: Data:   DNS Domain: 'skoltech.ru'
фев 09 18:29:18 ROG NetworkManager[795]: <info>  [1644420558.1650] vpn-connection[0x560598316130,00dfee21-ae42-46c4-a185-8167887f3bf6,"Skoltech",5:(vpn0)]: Data: No IPv6 configuration
фев 09 18:29:18 ROG NetworkManager[795]: <info>  [1644420558.1650] vpn-connection[0x560598316130,00dfee21-ae42-46c4-a185-8167887f3bf6,"Skoltech",5:(vpn0)]: VPN plugin: state changed: started (4)
фев 09 18:29:18 ROG NetworkManager[795]: <info>  [1644420558.1666] vpn-connection[0x560598316130,00dfee21-ae42-46c4-a185-8167887f3bf6,"Skoltech",5:(vpn0)]: VPN connection: (IP Config Get) complete
фев 09 18:29:18 ROG NetworkManager[795]: <info>  [1644420558.1677] device (vpn0): state change: unmanaged -> unavailable (reason 'connection-assumed', sys-iface-state: 'external')
фев 09 18:29:18 ROG NetworkManager[795]: <info>  [1644420558.1698] device (vpn0): state change: unavailable -> disconnected (reason 'connection-assumed', sys-iface-state: 'external')
фев 09 18:29:18 ROG NetworkManager[795]: <info>  [1644420558.1702] device (vpn0): Activation: starting connection 'vpn0' (7a215f91-5c75-4670-8f8a-b94b95a51e9d)
фев 09 18:29:18 ROG NetworkManager[795]: <info>  [1644420558.1715] device (vpn0): state change: disconnected -> prepare (reason 'none', sys-iface-state: 'external')
фев 09 18:29:18 ROG NetworkManager[795]: <info>  [1644420558.1716] device (vpn0): state change: prepare -> config (reason 'none', sys-iface-state: 'external')
фев 09 18:29:18 ROG NetworkManager[795]: <info>  [1644420558.1718] device (vpn0): state change: config -> ip-config (reason 'none', sys-iface-state: 'external')
фев 09 18:29:18 ROG NetworkManager[795]: <info>  [1644420558.1720] device (vpn0): state change: ip-config -> ip-check (reason 'none', sys-iface-state: 'external')
фев 09 18:29:18 ROG NetworkManager[795]: <info>  [1644420558.2105] device (vpn0): state change: ip-check -> secondaries (reason 'none', sys-iface-state: 'external')
фев 09 18:29:18 ROG NetworkManager[795]: <info>  [1644420558.2108] device (vpn0): state change: secondaries -> activated (reason 'none', sys-iface-state: 'external')
фев 09 18:29:18 ROG NetworkManager[795]: <info>  [1644420558.2113] device (vpn0): Activation: successful, device activated.

As you can see, there is 23 seconds delay between line

фев 09 18:28:55 ROG NetworkManager[795]: <info>  [1644420535.5135] vpn-connection[0x560598316130,00dfee21-ae42-46c4-a185-8167887f3bf6,"Skoltech",0]: Saw the service appear; activating connection

and line

фев 09 18:29:17 ROG NetworkManager[795]: <info>  [1644420557.0720] vpn-connection[0x560598316130,00dfee21-ae42-46c4-a185-8167887f3bf6,"Skoltech",0]: VPN connection: (ConnectInteractive) reply received

Basically, during this delay NetworkManager is unresponding. Maybe someone can see the cause of this delay in the log?

Upstream openvpn - Network manager failing to connect VPN - Ask Ubuntu