I am using "nmcli networking connectivity" command to know the connectivity of my wifi connection. After establishing the connection with a wifi & if I see that it has no internet connection then "nmcli networking connectivity" show "limited" which is quite natural. But when that wifi connection got internet connection back and then if I run "nmcli networking connectivity" then also I am getting "limited" instead of "full". I have rescanned the network and also wait for few seconds and then run the command but I got the same result.(i.e. limited)

But if I reconnect with the wifi by running "nmcli device wifi connect [SSID] password [wap_key]" & then try to see the network connectivity then I got "full"

So, that means every time I want to check the the network connectivity I have to reconnect with the wifi (which is not desired). Is it so?

If not then please tell me suitable method (linux command, not via gui or not via ping, system command is more acceptable) to check whether my wifi has internet access or not. [any c/c++ code is also acceptable]


1 Answer 1


I think you just missed the argument check. This argument rechecks the connectivity.

    nmcli networking connectivity check

From man pages

   connectivity [check]
       Get network connectivity state. The optional check argument tells NetworkManager to
       re-check the connectivity, else the most recent known connectivity state is displayed
       without re-checking.

       Possible states are:

           the host is not connected to any network.

           the host is behind a captive portal and cannot reach the full Internet.

           the host is connected to a network, but it has no access to the Internet.

           the host is connected to a network and has full access to the Internet.

           the connectivity status cannot be found out.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.