Skip to content

Instantly share code, notes, and snippets.

@xkr47
Last active December 16, 2015 05:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xkr47/631a4d9432c879a27a00 to your computer and use it in GitHub Desktop.
Save xkr47/631a4d9432c879a27a00 to your computer and use it in GitHub Desktop.
Two-way internet sharing with Jolla/sailfishos

Figure 1

In "internet sharing" mode

  • as-is implemented now, no changes needed
  • phone has static ip configuraton for usb network interface
  • phone runs udhcpd, which
    • provides gateway & dns info as made available by e.g. cellular internet connection
  • pc runs dhcp client, gets ip, gateway & dns info from phone

In "developer" mode

  • currently:
    • phone has same static ip configuration for usb network interface
    • phone runs udhcpd, which
      • provides no gateway & dns info, just ip
    • pc runs dhcp client, gets ip only from phone
  • proposed MVP:
    • introduce new boolean setting "Reverse Internet sharing" (CONF-RIS) in e.g. developer mode preferences
    • phone runs udhcpd, which
      • provides no gateway & dns info, just ip
      • if (CONF-RIS) then reacts to dhcp client connections
        • adds ip of dhcp client as resolver for usb ethernet interface
        • sets ip of dhcp client as default gateway
    • pros
      • does not change anything for current users if CONF-RIS is disabled
      • PC/phone dhcp roles stay the same even when CONF-RIS is enabled
      • Phone is always in control of which machine sets up the default gateway towards the other without additional logic on the PC, so no "guessing" is needed in the PC.
    • cons
      • requires PC to provide dns service on dynamic ip assigned by phone (either by dns software or firewall redirection)
  • further improvements
    • introduce custom dns setting "Manual DNS" (CONF-DNS). When specified it is used instead of the dynamic IP assigned to the PC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment