Official website for Linux User & Developer
FOLLOW US ON:
Jul
31

Wicd tutorial

by Joey Bernard

Wicd is a flexible alternative to NetworkManager, complete with interfaces for GTK, KDE, curses and the command line. Use it to get your wireless network up and running

On most Linux systems, network management – both wired and wireless – is handled by a utility called NetworkManager. It is so ubiquitous that you may not even think about it. But, in Linux, there is always another choice. You can always do network management by manually configuring the appropriate configuration files. A better option is to use the utility wicd. Wicd provides interfaces using either GTK or KDE. This means you can use the one appropriate for the graphic libraries for your desktop. There is also a text-based interface, which uses the curses library. You can even use wicd within your scripts or on the command line with the CLI interface. This tutorial will walk you through most of the interfaces, and how to use them to configure your machine’s networking. This will include some issues, like using unusual setups of WPA security and adding functionality in the guise of network templates.

Part of the properties you can set is the type of encryption being used, along with any special values that are needed, like passphrases
Part of the properties you can set is the type of encryption being used, along with any special values that are needed, like passphrases

Resources

Wicd

Step-by-step

Step 01 Get wicd

Wicd is hosted at both SourceForge and Launchpad – the URLs are provided on the previous page. On both websites you can find information on how to use wicd, as well as source code for the latest version.

Step 02 Installation

Most distributions include a series of packages to install wicd. For example, on Ubuntu each interface is available as a separate package. This means you can install only the portions that you need for your system. As always, you can install from source if you need the latest options.

Step 03 The GTK interface

On most systems, you will likely want
to use the GTK interface. To start it up, you can just type wicd-gtk. If your desktop has a tray, wicd will start up minimised to the tray. You can then click on it to open the main window. You can bypassthetraybyusingwicd-gtk -n.

Step 04 Lists of wireless networks

When you open up wicd, it will try to pull up the wireless networks available to you. Depending on the specifics in your area, it may miss some. You will want to click the refresh button to be sure that you pick up all of the networks available.

Step 05 Preferences

There are general preferences that you can set in wicd. To get to them may not be obvious, depending on the default size of the main window. You may need to click on the arrow on the far right to display the other menu items available. On your advisor’s system, this is where the Preferences option is located.

Step 06 Interfaces

In wicd, you can only configure one interface at a time. You set this in the Interfaces section of the Preferences window in wicd. You can check to see which interfaces are available on your system with the commands ifconfig and iwconfig. Just running these with no options will give you those lists.

Step 07 DNS servers

In the Preferences window, you can set global DNS options. This is useful if you want to use some other DNS server than that provided by your DHCP server. Or, if you are manually configuring the network details, you can set the DNS here.

Step 08 External programs

Selecting the External Programs tab of the Preferences window will allow you to set which external programs to use for various portions of the network configuration steps. It will query your system and only provide the options that are installed on your system. You can then select the specific programs for tasks like DHCP lookup.

Step 09 WPA supplicant program

WPA security is a bit of a bugbear. It is the preferred system to use, since WEP is so badly flawed. But, on Linux, it requires a separate program to handle the handshaking required. Clicking on the Advanced Settings tab in the Preferences window will allow you to select which program to use for WPA security.

Step 10 Back-end processing

Also in the Advanced Settings section is a selection for how to handle all of the back- end tasks to configure your network interfaces. The default (and most stable) is to use external programs, like iwconfig and dhclient. You can also choose to use IOCTL instead. It works faster, but is also more likely to fail.

Step 11 Interface properties

Each available network has its own set of properties. You can pull up the Properties window by clicking on the Properties button. Here you can set options if you are using a static IP address. If you are using encryption, you can select from the list of possible templates at the bottom of the window.

Step 12 Scripts

At the bottom of the window, you also have the option of running scripts. There are options to set scripts to be run just before or just after connection, as well as just before or just after disconnection. This lets you customise connections to your needs.

Step 13 Finding hidden networks

When you set up a Wi-Fi hotspot, you have the option of whether to broadcast the network name or to hide it from casual perusal. They’ll still appear under wicd, labelled with the name . This lets you find and connect to these hidden networks.

Step 14 WPA templates

If the network you are using needs encryption, you can select the specifics from the list of available templates. These templates will change the remaining options in the Properties window and ask you for whatever values you need for that particular type of encryption.

Step 15 Creating your own template

There are a surprising combination of options in encryption. So, wicd allows you to add templates for any combination of properties that wicd doesn’t already support. The template files are stored in the directory /etc/wicd/encryption/templates. You should be able to find one that is already close to what you need. You can make a copy of this template and edit it to match the settings that you need. Once your new template is finished, you can add an extra entry in the file /etc/ wicd/encryption/templates/active. It will then show up when you go to select the encryption template to use for your particular network.

Step 16 Wicd-curses interface

There are several scenarios where you don’t have a graphical interface but still need to set up wireless networking. Setting up Wi-Fi at the console is where wicd really shines. There is a text interface using the curses library that gives you all the same functionality that is available in the GTK version.

Step 17 Connecting to a network

When the curses version starts up, it will show you the full list of available networks. You can use the arrow keys to move up and down the list to select the one you are interested in connecting to. When the correct one is selected, you can connect by pressing Enter.

Step 18 Changing preferences

If the network you are interested in uses encryption, you need to set the template. To access the Properties window, you need to select the network of interest and then press the right-arrow key. You can then set any static elements, and also set the appropriate template.

Step 19 Wicd-cli Interface

In some cases, you may not even have a terminal capable of curses display. For this situation, you have a command-line version of wicd that lets you set up and manage wireless networks with the most basic of text interfaces.

Step 20 Scanning networks

The first step is to scan for available networks. To look for them, you would run the command wicd-cli -wireless -S, or wicd- cli -y -S. This will do a scan, but not show anything. If you want to see the results, you can either add -l to the above command, or subsequentlyrunwicd-cli -y -l.

Step 21 Connecting to a network

To connect to a given network, you would use wicd-cli -y -c -n NETWORKID. Disconnecting is done equivalently with wicd-cli -x -y. Setting options is a bit more involved, where you need to set individual properties with wicd-cli -s VALUE.

Step 22 Listing active connections

You can see the details of your current network connection by using the command wicd-cli -y -d. This includes the name, type of encryption, quality and bitrate, among other items.

Step 23 Where to now?

Now, with wicd, you should have all the tools required to easily configure wireless networking, no matter how basic a console you have. You can even build scripts that can handle the connection details at the proverbial touch of a button.

  • Tell a Friend
  • Follow our Twitter to find out about all the latest Linux news, reviews, previews, interviews, features and a whole more.
    • RJVB

      And so? What are the advantages over the standard tools that could make want to replace the latter by the former? And, how would one do that?

    • Apopas

      Doesn’t it support ethernet? Only WiFi?
      What about VPN?