Wireless FreeBSD

How to configure a dhcp wireless pccard for FreeBSD

These are some indications to configure a wireless pccard (pcmcia) under FreeBSD.

The firest thing you must check your card support under FreeBSD. Most of the wireless pccard are supported, but please do some "gooleling" before in case you have one the exotic net supported card. Official documentation is also availlable here.

Next check you have the following options in your kernel config. The default kernel config file is /sys/i386/conf/GENERIC (for x86 architectures).

# Wireless options
device wlan # 802.11 support
device wlan_wep #802.11 WEP support
device wlan_ccmp #802.11 CCMP support
device wlan_tkip #802.11 TKIP support
device wlan_xauth #802.11 external authenticator support
device wlan_acl #802.11 MAC ACL support

# Wireless NIC cards
device an # Aironet 4500/4800 802.11 wireless NICs.
device awi # BayStack 660 and others
device ral # Ralink Technology RT2500 wireless NICs.
device wi # WaveLAN/Intersil/Symbol 802.11 wireless NICs.
device wl # Older non 802.11 Wavelan wireless NIC.

These are not part of the default kernel config, so if you have never compile your kernel before you must do now. Except if you do not care about security encryption, but are you running FreeBSD? This said, i advice you to have a look at the official FreeBSD documentation for kernel compilation instructions. Here is a shortcut:

% cd /sys/i386/conf/
% vi GENERIC
% ... add the previous lines
% /sbin/config GENERIC
% cd ../../compile/GENERIC
% make cleandepend; make depend
% make ; make install
% reboot

In case of troubles, have a look at the documentation :p Installation done, ready for configuration?

You must know which device to use. To find it, do:

% dmesg | less

This will print kernel boot information. Look for an ethernet device call ’awi’, ’an’, ’ral’, ’wi’ or ’wr’. Mine is /dev/wi0 so in the following i will use ’wi’ or ’wi0’ and you should change these values.

Let’s load the correct module at startup:

% echo ’pccard_load="YES" ’ >> /boot/loader.conf
% echo ’if_wi_load="YES" ’ >> /boot/loader.conf
% echo ’wlan_load="YES" ’ >> /boot/loader.conf
% echo ’wlan_wep_load="YES" ’ >> /boot/loader.conf
% echo ’wlan_ccmp_load="YES" ’ >> /boot/loader.conf
% echo ’wlan_tkip_load="YES" ’ >> /boot/loader.conf

Now let’s launch the DHCP client à startup:

% echo ’pccard_enable="YES" ’ >> /etc/rc.conf
% echo ’dhclient_enable="YES" ’ >> /etc/rc.conf
% echo ’ifconfig_wi0="DHCP" ’ >> /etc/rc.conf

Now let’s do the network config. As we use a 802 protocol, the wireless network has a name (ssid) and eventualy one or severals keys (wepkey for wep encryption). Should know that it doesn’t existe a wireless solution without securuty issues. WEP use a weak encryption algorithm that has been crack for a long time. Therefore you should not consider your wireless netword secure. Here how i configure my wireless adapter, but change the file name according to your adapter:

% echo "ifconfig wi0 inet up" >> /etc/start_if.wi0
% echo "ifconfig wi0 ssid wireless_network_name wepmode on " >> /etc/start_if.wi0
% echo "ifconfig wi0 wepkey <0xabcedf0123>" >> /etc/start_if.wi0
% chmod 771 /etc/start_if.wi0
% dhclient

This is all done... Maybe this work for you, it does to me... Feel free to send me a feedback at ludo***freebots.strangled.net (replace *** with @).

Good luck!


hacker emblem Creative Commons License