Is there a way to automatically trigger a Wifi-reconnect attempt?
FedoraForum.org - Fedora Support Forums and Community
Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2018
    Location
    Europe
    Posts
    2
    Windows NT 10.0 Chrome 67.0.3396.99

    Question Is there a way to automatically trigger a Wifi-reconnect attempt?

    Hi, is there a way to automatically trigger a Wifi-reconnect attempt?

    The story: I am running a small home server that is connected via Wifi (not, ideal, I know). When I restart the Wifi-Router, the connection drops first, but then Fedora cannot reconnect automatically. Only when I manually disable and enable Wifi again, it reconnects without problems.

    I checked the log files and it seems the error is on the router's side. The reconnection attempt from my server comes too early so that the password is rejected by the router at first. After a second, manual try it works again.

    Is there a way to set a timer to first wait a few seconds after trying to reconnect to the Wifi? Or a way to trigger a reconnection attempt automatically after a few minutes?

    Thanks for your help,
    Chris

  2. #2
    tempest766 Guest

    Re: Is there a way to automatically trigger a Wifi-reconnect attempt?

    a background script that checks the connection every 60 seconds. If it fails it runs nmcli to reconnect.

  3. #3
    Join Date
    Dec 2012
    Location
    santa barbara, CA
    Posts
    926
    Linux (Fedora) Firefox 61.0

    Re: Is there a way to automatically trigger a Wifi-reconnect attempt?

    while :
    do
    nslookup netcraft.com
    sleep 10
    done

    I have found that an "nslookup" call will re-trigger network connection, if you are using NetworkManager I guess.
    "monsters John ... monsters from the ID..."
    "ma vule teva maar gul nol naya"

  4. #4
    Join Date
    Jul 2018
    Location
    Europe
    Posts
    2
    Linux (Fedora) Firefox 61.0

    Re: Is there a way to automatically trigger a Wifi-reconnect attempt?

    Thanks for the reply.

    Based on your input I made a simple script that I run every 15 minutes as a cron job. It checks whether google.com is there, if not it switches off the wifi and after a time it switches it on again.

    Works very well!

    #!/bin/bash

    #Script tests whether server can connect to network. If not, WIFI connection is restarted.

    echo "Running test to keep connection alive..."
    wget -q --spider http://google.com

    if [ $? -eq 0 ]; then
    echo "Online. All is fine."
    else
    echo "Offline. Re-initiating wifi."
    nmcli radio wifi off
    sleep 15
    nmcli radio wifi on
    fi

Similar Threads

  1. Replies: 3
    Last Post: 4th July 2011, 06:33 PM
  2. [SOLVED]
    Fedora 14 Automatically logs out after login attempt.
    By helsaint in forum Using Fedora
    Replies: 0
    Last Post: 27th May 2011, 06:25 PM
  3. can not reconnect WPA wifi in F10 after suspend
    By bobn in forum Hardware & Laptops
    Replies: 6
    Last Post: 5th July 2009, 03:29 AM
  4. Can I make Kopete automatically reconnect?
    By SpectrumDT in forum Using Fedora
    Replies: 0
    Last Post: 12th April 2009, 05:55 PM
  5. Fedora8 loses WiFI and cannot reconnect; asus p5k-e wifi-ap
    By a_simple_system in forum Servers & Networking
    Replies: 1
    Last Post: 10th December 2007, 05:51 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •