Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Bandwidth exhaustion not detected on WAN links

    Scheduled Pinned Locked Moved Routing and Multi WAN
    1 Posts 1 Posters 86 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J
      Jolly green robot
      last edited by

      Is there a way to automatically detect bandwidth depletion on a WAN link and disable the gateway?

      Some ISPs don't block everything once you have consumed your bandwidth quota, instead they limit the amount of data that can be transmitted per session.
      DNS lookups, ping to the gateway or monitor IP succeeds as well as a traceroute but http requests fail.

      Performing a curl request to https://connectivitycheck.gstatic.com/generate_204 detects this and exits with a 28 operation timeout exit code when blocked.

      curl --interface xxx.xxx.xxx.34 --insecure --connect-timeout 2 --max-time 4 'http://connectivitycheck.gstatic.com/generate_204' ; echo $?
      curl: (28) Operation timed out after 4013 milliseconds with 0 bytes received
      28
      
      curl --interface xxx.xxx.xxx.50 --insecure --connect-timeout 2 --max-time 4 'http://connectivitycheck.gstatic.com/generate_204' ; echo $?
      0
      

      All of the following URLs (services) work for the test but only the Google one works without SSL.
      https://detectportal.firefox.com
      https://conncheck.opensuse.org
      https://connectivitycheck.gstatic.com/generate_204
      http://connectivitycheck.gstatic.com/generate_204

      I have tried several others but they didn't get blocked since not enough data was transferred.

      Thanks

      1 Reply Last reply Reply Quote 0
      • First post
        Last post
      Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.