HowToSetUpIpw2200
"Index"
Preamble
This document is written by a DragonFlyBSD newbie for other newbies, so there may be a better way to setup the ipw2200 wlan adapter. It was tested on a Asus V6800 notebook, but hopefully it should apply to all notebooks with ipw2200 adapters. WPA encryption is not available now (April 2006), and I wasn't unable to get my wlan adapter to establish a WEP connection, so I have only an unprotected WIFI connection, but that may be a problem with my notebook or my router.
Prerequisites
You need two things to setup your ipw2200 adapter:
the if_iwi kernel modules for DragonFlyBSD
the firmware for your ipw2200 wlan adapter
Loading the if_iwi kernel module
If you've done a fresh install of DragonFlyBSD, the kernel module should already be "ready to use". This is how you can load it:
# kldload if_iwi
If you don't get an error message, the necessary module is loaded now. If you get this message:
kldload: can't load if_iwi: File exists
this is ok, too. It means, that the module has already been loaded for you. BTW: you can check, if it's already loaded with this command:
# kldstat | grep if_iwi
This should return something similar to this, if the module is loaded:
6 1 0xc0759000 c2c8 if_iwi.ko
If you don't have the kernel module available, you must build a new kernel. You can find the necessary information to do that in the ["DragonFlyBSD Handbook, chapter 9"](http://leaf.dragonflybsd.org/~justin/handbook/kernelconfig.htm) : (http://leaf.dragonflybsd.org/~justin/handbook/kernelconfig.html) .
Later, you can automate loading of the kernel driver by using the /boot/loader.conf file.
# Getting the firmware
If you've already set up the pkgsrc system on your machine, you can install it by
# cd /usr/pkgsrc/sysutils/iwi-firmware
# make install clean
and continue reading at the next section ("Loading the firmware").
Otherwise, you can "download it from" (http://damien.bergamini.free.fr/iwifw/ipw2200-fw-2.3.tgz) and extract to a new directory, e. g. /usr/libdata/iwi_firmware:
# mkdir /tmp/firmware
# cd /tmp/firmware
# fetch http://damien.bergamini.free.fr/iwifw/ipw2200-fw-2.3.tgz
# tar xvfz ipw2200-fw-2.3.tgz
# mkdir /usr/libdata/if_iwi
# mv *fw /usr/libdata/if_iwi
# cd ..
# rm -fd firmware
Unfortunately, you must rename the files:
# cd /usr/libdata/if_iwi
# mv ipw-2.3-ibss_ucode.fw iwi-ucode-ibss.fw
# mv ipw-2.3-sniffer.fw iwi-sniffer.fw
# mv ipw-2.3-boot.fw iwi-boot.fw
# mv ipw-2.3-bss.fw iwi-bss.fw
# mv ipw-2.3-sniffer_ucode.fw iwi-ucode-sniffer.fw
# mv ipw-2.3-bss_ucode.fw iwi-ucode-bss.fw
# mv ipw-2.3-ibss.fw iwi-ibss.fw
Loading the firmware
Now, you can load the firmware:
# iwicontrol iwi0 -d /usr/libdata/if_iwi
Configuring the WLAN interface
Now, you can configure your ipw2200 adapter.
First example: without WPA and WEP
# ifconfig iwi0 inet <ip-address> netmask <netmask> ssid <myssid> wepmode off
Second example: with WEP
# ifconfig iwi0 inet <ip-address> netmask <netmask> ssid <myssid> wepmode on wepkey <mywepkey>
(example for a 104/128 bit wepkey hex value: 0xf6fa1c61abc3ca5a3787fdaeae)
Check your success (example):
# ifconfig iwi0
iwi0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
inet 192.168.2.101 netmask 0xffffff00 broadcast 192.168.2.255
inet6 fe80::212:f0ff:fe07:f5c8%iwi0 prefixlen 64 scopeid 0x3
ether 00:12:f0:07:f5:c8
media: IEEE 802.11 Wireless Ethernet autoselect (OFDM/54Mbps)
status: associated
ssid catalan 1:catalan
channel 6 authmode OPEN powersavemode OFF powersavesleep 100
rtsthreshold 2312 protmode CTS txpower 100
wepmode OFF weptxkey 1
We have the IP-address 192.168.2.101 with netmask 255.255.255.0 (0xffffff00), and are connected ("associated") to an access point with the name "catalan". We don't use WEP (wepmode OFF) here.
As said at the beginning, I wasn't able to connect to my router/AP with WEP enabled, but it should work (tm). I was only able to make a connection with enabled SSID broadcast, but may be you'll have more luck
DragonFlyBSD Host Access Points
DragonFlyBSD can act as an Access Point (AP) which eliminates the need to buy a hardware AP or run an ad-hoc network. This can be particularly useful when your DragonFlyBSD machine is acting as a gateway to another network (e.g., the Internet).
Before configuring your DragonFlyBSD machine as an AP, the kernel must be configured with the appropriate wireless networking support for your wireless card. You also have to add the support for the security protocols you intend to use.
# kldload /boot/kernel/wlan_xauth.ko
to add wpa security protocols
Once the wireless networking support is loaded, you can check if your wireless device supports the host-based access point mode (also know as hostap mode):
# ifconfig wlan0 create wlandev ath0
# ifconfig wlan0 list caps
drivercaps=6f85edc1<STA,FF,TURBOP,IBSS,HOSTAP,AHDEMO,TXPMGT,SHSLOT,
SHPREAMBLE,MONITOR,MBSS,WPA1,WPA2,BURST,WME,WDS,BGSCAN,TXFRAG>
cryptocaps=1f<WEP,TKIP,AES,AES_CCM,TKIPMIC>
This output displays the card capabilities; the HOSTAP word confirms this wireless card can act as an Access Point. Various supported ciphers are also mentioned: WEP, TKIP, AES, etc., these informations are important to know what security protocols could be set on the Access Point.
The wireless device can only be put into hostap mode during the creation of the network pseudo-device, so a previously created device must be destroyed first:
# ifconfig wlan0 destroy
then regenerated with the correct option before setting the other parameters:
# ifconfig wlan0 create wlandev ath0 wlanmode hostap
# ifconfig wlan0 inet 192.168.0.1 netmask 255.255.255.0 ssid dfbsdap mode 11g channel 1
Use again ifconfig to see the status of the wlan0 interface:
# ifconfig wlan0
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
ether 00:11:95:c3:0d:ac
inet 192.168.0.1 netmask 0xffffff00 broadcast 192.168.0.255
media: IEEE 802.11 Wireless Ethernet autoselect mode 11g <hostap>
status: running
ssid dfbsdap channel 1 (2412 MHz 11g) bssid 00:11:f5:64:16:62
regdomain 100 indoor ecm authmode OPEN privacy OFF txpower 19
scanvalid 60 protmode CTS wme burst dtimperiod 1 -dfs
The hostap parameter indicates the interface is running in the host-based access point mode.
Now you need to configure hostapd and become gateway:
# sysctl net.inet.ip.forwarding=1
set a NAT, if you use PF the sample of Book of PF explains how to.
with a dhclient deamon and the game is done.