Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to establish a adhoc connection between my laptop running debian wheezy with my android nexus 7 tablet. What I have done is installed hostapd in my laptop with this configuration.


Now I can see the access point listed in my android wifi settings. I gave static IP in my nexus 7 settings and gave connect and it got connected. The settings I gave in nexus 7 is

IP :
Network prefix length: 24

Now how could I communicate with my laptop? I need to give IP to my laptop also? Which settings should I use?

My ifconfig gives

**mon.wlan0 Link encap:UNSPEC  HWaddr D0-DF-9A-EC-E6-09-3A-30-00-00-00-00-00-00-00-00  
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)**

wlan0     Link encap:Ethernet  HWaddr d0:df:9a:ec:e6:09  
          inet addr:  Bcast:  Mask:
          inet6 addr: fe80::d2df:9aff:feec:e609/64 Scope:Link
          RX packets:95004 errors:0 dropped:0 overruns:0 frame:0
          TX packets:78421 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:57369956 (54.7 MiB)  TX bytes:10218977 (9.7 MiB)
share|improve this question
up vote 1 down vote accepted

You are apparently trying to do simultaneously two things which may be outright incompatible, or may be possible only after some work.

Your wlan0 card has a private IP assigned to it, which indicates you are using it to connect to a wifi network. At the same time, you have hostapd on it, which puts the Virtual Interface (vif) mon-wlan0 (on your physical device phy0) in station mode. Is it correct?

What would you like to do? You have two options:

1) configure everything so that your phone has access to the pc, while neither the pc nor the phone have Internet access:

2) viceversa, configure your pc so that both the phone and the pc have Internet access thru the same wifi card.

The first thing is easy to arrange.

sudo service network-manager stop
sudo sysctl -w net.ipv4.ip_forward=1
sudo ifconfig wlan0 up

and you are good to go.

The second thing (i.e. with the same wifi card, connect to an existing wireless network and simultaneously provide a wifi ccess point to other components), may perhaps be arranged. Basically, it depends on the properties of your wifi card. If this is what you wish to accomplish, you will have to post the output of

sudo iw list


EDIT: on second thought, it is possible that your ifi card does not allow the use of hostapd in any case. So could you pls post the output of the last command?

share|improve this answer

You need to be on the same network, but you have two : 10.0.3.x and 192.168.1.x.

Change one of them to agree with the other.

share|improve this answer

It seems you have not defined the ipaddress on Nexus correctly. Use Ipaddress like or something else in range, with gateway

Ideally you should use a dhcp server to allocate Ip address to the clients though. Correct way to do this setup will be,

  1. Configure /etc/network/interfaces to define ip address settings for wlan0
  2. Configuring a dhcp server like (udhcpd or isc-dhcp-server) to allocate IP adddress to the devices which connects.

Also, assuming you will want to share internet connection of your laptop with the devices which are connecting, you should also enable packet forwarding. To enable packet forwarding uncomment the following line on /etc/sysctl.conf

# Uncomment the next line to enable packet forwarding for IPv4 net.ipv4.ip_forward=1

and allow traffic though iptables

$ sudo iptables -A POSTROUTING -t nat -o eth0 -j MASQUERADE

Complete instructions can be found here

share|improve this answer

You must log in to answer this question.

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