FORUMS
Remove All Ads from XDA

Tethering via WiFi - Troubleshooting

10 posts
Thanks Meter: 1
 
By divinehawk, Junior Member on 10th November 2008, 03:18 AM
Post Reply Email Thread
10th November 2008, 07:45 AM |#11  
Retired Moderator
Thanks Meter: 11
 
More
Quote:
Originally Posted by alansj

How about something similar to PdaNet?

http://www.theiphoneblog.com/2008/10...r-with-pdanet/

It's interesting that it works by having you set up an ad-hoc wireless network from your computer and then connecting to that from the iPhone. Maybe that's essentially what scootley was suggesting above.

PdaNet .deb here:
http://apt.modmyi.com/2debs/pdanet1.40.deb

That would be awesome... I hope someone can do that soon. I am dying to be able to connect it to my computer.
 
 
10th November 2008, 09:12 AM |#12  
hetaldp's Avatar
Senior Member
Flag Nashik
Thanks Meter: 24
 
More
A True NAT Router will be WOW with UPNP Support
10th November 2008, 11:57 AM |#13  
Junior Member
Thanks Meter: 0
 
More
I just managed to get an ad-hoc connection going between my phone and laptop, and NAT running on it. The steps are pretty much the same as in the first post of this thread, but in addition I made some changes to /system/etc/wifi/tiwlan.ini (make sure to keep a backup of the original).

First, make sure wifi is disabled on the phone gui.

Next, Set up the ad-hoc network on the laptop. I called mine "newtest". Change the properties for the connection to assign a static ip. I used 192.168.2.2. Set gateway to 192.168.2.1, and set dns to a public server - i used 4.2.2.1.

In tiwlan.ini, look for "WiFiAdhoc = 0". Change it to the following (set ssid to whatever you use):

Quote:

WiFiAdhoc = 1
dot11DesiredSSID = newtest
dot11DesiredBSSType = 0

After updating tiwlan.ini, enable wifi manually:

Quote:

insmod /system/lib/modules/wlan.ko
wlan_loader -f /system/etc/wifi/Fw1251r1c.bin -e /proc/calibration -i /system/etc/wifi/tiwlan.ini
ifconfig tiwlan0 192.168.2.1 netmask 255.255.255.0
ifconfig tiwlan0 up

At this point, the phone should connect to the ad-hoc network.

Now, from the OP's post, the iptables rules:

Quote:

iptables -I FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -I FORWARD -s 192.168.2.0/24 -j ACCEPT
iptables -P FORWARD DROP

iptables -t nat -I POSTROUTING -s 192.168.2.0/24 -j MASQUERADE

echo 1 > /proc/sys/net/ipv4/ip_forward

If all went well, you now have internet access.
10th November 2008, 12:19 PM |#14  
hetaldp's Avatar
Senior Member
Flag Nashik
Thanks Meter: 24
 
More
@rale00

Thanks a lot

i have Stock RC30 can i do this ?
10th November 2008, 12:34 PM |#15  
OP Junior Member
Thanks Meter: 1
 
More
Thanks rale00,
Quote:
Originally Posted by rale00

I just managed to get an ad-hoc connection going between my phone and laptop, and NAT running on it. The steps are pretty much the same as in the first post of this thread, but in addition I made some changes to /system/etc/wifi/tiwlan.ini (make sure to keep a backup of the original).

You can also copy tiwlan.ini to somewhere else, such as /data/local, make changes, then just specify the new file when you run wlan_loader.

Quote:

wlan_loader -f /system/etc/wifi/Fw1251r1c.bin -e /proc/calibration -i /data/local/wifi/tiwlan.ini

Also note that without running wpa_supplicant, you are going unencrypted. Using a custom wpa_supplicant.conf might work (unverified at the moment, can you try?):

My adhoc_wpa.conf
Quote:

ctrl_interface=tiwlan0
update_config=1

# IBSS/ad-hoc network with WPA-None/TKIP.
network={
ssid="newtest"
mode=1
frequency=2412
proto=WPA
key_mgmt=WPA-NONE
pairwise=NONE
group=TKIP
psk="TEST545#@network"
}

Run with:
Quote:

wpa_supplicant -f -Dtiwlan0 -itiwlan0 -c/data/local/adhoc_wpa.conf &

10th November 2008, 09:30 PM |#16  
Junior Member
Thanks Meter: 0
 
More
I tried the config you suggested for wpa_supplicant, along with a few others, but I can't seem to get a secure connection working. It tries to connect, but times out authenticating.

Maybe someone else will have some better luck with it?
10th November 2008, 09:55 PM |#17  
Retired Moderator
Thanks Meter: 11
 
More
I am guessing you put TEST545#@network as the key right?

But aren't the keys encrypted?

I thought so... the key is encrypted so we need to put a correct encryption as the key http://en.wikipedia.org/wiki/PBKDF2
11th November 2008, 02:29 AM |#18  
Member
Thanks Meter: 42
 
More
Wow, this is truly very cool. I am replying right now, tethered via ad hoc.
11th November 2008, 04:35 AM |#19  
Retired Moderator
Thanks Meter: 11
 
More
I can't connect... I am going to try it without the adhoc mode.
11th November 2008, 07:29 AM |#20  
Member
Thanks Meter: 42
 
More
It seems like one logical next step would be a dhcp server.

saurik's Debian demonstration is pretty cool but I don't have the skill to get all the dependencies sorted out and cross-compile. Nevertheless, it seems possible:

http://armel-debs.applieddata.net/debian/dists/lenny/main/binary-armel/Packages.gz says:

Code:
Package: dhcp3-server
Priority: optional
Section: net
Installed-Size: 724
Maintainer: Andrew Pollock <[email protected]>
Architecture: armel
Source: dhcp3
Version: 3.1.1-5
Depends: debianutils (>= 2.8.2), dhcp3-common (= 3.1.1-5), lsb-base, libc6 (>= 2.7-1), debconf (>= 0.5) | debconf-2.0
Suggests: dhcp3-server-ldap
Conflicts: dhcp
Filename: pool/main/d/dhcp3/dhcp3-server_3.1.1-5_armel.deb
Size: 338070
Somebody who can set up the proper build environment and sort out the dependencies could theoretically statically build dhcp3-server.
11th November 2008, 07:43 AM |#21  
JesusFreke's Avatar
Inactive Recognized Developer
Flag Dallas
Thanks Meter: 52
 
More
Awesome! Thanks for the link
Post Reply Subscribe to Thread

Tags
ad-hoc, tether

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes