Friday, September 16, 2011

Setting up DLink DWA-125 (USB 802.11N) on FreeBSD

So, my wife decided that she didn't like the computer and desk where they were (not that I blame her, I actually agreed), and proposed a move into another room of the house. After it was moved (she did it while I was at work one day), I definitely did like the placement better. But what did this mean for me? I either had to: a) Figure out a nice wiring solution as the router that I was previously wired to was in two rooms away, or b) Pick up a wireless card Picking up a wireless card was the obvious choice as it meant less work for me, or so I thought ;) This is more of a reminder for myself in case I have to do this again, but if it helps anyone else out, great. I ended up picking up a USB 11N stick (DWA-125 for those interested). I had forgotten to check whether or not the chipset had FreeBSD ported drivers prior to ripping the box open. Thankfully, there were drivers available. To get it up and running, here are the steps that I took: (Note, I use the run driver because of the DWA-125 chipset)

1) Added this to /etc/rc.conf:

wlans_run0="wlan0"
ifconfig_wlan0="WPA DHCP"

(I have WPA encryption on my router, so the "WPA" entry before "DHCP" is required.)

2) Added to /boot/loader.conf

if_run_load="YES"
runfw_load="YES"

3) Rebooted (you could also just kldload

4) Because I'm running WPA, I had to create /etc/wpa_supplicant.conf and add the following lines:

ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=wheel
network={
ssid="myssid"
psk="mypassword"
}

5) Once this was all done, I ran wpa_supplicant to ensure everything was working properly:

wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf

And finally...

6) Reboot. And once again, I could listen to last.fm. I'll most likely end up compiling these options into the kernel, but this will do for now. Is it a good thing when you feel happy that you've set up and configured a USB network device?

1 comment:

  1. What version of FreeBSD are you running to get run driver? Apart from lack of run driver on 6.2, yours is the only useful comment re DWA-125 on FreeBSD I can find.

    ReplyDelete