Results 1 to 2 of 2

Thread: How to make my 4G usb activate as backup connection

  1. #1
    Join Date
    May 2012
    Beans
    2

    Question How to make my 4G usb activate as backup connection

    Is there any way to make my 4G usb device to be used as a backup connection when my primary cable connection goes down automatically? Any way to set this up through terminal? This is for my small home server box. I'm guessing there must be some kind of script or program. Thank you in advance. Always been a huge fan of Ubuntu, but new to the forums.

  2. #2
    Join Date
    Jan 2009
    Location
    ::1
    Beans
    2,461

    Re: How to make my 4G usb activate as backup connection

    I assume you googled for this and you didn't find anything?

    If so, I can only give you some concepts:

    With the "ip route" command you can see and you can define the default route. So you can switch between your fixed and 4G connection.
    With "ping -I <interface> 8.8.8.8" you can ping a host from a certain interface.

    So, combining these commands, I would make such a script (attention: this is pseudocode):

    Code:
    while ALWAYS:
       ping 8.8.8.8 from fixed interface
       if unreachable:
          ping 8.8.8.8 from cellular interface
          if reachable then switch default gateway to cellular interface
       else set fixed as default gateway (if wireless was set)
       wait 5 seconds
    HTH
    Last edited by sanderj; May 17th, 2012 at 06:49 AM.

Tags for this Thread

Bookmarks

Posting Permissions

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