| Tutorial details | |
|---|---|
| Difficulty | Intermediate (rss) |
| Root privileges | Yes |
| Requirements | OpenBSD with run driver |
This usb wireless adapter works out of box under OpenBSD and Linux operating systems. Under OpenBSD you need to use run driver. From the man page:
The run driver can be configured to use Wired Equivalent Privacy (WEP) or Wi-Fi Protected Access (WPA-PSK and WPA2-PSK). WPA is the de facto encryption standard for wireless networks. It is strongly recommended that WEP not be used as the sole mechanism to secure wireless communication, due to serious weaknesses in it. The run driver offloads both encryption and decryption of data frames to the hardware for the WEP40, WEP104, TKIP(+MIC) and CCMP ciphers.
Step #1: Make sure device is detected by OpenBSD
Type the following command:
# dmesg | egrep -i 'wlan|usb|run'
Sample outputs:
ohci0 at pci0 dev 19 function 0 "Compaq USB OpenHost" rev 0x08: irq 5, version 1.0, legacy support
usb0 at ohci0: USB revision 1.0
uhub0 at usb0 "Compaq OHCI root hub" rev 1.00/1.00 addr 1
run0 at uhub0 port 1 "Ralink 802.11 n WLAN" rev 2.00/0.01 addr 2
run0: MAC/BBP RT2872 (rev 0x0202), RF RT2820 (MIMO 2T2R), address 00:aa:xx:yy:e4:6eYou can use usbdevs comamnd to see USB devices connected to the system:
# usbdevs
Sample outputs:
addr 1: OHCI root hub, Compaq
addr 2: 802.11 n WLAN, RalinkYou can also use the ifconfig command:
# ifconfig run0
Step #2: Connect to the wireless router
Type the following command:
ifconfig run0 nwid {YOUR-SSID-NETWORK} wpa wpakey {YOUR-PASSHPRASE}
In this example, connect the nixcraft network ID (ESSID) with wpa security password (passphrase) called foobar:
ifconfig run0 nwid nixcraft wpa wpakey foobar
Finally, use the dhclient utility to configuring network interfaces using DHCP to get an IP address from the wireless router / access point:
# dhclient run0
Sample outputs:
DHCPREQUEST on run0 to 255.255.255.255 port 67
DHCPACK from 192.168.1.254 (74:ad:01:xx:yy:zz)
bound to 192.168.1.116 -- renewal in 43200 seconds.
Verify your connectivity:
# ping google.com
# ping cyberciti.biz
# netstat -nr
# cat /etc/resolv.conf
You can use ifconfig command to scan wireless network:
# ifconfig run0 scan
Sample outputs:
run0: flags=8843mtu 1500 lladdr 00:1d:xx:yy:zz:dd priority: 4 groups: wlan egress media: IEEE802.11 autoselect (OFDM54 mode 11g) status: active ieee80211: nwid nixcraft chan 1 bssid 74:44:xx:yy:zz:dd 50dB wpakey 0x20c356ae19610381977a7d0d9ebd9ee279 wpaprotos wpa1,wpa2 wpaakms psk wpaciphers tkip,ccmp wpagroupcipher tkip nwid dd-wrt chan 6 bssid 00:0f:xx:yy:zz:dd 54dB 54M privacy,short_slottime nwid asusap chan 6 bssid 00:24:xx:yy:zz:dd 56dB 54M privacy,short_preamble,short_slottime nwid testloop chan 1 bssid 74:44:xx:yy:zz:dd 50dB 54M privacy,short_slottime nwid seema chan 6 bssid 80:a1:xx:yy:zz:dd 64dB 54M privacy,short_slottime nwid bbcafe chan 6 bssid 80:a1:xx:yy:zz:dd 64dB 54M privacy,short_slottime inet 192.168.1.116 netmask 0xffffff00 broadcast 192.168.1.255
Step #3: Persistent network configuration
Add the following entry to /etc/hostname.run0 file that configures run0 to join nixcraft network available on boot, using WPA key 'SOMEPASSWORD', channel 1, obtaining an IP address using DHCP:
echo 'dhcp nwid nixcraft wpa wpakey SOMEPASSWORD chan 1' > /etc/hostname.run0
Reboot the system to test changes or type the following command to restart networking under OpenBSD:
# ifconfig run0 down
# sh /etc/netstart
Recommend readings
- man pages: run, hostname.if, and ifconfig
- List: Linux Compatible USB Wireless Adapter (WUSB)
You should follow me on twitter here or grab rss feed to keep track of new changes.
Featured Articles:
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012

- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop








![Linux Rename Eth0 Network Interface Card Name [ Udev ]](http://s13.cyberciti.org/images/shared/rp/3/29.jpg)



{ 3 comments… read them below or add one }
Yes but “who” makes it and sells it. Model# please ?
“…”brought a USB 2.0 wireless adapters based on the Ralink RT2700U, RT2800U and RT3000U chipsets…”.
Hi,
and thanks for the howto, but any chance you could be a little more specific in the exact Name/Model… of the item you bought in the store.?
I would very much like to purchase, one of these, since obviously the “Atheros AR9485″ that is presently built-in to my new Laptop can NOT be configured in OpenBSD.
Sadly, bad, bad “Atheros”(lately) will NOT even supply the firmware/docs for *BSD !?. :(
Personallu, I am using “Buffalo WLI-UC-G300N Wireless LAN Adapter” with OpenBSD v5.3.
Pro tip: read the man page of the following to see exact make and models for various USB WLAN devices:
HTH
Thankyou.