Check stability of the internet connection

5,409
  1. Test the status of your machine's network connection.

    ifconfig [INTERFACE]
    

    Replace [INTERFACE] with the name of the offending network interface. For the first (or only) Ethernet interface that would typically be eth0. The output of that command should have at least an entry for inet addr (or inet6 addr with global scope, if you're on an IPv6-only network) to be able to talk to the local internet gateway/router. You can restrict the output to these entries with

    LANG=POSIX ifconfig [INTERFACE] | grep -e 'inet addr:' -e 'inet6 addr:.*Scope:Global'
    
  2. Find the address of the local gateway/router. It appears in the first line of the output of

    ip route
    

    and typically has the form 192.168.x.y or 10.x.x.y (where x is a number between 0 and 255 and y is between 1 and 254), e. g. 192.168.0.1.

    Check whether the local gateway/router is reachable under its previously determined address:

    ping -W 0.5 -c 4 [ADDRESS]
    

    If this command reports an error message instead of timing information, the gateway is unreachable (disconnected, switched off, unresponsive).

  3. Check the internet connection by trying to contact a well-known server on the internet:

    ping -c 4 google.com
    

    If the hostname could not be resolved, the local router or the upstream provider may have an (intermittent) DNS issue. You may still be able to contact remote hosts by their IP address:

    ping -c 4 8.8.8.8
    

    or in the case of IPv6 networks:

    ping6 -c 4 2001:4860:4860::8888
    

    If neither of these return positive responses, the connection from the local router to your internet provider is likely non-functional. There are rarer cases of a partial outage, where the provider can still be reached, but some or all other networks (like Google's servers in the commands above) are unreachable.

    Unfortunately it is not trivial to determine, whether the issue lies with your local gateway/router/modem setup or on the end of your internet provider.

Share:
5,409

Related videos on Youtube

helle
Author by

helle

Updated on September 18, 2022

Comments

  • helle
    helle over 1 year

    I am using Ubuntu 12.04 and want to find out if my system or the router or the provider is causing the problem, why I loose internet connection once or twice an hour.

    The computer is connected via Ethernet and the behaviour is that I loose connection and after 30 to 90 seconds the connection is re-established automatically again.

    • Where shall I start to search?
    • What tools are there to check such an issue?
    • kos
      kos about 8 years
      Could please remove the "update" part (in a way that it's still clear that you were connected both via ethernet and via wi-fi) and post it as an answer? Thanks.
    • kos
      kos about 8 years
      Well, if the problem was the fact that you were connected to the same network though two different adapters at once, than the fact that you shouldn't connect to the same network though two different adapters at once is the (most direct) answer, isn't it? In general the answer (which in this case is explaining what was wrong) shouldn't stay in the question, the question should contain just the problem; nevertheless that information makes up for a perfect answer IMO, as it explains what not to do.
    • helle
      helle about 8 years
      ok, i ll check that later, still at office. fell free to edit and answer yourselfe
    • kos
      kos about 8 years
      I rolled back the question to the last revision, I wouldn't take credit for an answer which is not of my own: there's no hurry, you could just post it this evening if willing. If not let me know and I'll post a CW answer, that information really should be visible.
  • helle
    helle about 8 years
    Thanks. Well, as I cannot predict when the connection will be lost, and the lack is kind of short (30-90 sek) I was searching for a tool, which provides me that information ... maybe I ll write a script The Problem is, that I also need to check if it is my hardware system ... maybe there is a problem with the memory, or so, or would you say, that cannot be the problem at all?
  • David Foerster
    David Foerster about 8 years
    Intermittent networking issues are not the (most prominent) symptoms of CPU or main memory issues. Not even broken network adapters should exhibit such a behaviour pattern. They would either not work at all or be much more flaky than just infrequent, short temporary outages.