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

How to access the Internet through usb network ?

asked 2017-04-04 14:19:13 +0300

yonux gravatar image

updated 2017-04-04 15:05:57 +0300

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 ?

edit retag flag offensive close delete

Comments

@yonux welcome to tjc. the how-to tag is reserved to give instructions, not to ask for helo. ill retag...

misc11 ( 2017-04-04 14:24:09 +0300 )edit
1

@yunox also, please use search before posting. see this thread here. does it answer your question?

misc11 ( 2017-04-04 14:29:16 +0300 )edit

Well, thanks for the retag, and sorry if I made a mistake.

For the related thread, no, it is not what I am looking for. Actually, the thread is talking about tethering which is accessing the Internet from a computer using the Internet connection of the phone. I want to do the contrary, accessing the Internet from the phone using the Internet connection of the computer.

yonux ( 2017-04-04 14:50:30 +0300 )edit
1

Mistake again ... this is not an answer, if must has been a comment ...

yonux ( 2017-04-04 14:51:01 +0300 )edit

@yonux under your answer: more > repost as comment...

misc11 ( 2017-04-04 14:54:15 +0300 )edit

1 Answer

Sort by » oldest newest most voted
3

answered 2017-04-04 16:21:20 +0300

lakutalo gravatar image

updated 2017-04-04 16:22:20 +0300

Hi @yonux, your question almost duplicates this one: https://together.jolla.com/question/58975/network-sharing-from-pc-to-phone-answered/

Could you try the answer given there? Hope it helps.

edit flag offensive delete publish link more

Comments

1

That's exactly that, thank you so much to have found it for me !

yonux ( 2017-04-04 16:39:57 +0300 )edit

You're most welcome!

lakutalo ( 2017-04-04 16:53:42 +0300 )edit
1

But ... it seems things have changed since the post. connmanctl does not consider gadget as a service anymore, and so the script is not working anymore. I am looking deeper and I will post here if I find the solution.

yonux ( 2017-04-04 17:48:53 +0300 )edit

Maybe you can find a substitute among the available packages with pkcon search name usb

lakutalo ( 2017-04-04 18:15:21 +0300 )edit
Login/Signup to Answer

Question tools

Follow
3 followers

Stats

Asked: 2017-04-04 14:19:13 +0300

Seen: 696 times

Last updated: Apr 04 '17