Tuesday, September 27, 2011

Adhoc wireless AP for idevice under slackware /Linux

During my recent business trip i encountered a problem connecting the internet with my idevice in hotel room. As in the hotel room they only provide wired Internet connection. The wireless hotspot is only available in the hotel lobby.

Of course, a wired Internet for idevice? It is impossible for now as the idevice has no network port.

It was too bad that I didn't bring along my TPLink USB adaptor. So how to go along with it?

...Via adhoc network... of course!

The idevice's apps work as there are connected to a wireless LAN. viber, skype, ppstv, whatsapp etc. FaceTime not quite working here- bad quality.

Please find the simple workaround to achieve this for slackware/linux as below:

====
# connect to the wired network
dhcpcd -R eth0
# setting up the wireless adaptor
iwconfig wlan0 mode ad-hoc
ifconfig wlan0 192.168.1.1 netmask 255.255.255.0
iwconfig wlan0 channel auto
iwconfig wlan0 essid urssid

# turn on ip forwarding and masquerading.
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -o eth0 -j MASQUERADE
====
You can setup a dhcp server if you want to.

If you don't just setup an IP for your idevice. I.E 192.168.1.2 etc.















No comments:

Post a Comment

Could Not Find What You Want Here? Search Here!