webOS Nation Forums >  webOS apps and software >  webOS development > Possible tether work-around
Possible tether work-around

  Reply
 
LinkBack Thread Tools Display Modes
Old 06/16/2009, 01:41 PM   #61 (permalink)
Member
 
Join Date: Apr 2008
Posts: 259
Likes Received: 0
Thanks: 8
Thanked 64 Times in 30 Posts
Default

Quote:
Originally Posted by grindz145 View Post
@fish what do you mean by this:

Then type in about:config, enter 'dns' in filter and double click network.proxy.socks_remote_dns

I setup the proxy and connection just fine but it dosn't want to pass traffic (likely because DNS is not setup properly) I feel like I should already know this but ... n00b.

Thanks.
If you use the FoxyProxy extension, you should not need this extra step.
xcomputerman is offline   Reply With Quote
Thanked By: grindz145
Old 06/16/2009, 03:55 PM   #62 (permalink)
Member
 
kmehr's Avatar
 
Join Date: Oct 2007
Posts: 269
Likes Received: 0
Thanks: 133
Thanked 63 Times in 48 Posts
Default

looks like this is going to be a no go for me for now... maybe when I have more time I will see if I can access the root in Win 7. Thanks for all the help and advice
kmehr is offline   Reply With Quote
Old 06/16/2009, 04:10 PM   #63 (permalink)
Member
 
Join Date: Jun 2009
Posts: 18
Likes Received: 0
Thanks: 16
Thanked 0 Times in 0 Posts
Default

I haven't got my pre yet but I am anxious to try one of these methods. Does anyone know which one works better adhoc or bluetooth?
OpenBGP is offline   Reply With Quote
Old 06/16/2009, 04:40 PM   #64 (permalink)
Member
 
Join Date: Aug 2007
Location: Denver, CO
Posts: 33
Likes Received: 0
Thanks: 5
Thanked 20 Times in 5 Posts
Default

Quote:
Originally Posted by grindz145 View Post
@fish what do you mean by this:

Then type in about:config, enter 'dns' in filter and double click network.proxy.socks_remote_dns

I setup the proxy and connection just fine but it dosn't want to pass traffic (likely because DNS is not setup properly) I feel like I should already know this but ... n00b.

Thanks.
This tells Firefox to route DNS though the proxy as well as regular traffic. Type 'about:config' into your URL bar and press enter. Firefox might give a warning, click 'I'll be carefull, I promise!'. Then at the top of the page there is a text box where you enter a filter. Type in 'dns'. You should see ~4 properties listed, double click the line that says 'network.proxy.socks_remote_dns', so that in the value column it says true.
fish199902 is offline   Reply With Quote
Old 06/16/2009, 05:22 PM   #65 (permalink)
Member
 
kmehr's Avatar
 
Join Date: Oct 2007
Posts: 269
Likes Received: 0
Thanks: 133
Thanked 63 Times in 48 Posts
Default

ok I gave it another stab and finally rooted device and connected via putty, but after that I come to a road-block. I have the settings in Firefox set, but when I log in and type in my password I get (*************@castle:~$) in the putty consle. Also no net conectivity on PC.

Any help?
kmehr is offline   Reply With Quote
Old 06/16/2009, 10:02 PM   #66 (permalink)
Member
 
Join Date: Jun 2009
Posts: 13
Likes Received: 0
Thanks: 4
Thanked 1 Time in 1 Post
Default

xcomputerman great suggestion! I finally got it to work right using foxyproxy.

Thanks for the explanation fish, I was a little too sleep deprived the first try:-d
grindz145 is offline   Reply With Quote
Old 06/17/2009, 04:27 AM   #67 (permalink)
Member
 
Join Date: Jun 2009
Posts: 49
Likes Received: 0
Thanks: 1
Thanked 2 Times in 2 Posts
Default

you don't have to setup firefox or IE to use the socks proxy - here is what I did:

Root your phone (use the wiki linked in this thread several times)
Connect using Personal Area Network (PAN - bluetooth)
Most technical part:
using putty or ssh, connect to Pre (over ip 10.1.1.10)
log in as the user id you created when you root'ed your phone
type 'sudo su -'
type your password

First time only:

type 'vi tether.sh'
hit the letter i
paste this portion of fish199902's code:

#---------------- begin code --------------------------

iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE

while true; do
# This value resets iteself to 0 periodically, anyone know why?
echo 1 > /proc/sys/net/ipv4/ip_forward
sleep 10
done

#---------------- end code --------------------------

hit esc
type ':wq'
hit enter

this should have created a file called tether.sh with the code from above in it, and those steps are a one time only event.

type '. ./tether.sh' and hit enter
you should now be able to surf the web without setting up proxies on your laptop. In the future, you only need to connect to pan - putty/ssh to the phone and run tether.sh as root. - hope that helps
dsackr is offline   Reply With Quote
Old 06/17/2009, 05:37 AM   #68 (permalink)
Member
 
Join Date: Jun 2009
Posts: 360
Likes Received: 0
Thanks: 10
Thanked 66 Times in 35 Posts
Default

Explains why my attempts ad modifying the firewall rules failed, if it keeps turning off up forwarding that would disable it.
joshewah is offline   Reply With Quote
Old 06/17/2009, 05:50 AM   #69 (permalink)
Member
 
Join Date: Jun 2009
Posts: 13
Likes Received: 0
Thanks: 4
Thanked 1 Time in 1 Post
Default

@dsacker you can also install a graphical shell using your web browser which then would allow you to execute the script without ssh at all.

pre dev wiki: Graphical Shell


Edit: on second thought, you may need to still SSH over BT. This would work with wifi rule but you would have to change the script a bit.

Last edited by grindz145; 06/17/2009 at 08:48 AM.
grindz145 is offline   Reply With Quote
Old 06/17/2009, 11:25 AM   #70 (permalink)
Member
 
Join Date: Jun 2009
Posts: 8
Likes Received: 0
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Anybody having problems connecting to the NAP? I can pair with the Pre, and set up a hands-free connection, but I keep getting errors the device is busy when trying to connect with NAP. I know it works because I was successful yesterday but haven't been able to re-connect with it since. Reinstalled BT drivers a couple times, unpaired the device, rebooted the Pre, etc...all same thing.

Any ideas?
cwlong88 is offline   Reply With Quote
Old 06/17/2009, 11:50 AM   #71 (permalink)
Member
 
Join Date: Jun 2009
Posts: 13
Likes Received: 0
Thanks: 4
Thanked 1 Time in 1 Post
Default

Pairing seems to work best for me right after the bluetooth configuration window is opened and turned on. I think it probably sends out a bunch of packets then so it's easier to pair.
grindz145 is offline   Reply With Quote
Old 06/18/2009, 03:25 AM   #72 (permalink)
Member
 
Join Date: Jun 2009
Location: Seattle
Posts: 251
Likes Received: 0
Thanks: 41
Thanked 16 Times in 14 Posts
Default

IP Forward trick works great! I did this on OS X with no issues. you need to make sure you turn off wifi on the pre though.

wprater is offline   Reply With Quote
Old 06/18/2009, 06:14 AM   #73 (permalink)
Member
 
Join Date: Jun 2009
Posts: 36
Likes Received: 0
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by kmehr View Post
Unfortunately I am running win 7 64-bit and it will not work for me
I can second this...
rmp459 is offline   Reply With Quote
Old 06/18/2009, 06:32 AM   #74 (permalink)
Member
 
Join Date: Jun 2009
Posts: 36
Likes Received: 0
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by dsackr View Post
you don't have to setup firefox or IE to use the socks proxy - here is what I did:

Root your phone (use the wiki linked in this thread several times)
Connect using Personal Area Network (PAN - bluetooth)
Most technical part:
using putty or ssh, connect to Pre (over ip 10.1.1.10)
log in as the user id you created when you root'ed your phone
type 'sudo su -'
type your password

First time only:

type 'vi tether.sh'
hit the letter i
paste this portion of fish199902's code:

#---------------- begin code --------------------------

iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE

while true; do
# This value resets iteself to 0 periodically, anyone know why?
echo 1 > /proc/sys/net/ipv4/ip_forward
sleep 10
done

#---------------- end code --------------------------

hit esc
type ':wq'
hit enter

this should have created a file called tether.sh with the code from above in it, and those steps are a one time only event.

