Set up a wireless USB adapter with a hostname.if(5) file

OpenBSD 5.3 detected a NETGEAR USB wireless adapter and labeled the interface urtw0. I created a /etc/hostname.urtw0 file:

nwid <ssid>
wpakey '<wpa>'
dhcp

After a reboot, I could visit web pages.

You can use vi to create the text file:

  • vi <file> to create the file
  • i to enter insert mode and begin typing
  • ESC to exit insert mode
  • :wq to “write and quit,” to save the file