We have moved to a new Sailfish OS Forum. Please start new discussions there.

Revision history [back]

click to hide/show revision 1
initial version

posted 2017-04-04 14:19:13 +0200

How to access the Internet through usb network ?

Hi,

For some reason I don't want to use Wifi when it is not necessary. So, at home, I want to connect my Jolla usb cable to my computer (using Linux Debian) and to be able to upgrade the phone, using apps, etc. Unfortunately, it does not work as expected.

What I did so far :

I have shell script that do the following : modprobe usbnet verify that usb0 has the correct IP address or set it up if not (192.168.2.4) ping the phone send, via ssh, the following command to the Jolla : ip route del default ip route add default via 192.168.2.4

Back on the computer : echo 1 > /proc/sys/net/ipv4/ip_forward /sbin/iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE /sbin/iptables -A FORWARD -i usb0 -o eth0 -j ACCEPT /sbin/iptables -A FORWARD -i eth0 -o usb0 -j ACCEPT

At that point, the phone is able to ping hosts on the Internet, even sshing to them.

But, apps do not want to use this connection. They just ask to connect through Wifi or Phonedata ...

I must have missed something, but I cannot find it :( Any idea ?

How to access the Internet through usb network ?

Hi,

For some reason I don't want to use Wifi when it is not necessary. So, at home, I want to connect my Jolla usb cable to my computer (using Linux Debian) and to be able to upgrade the phone, using apps, etc. Unfortunately, it does not work as expected.

What I did so far :

I have shell script that do the following : modprobe usbnet verify that usb0 has the correct IP address or set it up if not (192.168.2.4) ping the phone send, via ssh, the following command to the Jolla : ip route del default ip route add default via 192.168.2.4

Back on the computer : echo 1 > /proc/sys/net/ipv4/ip_forward /sbin/iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE /sbin/iptables -A FORWARD -i usb0 -o eth0 -j ACCEPT /sbin/iptables -A FORWARD -i eth0 -o usb0 -j ACCEPT

At that point, the phone is able to ping hosts on the Internet, even sshing to them.

But, apps do not want to use this connection. They just ask to connect through Wifi or Phonedata ...

I must have missed something, but I cannot find it :( Any idea ?

How to access the Internet through usb network ?

Hi,

For some reason I don't want to use Wifi when it is not necessary. So, at home, I want to connect my Jolla usb cable to my computer (using Linux Debian) and to be able to upgrade the phone, using apps, etc. Unfortunately, it does not work as expected.

What I did so far :

I have shell script that do the following : modprobe usbnet verify that usb0 has the correct IP address or set it up if not (192.168.2.4) ping the phone send, via ssh, the following command to the Jolla : :

  • ip route del default default
  • ip route add default via 192.168.2.4

Back on the computer : :

  • echo 1 > /proc/sys/net/ipv4/ip_forward /proc/sys/net/ipv4/ip_forward
  • /sbin/iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE MASQUERADE
  • /sbin/iptables -A FORWARD -i usb0 -o eth0 -j ACCEPT ACCEPT
  • /sbin/iptables -A FORWARD -i eth0 -o usb0 -j ACCEPT

At that point, the phone is able to ping hosts on the Internet, even sshing to them.

But, apps do not want to use this connection. They just ask to connect through Wifi or Phonedata ...

I must have missed something, but I cannot find it :( Any idea ?