Laptop as a wifi access point
- Category: workstation
- Published: Sunday, 29 January 2012 10:14
- Written by Super User
- Hits: 1422
I know that it is possible to make an access point from a wi-fi card. Now I tried to set it up. Here is a description of my actions step by step.
I have old laptop Acer Aspire 5315.
OS— Kubuntu 11.10
Wi-Fi-card— Atheros. That's what lspci says about it
Ethernet controller: Atheros Communications Inc. AR242x / AR542x Wireless Network Adapter (PCI-Express) (rev 01)
Of course it have ethernet card too.
First attempt — I tried to set up AP using network-manager.
Everything is configured simply ... But there is a drawback - the configured network is not visible. Generally in any way. This method does not suit us.
Second attemp — I tried to set up AP using wicd.
Third attemp — install hostapd and after a little configuring tried to join the network. The second laptop saw the network immediately and connect to it without problems.
Let's install hostapd
$sudo apt-get install hostapd
Create config file /etc/hostapd/hostapd.conf with the next lines:
$sudo ifconfig wlan0 192.168.1.1
$sudo hostapd /etc/hostapd/hostapd.conf
Now we need to build a NAT between wireless and wired networks.
It's very simple.
$sudo iptables -A FORWARD -i wlan0 -j ACCEPT
$sudo iptables -A POSTROUTING -t nat -o eth0 -j MASQUERADE
$sudo echo "1" > /proc/sys/net/ipv4/ip_forward