ifconfig <interface> nwid <network name> wpakey <password>
Here's an example
# ifconfig urtwn0 nwid mynetwork wpakey mypassword
after entering the above information, then we need to connect the interface using the command line
# ifconfig urtwn0 inet autoconf
That's it! You're now connected to your wireless network.
To connect automatically when you boot your computer, we create the file /etc/hostname.urtwn0 for example if your interface name is called urtwn0 with the following contents
nwid mynetwork wpakey mypassword dhcp
Now next time you boot your computer, you'll be automatically connected to your wireless network. If you need to restart your network, use the following.
# sh /etc/netstart
That's it for this tutorial on setting up wireless networking on OpenBSD. Tough wasn't it!