type '. ./tether.sh' and hit enter
you should now be able to surf the web without setting up proxies on your laptop. In the future, you only need to connect to pan - putty/ssh to the phone and run tether.sh as root. - hope that helps
When I try to execute this file I get permission denied... any ideas?
rmp459 is offline   Reply With Quote
Old 06/18/2009, 07:56 AM   #75 (permalink)
Member
 
Join Date: Jun 2009
Posts: 13
Likes Received: 0
Thanks: 4
Thanked 1 Time in 1 Post
Default

RMP, you have to run as root, try using the sudo or su command, or google these to do a bit more reading on how it works. you can also use a chmod command to make it executable by your main user.
grindz145 is offline   Reply With Quote
Old 06/18/2009, 10:56 AM   #76 (permalink)
Member
 
Join Date: Jun 2009
Posts: 13
Likes Received: 0
Thanks: 3
Thanked 1 Time in 1 Post
Default

Quote:
Originally Posted by wprater View Post
IP Forward trick works great! I did this on OS X with no issues. you need to make sure you turn off wifi on the pre though.
Hmm How do you get such good speeds. With 4 bars of Ev DO I only get .20/.20 down/up. Its really sluggish...
mykael is offline   Reply With Quote
Old 06/18/2009, 05:12 PM   #77 (permalink)
Member
 
Join Date: Jun 2009
Posts: 36
Likes Received: 0
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by grindz145 View Post
RMP, you have to run as root, try using the sudo or su command, or google these to do a bit more reading on how it works. you can also use a chmod command to make it executable by your main user.
I am running as root... and I have used sudo ... lol ive tried to chmod as well to make it RW... but no luck.. I guess ill keep trying...

Somehow my root filesystem is read only...

Last edited by rmp459; 06/18/2009 at 05:36 PM.
rmp459 is offline   Reply With Quote
Old 06/18/2009, 05:27 PM   #78 (permalink)
Member
 
zorinlynx's Avatar
 
Join Date: Jun 2009
Location: Miami, FL
Posts: 195
Likes Received: 0
Thanks: 0
Thanked 41 Times in 20 Posts
Default

Quote:
Originally Posted by rmp459 View Post
When I try to execute this file I get permission denied... any ideas?
chmod 755 ./tether.sh
./tether.sh

and it should run.

Note that the phone waking every 10 seconds to send that "1" to ip_forward will probably affect battery life. You might want to kill the tether.sh script when you're done.

ps aux |grep tether
(get the number)
kill 1234



-Z
zorinlynx is offline   Reply With Quote
Old 06/18/2009, 05:45 PM   #79 (permalink)
Member
 
Join Date: Jun 2009
Posts: 36
Likes Received: 0
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by zorinlynx View Post
chmod 755 ./tether.sh
./tether.sh

and it should run.

Note that the phone waking every 10 seconds to send that "1" to ip_forward will probably affect battery life. You might want to kill the tether.sh script when you're done.

ps aux |grep tether
(get the number)
kill 1234



-Z
Thanks for the kill info... only problem is I can't even write the tether.sh file...

Ive tried even "sudo vi tether.sh" but when I try to write and quit it says "tether.sh Read-only file system"

Im guessing I have to remount the file system as rw somehow...

EDIT: okay i remounted my filesystem as rw and was able to write tether.sh.... is it okay to leave the filesystem as rw? or should I remount it back to ro?

Also, (lol god i suck) "./tether.sh: line 4: iptables: not found" when I try to run it

Last edited by rmp459; 06/18/2009 at 06:04 PM.
rmp459 is offline   Reply With Quote
Old 06/19/2009, 12:09 AM   #80 (permalink)
Member
 
Join Date: Jun 2009
Posts: 49
Likes Received: 0
Thanks: 1
Thanked 2 Times in 2 Posts
Default

Quote:
Originally Posted by rmp459 View Post
Also, (lol god i suck) "./tether.sh: line 4: iptables: not found" when I try to run it
The issue is you don't have the path in your $PATH variable - I don't type sudo before each command - instead I type this:

sudo su -

You then become root and all subsequent comments are executed as root and does not need the sudo prefix...
dsackr is offline   Reply With Quote
Reply

 

Thread Tools
Display Modes



 


Content Relevant URLs by vBSEO 3.6.0