Madwifi_Wireless_Access_Point
Contents |
Installation
- I have tested this with vanilla-sources 2.6.25.9 so this should work with 2.6.25.9 or later.
emerge vanilla-sources (make sure /usr/src/linux links to whatever kernel you are using) and configure it as follows...
| File: /usr/src/linux/.config/ |
#CONFIG_MODVERSIONS is not set CONFIG_MODULES=y CONFIG_MODULE_UNLOAD=y CONFIG_KMOD=y CONFIG_NETDEVICES=y CONFIG_WIRELESS_EXT=y CONFIG_WLAN_80211=y CONFIG_SYSCTL=y CONFIG_CRYPTO=y CONFIG_CRYPTO_HMAC=y CONFIG_CRYPTO_AES=y CONFIG_BRIDGE=y (optional) |
- emerge madwifi-ng and madwifi-ng -tools. (These are the drivers for your Atheros based card, you need to re-emerge madwifi-ng if you update your kernel)
- emerge hostapd (Allows you to run a WAP)
- emerge dhcp
- emerge bind and make sure it is listening on 192.168.0.1 and 192.168.1.1
- emerge bridge-utils (optional: if you want to do Ethernet bridging)
Ethernet Setup
This article assumes you have eth0 connecting to the Internet, eth1 is a wired subnet and ath0 is a wireless subnet. See image above.
- cd /etc/init.d
- cp net.eth0 net.eth1
- cp net.eth0 net.ath0
- cp net.eth0 net.br0 (optional)
- modprobe ath_pci
- update-modules
- nano /etc/modprobe.d/ath_pci and enter:
options ath_pci autocreate=ap
- nano /etc/conf.d/local.stop and enter:
ifconfig ath0 down wlanconfig ath0 destroy wlanconfig ath0 create wlandev wifi0 wlanmode ap
There are two possible configurations that can occur here depending whether or not you want to do Ethernet bridging. Ethernet bridging allows you to combine your wired subnet and wireless subnet together into one subnet so you can copy files, stream video or music between a wired and wireless system and see all your computers in "My Network Place".
Without Ethernet Bridging
| File: /etc/conf.d/net (baselayout 1.x) |
config_eth0=( "Enter your information here" ) (See /etc/conf.d/net.example) config_eth1=( "192.168.0.1 netmask 255.255.255.0 broadcast 192.168.0.255" ) config_ath0=( "192.168.1.1 netmask 255.255.255.0 broadcast 192.168.1.255" ) mode_ath0="Master" essid_ath0="MyNetwork" |
| File: /etc/conf.d/net (baselayout 2.x) |
config_eth0="Enter your information here" (See /etc/conf.d/net.example) config_eth1="192.168.0.1 netmask 255.255.255.0 broadcast 192.168.0.255" config_ath0="192.168.1.1 netmask 255.255.255.0 broadcast 192.168.1.255" mode_ath0="Master" essid_ath0="MyNetwork" |
| File: /etc/conf.d/dhcpd |
DHCPD_IFACE="eth1 ath0" |
| File: /etc/dhcp/dhcpd.conf |
ddns-update-style none;
authoritative;
subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.75 192.168.0.100;
option domain-name-servers 192.168.0.1; (Make sure BIND is listening on this IP)
option domain-name "hostname.domain.tld";
option routers 192.168.0.1;
option broadcast-address 192.168.0.255;
default-lease-time 10000;
max-lease-time 20000;
}
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.75 192.168.1.100;
option domain-name-servers 192.168.1.1; (Make sure BIND is listening on this IP)
option domain-name "hostname.domainn.tld";
option routers 192.168.1.1;
option broadcast-address 192.168.1.255;
default-lease-time 10000;
max-lease-time 20000;
}
|
With Ethernet Bridging
| File: /etc/conf.d/net (baselayout 1.x) |
config_eth0=( "Enter your information here" ) (See /etc/conf.d/net.example) config_eth1=( "null" ) config_ath0=( "null" ) bridge_br0=( "eth1" "ath0" ) config_br0=( "192.168.0.1 netmask 255.255.255.0 broadcast 192.168.0.255" ) channel_ath0="1" mode_ath0="Master" essid_ath0="MyNetwork" |
| File: /etc/conf.d/net (baselayout 2.x) |
config_eth0="Enter your information here" (See /etc/conf.d/net.example) config_eth1="null" config_ath0="null" bridge_br0="eth1 ath0" config_br0="192.168.0.1 netmask 255.255.255.0 broadcast 192.168.0.255" channel_ath0="1" mode_ath0="Master" essid_ath0="MyNetwork" |
| File: /etc/conf.d/dhcpd |
DHCPD_IFACE="br0" |
| File: /etc/dhcp/dhcpd.conf |
ddns-update-style none;
authoritative;
subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.75 192.168.0.100;
option domain-name-servers 192.168.0.1; (Make sure BIND is listening on this IP)
option domain-name "hostname.domain.tld";
option routers 192.168.0.1;
option broadcast-address 192.168.0.255;
default-lease-time 10000;
max-lease-time 20000;
}
|
Configuration of Hostapd
I will make this simple, here is a configuration that just works for hostapd-0.4.9 and hostapd-0.5.10 (well it did for me anyways)
| File: /etc/hostapd/hostapd.conf |
interface=ath0 #bridge=br0 (optional, if you want bridging remove the #) driver=madwifi logger_syslog=-1 logger_syslog_level=2 logger_stdout=-1 logger_stdout_level=1 debug=0 dump_file=/tmp/hostapd.dump ctrl_interface=/var/run/hostapd ctrl_interface_group=0 ssid=MyNetwork macaddr_acl=0 accept_mac_file=/etc/hostapd/hostapd.accept deny_mac_file=/etc/hostapd/hostapd.deny auth_algs=1 wpa=1 wpa_passphrase=Enter your Passphrase wpa_key_mgmt=WPA-PSK wpa_pairwise=TKIP CCMP |
| File: /etc/conf.d/hostapd |
INTERFACES="ath0" |
Finalize
Configure your startup scripts
rc-update add net.eth0 default rc-update add net.eth1 default rc-update add net.ath0 default rc-update add net.br0 default (optional) rc-update add hostapd default
Here are some iptable rules you might use when doing Ethernet bridging
iptables -A INPUT -i br0 -p all -j ACCEPT iptables -A FORWARD -i br0 -p all -j ACCEPT
That's it. Just reboot and you should be all set.
Browse categories > Gentoo Linux Wiki > Wiki maintenance > Articles to be merged
Browse categories > Hardware > Manufacturer > Atheros
Browse categories > Hardware > Wireless
Created by NickStallman.net, Luxury Homes Australia
Real estate agents should be using interactive floor plans and real estate agent tools.
