|
U N I X C I R C L E
|
|
Greetings... 80.72.64.115 Wget/1.8.2 Logged...
| January 31, 2004 12:25:20 pm |
It is really easy to build a wireless access point using FreeBSD. Here are the following steps:
{Internet}
|
-------------
| Cable/DSL |
| Modem |
-------------
|
----------
| fw/ |
| router |
----------
| 192.168.1.1
---------- <..............>
| Switch | ----- fxp0 . FreeBSD .
---------- .5 . Access Point .
| <..............>
----------- wi0
^ ^ ^ ^ ^
pc1 pc2 pc3 ^^^^ ^^^^
.2 .3 .4 ^ ^
MA101 wi0
.6 .7
<....^.....> <....^.....>
. windows . . openbsd .
. wifi . . wifi .
. client . . client .
<..........> <..........>
- Lucent Hermes, Intersil PRISM-II, Intersil PRISM-2.5, Symbol Spectrum24However, only Intersil PRISM-II and Intersil PRISM-2.5 support hostap (access point mode).
FreeBSD access point:
- Netgear MA311 PCI Adapter (PRISM-2.5 chipset with support for access point mode) - Intel Management Pro/100+Windows wireless client:
- Netgear MA101 USB AdapterOpenBSD wireless client:
- Dlink DWL-520 (Intersil PRISM2.5 Mini-PCI WLAN)
options BRIDGE # Bridge to ethernet world
device miibus # MII bus support
device fxp # Intel Management Pro/100+
device wi # Driver for Lucent Hermes, Intersil PRISM-II,
# PRISM-2.5, and Symbol Spectrum24 chipsets
Create a shell script /usr/local/etc/rc.d/ap.sh with the following configurations:
1. Configure the access point mode and call it my_wifi as the network name (ssid):
# ifconfig wi0 inet up ssid my_wifi media DS/11Mbps mediaopt hostap2. Turn on Wired Equivalent Privacy:
# wicontrol -e 13. Define four 128-bit keys. An easy way to generate four random 26 hex digits long is to use openssl and hexdump: openssl rand 13|hexdump -e '"%02x"'
# wicontrol -k 0x466e4545657e295921b66c1b7d -v 1 # wicontrol -k 0xda6a16264596813fd5cdffc3e3 -v 2 # wicontrol -k 0xbb8d2c379c80eebaa4d20355e7 -v 3 # wicontrol -k 0x2b8f1735302c82c5d20ca2cb5e -v 44. Specify key 1 to be used to encrypt transmitted packets:
# wicontrol -T 15. Choose one of the three non overlapping channels 1,6,11:
# wicontrol -f 66. Define station name FreeBSD_AP:
# wicontrol -s "FreeBSD_AP"7. Bridge wireless to ethernet world:
# sysctl net.link.ether.bridge=1 # sysctl net.link.ether.bridge_cfg="wi0 fxp0" # sysctl net.inet.ip.forwarding=18. Verify that the access point is up and ready to go:
# ifconfig
fxp0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500
inet 192.168.1.30 netmask 0xffffff00 broadcast 192.168.1.255
inet6 fe80::290:27ff:fe74:9530%fxp0 prefixlen 64 scopeid 0x1
ether 00:90:27:74:95:30
media: Ethernet autoselect (100baseTX <full-duplex>)
status: active
wi0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500
inet6 fe80::209:5bff:fe11:c623%wi0 prefixlen 64 scopeid 0x2
ether 00:09:5b:11:c6:23
media: IEEE 802.11 Wireless Ethernet DS/11Mbps <hostap>
status: associated
ssid my_wifi 1:my_wifi
stationname "FreeBSD_AP"
channel 6 authmode OPEN powersavemode OFF powersavesleep 100
wepmode MIXED weptxkey 1
wepkey 1:128-bit wepkey 2:128-bit wepkey 3:128-bit wepkey 4:128-bit
Windows wireless client:
Setup the IP Address as 192.168.1.6 netmask 0xffffff00 and DNS server. Then, configure the wireless settings using the Netgear Utility:
- Configuration tab->Network Name: my_wifi - Security tab->Check `Enable Encryption (Web Key). Key length 128-Bit. Enter key1-4 and select key1 as default - Click OKOpenBSD wireless client:
Create /etc/hostname.wi0 with network name, WEP key and IP address:
/etc/hostname.wi0 !wicontrol \$if -n my_wifi -p 1 -k 0x466e4545657e295921b66c1b7d -e 1 inet 192.168.1.7 255.255.255.0You're now ready to surf the internet using your wireless connection via the broadband cable/dsl modem.
The host-based access point mode on the Intersil PRISM cards has bugs when used with firmware versions prior to 0.8.3 and is completely unusable with firmware versions 0.7.5 and 1.4.0-1.4.2.
Apparently, firmware 1.4.9 and 1.5.6 are known to work reliably.
man wi(4),wicontrol(8)