Pages

October 14, 2012

Setting up a wireless nework connection via command line

Update: These commands only works for unsecured SSIDs, apparently (and obviously).

Having set up a working wireless connection to the network, it was time to get it connected. I decided to use the command line way to connect to the network.

[usr@host ~]$ su -
Password:
[usr@host ~]# ifconfig <interface> down
[usr@host ~]# dhclient -r <interface>
[usr@host ~]# ifconfig <interface> up
[usr@host ~]# iwconfig <interface> essid "<essid_in_quotes>"
[usr@host ~]# iwconfig <interface> mode Managed
[usr@host ~]# dhclient <interface>

  • <interface> is the network interface to be used by the wireless connection. In most cases, it's wlan0 but in my case it's ra0.
  • <essid_in_quotes> is the WiFi hotspot name. This should be surrounded by quotes (") when invoked in the command line.
  • dhclient is the application for taking care of the assigning of IP addresses to the interface.
Doing a ping -c 10 www.google.com should be able to test if a connection is established.

No comments:

Post a Comment