Can I set up an EeePc as a WLAN Access Point?
I'd like to let an EeePC share files via WLAN. This is completely off the Internet or any other, i.e. the eee is the master of its own little local (and isolated) WLAN.
I tried switching it into "Master" mode using iwconfig but it refuses "Master" mode. Is that a limitation of the Broadcom chip set or am I doing something else wrong?
The system currently on the box is EasyPeasy, a portable/tiny Ubuntu.
I'm a n00b at this, so I'd appreciate any help. If I'm not giving enough information, please ask and I'll provide it!
Solution 1:
I chewed my way through this using various pages on the 'net. Here's what I did:
Platform
- Device: Asus eee PC 900A.
- Operating system: Debian Squeeze. ** Source: Downloaded from the Debian netinst page, specifically the i386 image for Squeeze.
Configuration
Lots of useful info here.
Software
Initial installation on auto-install. The following tasks selected in tasksel
:
- Graphical desktop environment
- Web server
- DNS server
- SSH server
- Laptop
More changes:
- Installed
hostapd
x* Installedisc-dhcp-server
And a few not-so-necessary ones:
- For convenience and pretty colors, installed
vim
. - Added
contrib
andnon-free
todebian
andsqueeze/updates
in/etc/apt/sources.list
- For convenience and pretty colors, installed
vim
. - Added
contrib
andnon-free
todebian
andsqueeze/updates
in/etc/apt/sources.list
DNS (bind)
/etc/resolv.conf
:
1 domain molly.net
2 search molly.net
3 nameserver 127.0.0.1
Modify /etc/bind/named.conf.local
to include forward and reverse declarations for host "molly":
1 //
2 // Do any local configuration here
3 //
4
5 // Consider adding the 1918 zones here, if they are not used in your
6 // organization
7 //include "/etc/bind/zones.rfc1918";
8
9 // Remember: The zone files are in /var/cache/bind!
10
11 zone "molly.net" {
12 type master;
13 file "db.molly";
14 };
15
16 zone "172.16.in-addr.arpa" IN {
17 type master;
18 file "172.16.rev";
19 };
Create file /var/cache/bind/db.molly
:
1 $TTL 86400
2 @ IN SOA dns.molly.net. root.molly.net (
3 10 ; Serial
4 604800 ; Refresh
5 86400 ; Retry
6 2419200 ; Expire
7 604800 ) ; Default TTL
8
9 IN NS dns.molly.net.
10
11 dns IN A 172.16.0.1
12 lan IN A 172.16.0.1
13 wlan IN A 172.16.16.1
14
15 server IN CNAME lan
16 www IN CNAME lan
Create file /var/cache/bind/172.16.rev
:
1 $TTL 86400
2 @ IN SOA dns.molly.net. root.molly.net. (
3 10 ; Serial
4 604800 ; Refresh
5 86400 ; Retry
6 2419200 ; Expire
7 604800 ) ; Default TTL
8
9 IN NS dns.molly.net.
10
11 0.1 IN PTR lan.molly.net.
12 16.1 IN PTR wlan.molly.net.
Access point
It turns out that iwconfig manages to set mode master
for most cards, but not the atheos with the ath5k
driver. hostapd
on top of wl80211
manages, though. So you really, really need hostapd.
Much of the online documentation mentions madwifi
. But debian has removed madwifi from the distributions, and hostapd is now the way to go.
-
In file
/etc/init.d/hostapd
, modified this line to point to the conf file:DAEMON_CONF=/etc/hostapd/hostapd.conf
Put the following code in
/etc/hostapd/hostapd.conf
:
1 interface=wlan0 2 # bridge=br0 3 driver=nl80211 4 ssid=Molly 5 channel=1 6 wpa=2 7 wpa_passphrase=How now brown cow? 8 wpa_key_mgmt=WPA-PSK 9 wpa_pairwise=TKIP 10 rsn_pairwise=CCMP 11 macaddr_acl=0 12 auth_algs=1 13 ignore_broadcast_ssid=0 14 logger_syslog=-1 15 logger_syslog_level=2 16 logger_stdout=-1 17 logger_stdout_level=1 18 debug=0 19 dump_file=/tmp/hostapd.dump 20 ctrl_interface=/var/run/hostapd 21 ctrl_interface_group=0 22 auth_algs=1
Extensive documentation on the hostapd configuration file.
DHCP
Some configuration for dhcpd
in /etc/default/dhcp
:
# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
# Separate multiple interfaces with spaces, e.g. "eth0 eth1".
INTERFACES="wlan0"
Edit /etc/dhcp/dhcpd.conf
:
1 # The ddns-updates-style parameter controls whether or not the server will
2 # attempt to do a DNS update when a lease is confirmed. We default to the
3 # behavior of the version 2 packages ('none', since DHCP v2 didn't
4 # have support for DDNS.)
5 ddns-update-style none;
6
7 # option definitions common to all supported networks...
8 option domain-name "molly.net";
9 option domain-name-servers dns.molly.net;
10 default-lease-time 600;
11 max-lease-time 7200;
12
13 # Use this to send dhcp log messages to a different log file (you also
14 # have to hack syslog.conf to complete the redirection).
15 #log-facility local7;
16
17 # The LAN network
18
19 subnet 172.16.0.0 netmask 255.255.255.0 {
20 interface eth0;
21 authoritative;
22 range 172.16.0.5 172.16.0.62;
23 option routers lan.molly.net;
24 option broadcast-address 172.16.0.63;
25 }
26
27 # The WLAN network
28
29 subnet 172.16.16.0 netmask 255.255.255.0 {
30 interface wlan0;
31 authoritative;
32 range 172.16.16.5 172.16.16.62;
33 option routers wlan.molly.net;
34 option broadcast-address 172.16.16.63;
35 }
36
37 host lan.molly.net {
38 hardware ethernet 00:23:54:46:61:06;
39 fixed-address 172.16.0.1;
40 }
41
42 host wlan.molly.net {
43 hardware ethernet 00:22:43:37:b1:18;
44 fixed-address 172.16.16.1;
45 }