2

I am trying to create a adhoc network in which I am going to use one or more android devices to connect to laptop(s). Say laptop A, laptop B, Mobile C, Mobile D. I rooted one of my android device and changed wpa_supplicant to recognize adhoc networks. I followed

auto wlan0
iface wlan0 inet static
address 192.168.1.1
netmask 255.255.255.0
wireless-channel 1
wireless-essid myadhocnetwork
wireless-mode ad-hoc

for both laptops A and B with different Ip (192.168.1.1 and .2) address. Now I would like to add my mobile C to this network. My device detected this network but not able to connect. It says trying to get ip address and fails. I assigned manual ip (192.168.1.3) for my device with same netmask address. Even then it is not able to connect. But when I assign either ip address of either A or B as gateway and DNS1, DNS2, it connects to above network. Only then I am able to ping from C to A and C to B. I didn't understand whats the process does. Can some one please explain is that the right way for adhoc? One interesting thing I observed is assume I set 192.168.1.1 as gateway and DNS1 and DNS2 in mobile. after connecting I disabled the network in Computer A. Even then there is communication between B and C. I am able to ping between them. Can some one please tell me how to connect android to this adhoc network. NOTE: I even tried modifying wpa_supplicant.config in data/misc/etc by adding the network ssid and other parameters Thanks

1 Answer 1

0

I successfully created adhoc network of three devices with following commands. One device is android phone and other two are laptops.

on machine 1 (Android):

ifconfig wlan0 down
iw wlan0 set type ibss
ifconfig wlan0 10.0.0.11 up
iw wlan0 ibss join MY-SSID 2412
iw wlan0 info
iw wlan0 link

on machine 2 (Linux):

ifconfig wlan0 down
iw wlan0 set type ibss
ifconfig wlan0 10.0.0.12 up
iw wlan0 ibss join MY-SSID 2412
iw wlan0 info
iw wlan0 link

On machine 3 (Windows): adhoc network is visible simply join it

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .