LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Wireless Networking (http://www.linuxquestions.org/questions/linux-wireless-networking-41/)
-   -   Problems on building own AP (http://www.linuxquestions.org/questions/linux-wireless-networking-41/problems-on-building-own-ap-914167/)

nsp 11-17-2011 11:56 PM

Problems on building own AP
 
My aim is to build a direct wi-fi connection between my iPad and my Linux machine. Thus I can access my Linux through ssh, ftp, http, and samba server. Since I have a Ralink 3090 wi-fi card in my Linux machine, I want to build it a linux wi-fi AP, and let my iPad connect its ssh or other servers. The driver for wi-fi card is mac80211, with a nl80211 lib, and the daemon software is hostapd.

Hostapd seems work well, since iwconfig tells that wlan0 works on a Master mode, and I can see my wi-fi SSID in iPad. But when iPad connected it, it took several minutes to show connection was ready, and iPad got a strange IP. So I didn't know what IP to connect the Linux box with ssh or http.

I did this on Linux box:
Code:

ifconfig wlan0 192.168.2.1 broadcast 192.168.2.255 netmask 255.255.255.0
Then let iPad to connect the AP with a static IP 192.168.2.3 and subnet mask 255.255.255.0. it took several minutes to show the connection was ready, but I could not ssh or browse http 192.168.2.1. I tested with a Windows machine, it instantly showed wi-fi connection was ready, but it couldn't ping 192.168.2.1 too.

I followed some guides and tried DHCPD, with some level of unclearness. Almost the same thing: iPad or Windows machine got an expected IP (in the range of presetted), but couldn't ping 192.168.2.1.

I guess it's not a hostapd problem, but a ip_tables problem or some other settings. I checked this thread:
http://www.linuxquestions.org/linux/...s_Access_Point

But it is somewhat old, so the kernel modules and iptables command are somewhat different, which means I cannot follow it step by step.

I need someone to tell me what my problem looks like to be. iptables? Or?

Thanks a lot! And sorry for my English.

nsp 11-18-2011 04:50 AM

Then I did something like this:
Code:

brctl addbr br0 #This creates the br0 bridge
brctl addif br0 eth0 #This adds the eth0 interface to the br0 ethernet bridge
brctl setfd br0 0 #This sets the forwarding delay to 0 seconds
brctl addif br0 wlan0

and also something like:
Code:

iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
I am not sure what the meaning were, and which commands worked.

And my iPad got a dynamic IP of 192.168.0.107, which is within my upper router's DHCP range! And I can acces the Internet now. But I can't access my own Linux box!

So I think it's a net - subnet problem. Any suggestions?

nsp 11-18-2011 05:18 AM

I think this means my wireless AP is built. But the linux box still needs other functions to let its wireless client to access its servers. What is it? Router? I need suggestions, thanks!

nsp 11-22-2011 03:12 AM

Solved.
http://www.linuxquestions.org/questi...chines-914220/


All times are GMT -5. The time now is 05:56 AM.