I have a Vizio tablet (running a modified version of Android 2.3.2) which, for some reason or another, refuses to list Windows ad-hoc WiFi connections on it's WiFi connection screen. It can connect to WiFi networks served from a normal router, but the wireless bit of my home router is broken, so I'd like to share the internet connection through my laptop's WiFi card until the new router arrives.

Is it possible to create an ad-hoc network in Ubuntu that looks like a normal wireless network to my tablet?

  • Is your laptop connected to internet via a wired connection ? – Manula Waidyanatha Mar 29 '12 at 6:31
  • Indeed; the laptop is connected via ethernet. – James Mar 29 '12 at 16:44

I think your laptop is connected to internet via a wired connection. So what you have to do is forward packets from wireless card to Ethernet card (or whatever you have) in the laptop. In order to do that, [wlan0 - wireless card; eth0 - ethernet card]

  1. Create an ad-hoc network and give it an ip address by ifconfig wlan0
  2. Enable ip_forward by echo 1 > /proc/sys/net/ipv4/ip_forward
  3. Enable forwarding in IPTABLES by iptables -A FORWARD --in-interface wlan0 -j ACCEPT
  4. Enable NAT mode to connect to internet by iptables --table nat -A POSTROUTING --out-interface eth0 -j MASQUERADE
  5. Then give your Tablet an ipaddress and set gateway address to your laptops wireless address(
  • I followed instructions 1-4, but there's no way to manually set the tablet's IP address in it's UI as far as I can find, and the wifi connection doesn't appear in the list of networks it sees. – James Mar 30 '12 at 13:12
  • 1
    you need a DHCP server then – franzlorenzon Jan 28 '13 at 10:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.