Saturday, April 27, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 931  / 2 Years ago, mon, august 29, 2022, 9:54:05

I have an unstable WiFi connection, and the bandwidth frequently reaches 0 without actual disconnection (it is connected but without data transfer). Resetting the network manager by


sudo service network-manager restart

perfectly fixes the problem. However, I have two issues:



  1. How can I reset the network manager without a downtime? With the above command, any ongoing download will be interrupted. Is it possible to keep the current connection while resetting?

  2. How can I write a bash script to periodically check the network connection and reset it if there is no data transfer?


I use Ubuntu 20.04.


More From » networking

 Answers
5

The information/answers provided by others are correct, you cannot reset NM and persist a connection. You have to address the root cause of your problem.


I've found that many Wifi related issues can be resolved by disabling the power management.


Here's how I do it:


Create: /etc/network/if-up.d/wifi-powerman-off

Enable: chmod +x /etc/network/if-up.d/wifi-powerman-off


Replace interface name


#!/bin/sh

IWCONFIG=/sbin/iwconfig
WLAN_IFACE=<<interface name>>

if [ ! -x $IWCONFIG ]; then
exit 1
fi

if [ "$IFACE" = $WLAN_IFACE ]; then
$IWCONFIG $IFACE power off
fi

[#3091] Wednesday, August 31, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ugeeport

Total Points: 181
Total Questions: 108
Total Answers: 99

Location: El Salvador
Member since Tue, Jun 29, 2021
3 Years ago
;