[SOLVED] Manually sharing Internet connection with phone via USB
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Manually sharing Internet connection with phone via USB
I'm not a total newcomer to Linux, but to networking, with which I have a very small problem, it sadly is so.
I have a phone (SE J108i) which I want to use my PC's Internet connection via USB. The phone has that feature, and in fact, it works on Ubuntu, easily (auto)configured in its GUI according to this page I found:
Thing is, I use Slackware 14, and I'd rather not install any extra software for that purpose, GUI or not. So, my question is: how to enable that sharing on it manually (say, in a script) after I plug the phone in?
Here are the details of the connection on Ubuntu:
hardware address: 02:80:37:ec:02:00
broadcast address: 10.42.0.255
subnet mask: 255.255.255.0
"IPv4 Settings: Shared to other computers" (that line I believe might be the most important)
How can I recreate that manually? The furthest I found was that after ifconfig usb0 10.42.0.1
I could ping 10.42.0.1 and the phone would respond. But I don't know what to do next. If I knew which files contain the relevant network settings, I could compare them between the systems, but I don't.
I'm sorry for such a direct request for such a small problem, but I'd really like to have that feature.
If you are seeing your usb0 device, you should be able to run dhcpcd on that device, and have it use your phone as the gateway, and should be good. Once you get to the point where you can see usb0 in your ifconfig output, run "dhcpcd usb0", and check the output of the "route" command - you should see a reference to the gateway (phone)
But it's my PC that's the gateway, IIUC. It's it that provides the connection to the phone.
Besides, I'm not sure what DHCP has to do with anything. After the Googling I did today, I came to imagine that ifconfig can be used to provide the phone with the data that's normally provided with DHCP, as quoted in my first post. But I might be wrong here.
Meanwhile, here's the output of route and iptables -L (which I Googled might have to do with it, too) on Ubuntu, if it helps: http://pastebin.com/ntZVczMZ
I'm trying to think of ways in which I could discover what the Ubuntu network manager is doing when I set the "Shared to other computers" option (which in fact is the only thing that I have to do manually for the sharing to work).
Oh, and one more thing: the live Ubuntu that I'm using actually has neither dhcpd nor dhcpcd installed at all. So whatever it does, it does without them.
Now, although my phone's OS isn't Android I think (which is the system that that guide assumes), the fact the IP address mentioned in it is the same that Ubuntu automatically assigns to the phone suggests that this might be close to what should be done. But it doesn't work (although in route output on Slackware there appeared a line identical to the line in Ubuntu's output from my previous post, only with metric = 0 instead of 1). Still, I'm posting it hoping that maybe it's missing something obvious, which somebody will point out.
(In fact, I made two changes; I replaced the penultimate line with