So, you have a laptop with wifi and enternet card and you want to make "real" AP from it. There are many ways to do this, but I like this one:
- Install packages required:
apt-get install dnsmasq
- configure /etc/dnsmasq.conf to be DHCP server for your wifi network:
listen-address=192.168.42.1 dhcp-range=192.168.42.42,192.168.42.242,12h
- turn atheros card into master (AP) mode and configure new network 192.168.42.0/24 and setup masquarade:
sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward" sudo wlanconfig ath0 destroy sudo wlanconfig ath0 create wlandev wifi0 wlanmode ap sudo iwconfig ath0 essid free4all sudo ifconfig ath0 192.168.42.1 sudo iwconfig sudo /etc/init.d/dnsmasq restart sudo iptables --flush sudo iptables --table nat --flush sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE sudo iptables -A FORWARD -i eth0 -o ath0 -m state --state RELATED,ESTABLISHED -j ACCEPT sudo iptables -A FORWARD -i ath0 -o eth0 -j ACCEPT
And that's it. You have new 192.168.42.0/24 network on your wifi interface ath0 which is passed to eth0 (which you should configure beforehand using dhclient eth0 or someting similar). Bring wifi to every home in next year ;-)
Instructions here are specific for configuration with atheros wifi card (that's why I'm using wlanconfig to switch card in EeePC into AP mode). For other wifi cards which support AP mode via standard iwconfig the syntax is: iwconfig eth1 mode master. If you get error using this command, you might try with ad-hoc mode instead of "real" AP...

Comments (3)
Very good instruction. Could you tell me how you revert to 'normal mode', i.e. when I am at work, I would like my laptop to become an access point (as you instructed) but back home, I would like to use the wireless as a client to surf the net.
Posted by Benoit
|
March 4, 2009 10:21 AM
Posted on March 4, 2009 10:21
I have this set up and it is being picked up by my Dell machine running Vista but there is no internet on that end. I think the problem is that I have not properly configured eth0. Your last instruction about configuring eth0 with dhclient eht0 is not quite clear to me. Can you explain in detail how I should do this?
Thanks
Ben
Posted by Ben
|
January 25, 2010 4:47 AM
Posted on January 25, 2010 04:47
I'm assuming that your eth0 is already configured, and that's why I'm suggesting dhclient eth0 to pickup all setting from DHCP server.
In short, if you have internet access using wired network on eth0, you can ignore dhclient eth0.
Posted by Dobrica Pavlinušić
|
January 25, 2010 5:30 PM
Posted on January 25, 2010 17:30