Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I know I can use ifconfig to configure my ethernet network interfaces. But can I also configure my wireless network interfaces using ifconfig. (It seems to be listed as eth1 in ifconfig output, why is that ?) Specifically :

  1. How do I check from command line if my wireless is enabled
  2. How do I enable / disable the wireless using commandline
  3. Out of a few available wireless networks how do I chose one and connect to it
  4. How do I configure the parameters (like username, password, security settings and certificate information) from the command line
  5. Sometimes an available wireless network is not visible for some reason. In such a case, I select "Connect to hidden wireless network" and type the name of the connection. How do I do the same from my terminal
  6. I recently installed xmonad, I'd like to know how to start the graphical network manager from command line
  7. How do I change my system-wide proxy settings from command line ?

(I am using Ubuntu natty.)

share|improve this question
If you want pure CLI you'll need to stop network-manager; then you'll need iwconfig to manage wireless settings. And ifconfig to configure your interface IP settings (or dhcpclient if there is a dhcpd around). Also you should look at the wpa_supplicant command for WPA stuff if you need to. – hmontoliu Sep 27 '11 at 18:59
up vote 5 down vote accepted

Since version 0.8.1, Network Manager comes with a command line tool, nmcli. Its capabilities in older versions are very limited; for the most part, you can use it to view available connections and switch between them but not configure new ones. Since version 0.9.6, nmcli can create new connections.

There are other, third-party command-line interfaces to Network Manager. Cnetworkmanager has more features than nmcli; in particular, it allows defining connections and specifying wifi encryption keys.

An alternative to Network Manager is Wicd, which provides both an X interface and a console interface.

If you want to do things “by hand”, the main tools you'll need to know are:

  • ifconfig for general information and activation of network interfaces.
  • iwconfig for settings that are specific to wifi interfaces, in particular the ESSID (network name) and WEP keys.
  • iwlist to get information about possible settings for a wireless interface (in particular iwlist scan to show available networks). A hidden network is one that won't show up on iwlist scan but still works when selected with iwconfig.
  • Wpa_supplicant to configure WPA-protected networks.

Some of your questions are completely unrelated to wifi configuration, so I'm not going to answer them here. Please don't ask unrelated questions in the same post.

share|improve this answer
isn't ifconfig deprecated in favour of iproute2? – jasonwryan Sep 27 '11 at 23:04
@jasonwryan No, why should it be? ifconfig is a small tool for a dedicated purpose. ip is a Swiss army knife. They don't play in the same category. The author of ip does consider ifconfig and friends to be “legacy”, but the rest of the world seems fairly attached to this legacy. – Gilles Sep 27 '11 at 23:21
Arch went that way, also Debian: "our plans are to replace net-tools completely with iproute, maybe leading the route for other distributions to follow." lists.debian.org/debian-devel/2009/03/msg00780.html I figured it was inevitable... – jasonwryan Sep 27 '11 at 23:29
@jasonwryan Considering that ifconfig (and route and netstat) “have a very long history, and are extremely well known by many sysadmins, and used in many, many shell scripts”, including many Debian package maintenance scripts, it'll take a very long time to get anywhere close to deprecating them. – Gilles Sep 27 '11 at 23:38
...so, that's a "yes" but not in my lifetime? :) – jasonwryan Sep 28 '11 at 0:08

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.