United States (change)
Shortcuts: Downloads Fedora Red Hat Network
Issue #3 January 2005
Network management has been a necessary but relatively ignored part of the Linux environment for years. With network connections pervading everyday life, the need for a better way to manage network connections has never been greater. Within this past year, a new application called NetworkManager has been created to fill this need. What is NetworkManager and how did it come into being? Let us go back to the beginning.
Long ago, in the days of yore, the Internet was born. A computer could access this Internet by attaching itself to it with a cable. Once this cable was connected, the parameters were set once and forgotten. It barely mattered if the set-up was difficult; a favor from a more technically-savvy friend and you were good to go. There was no need for maintenance as the connection would continue working in the background indefinitely.
Then everyone got laptop computers. Every time someone with a laptop computer wanted to access the Internet, they would have to plug a wire into their network card. These mobile devices would have to be stationary for as long as the Internet access was needed. Access was usually limited to one's home and/or workplace, which meant set-up was only twice as complicated as a desktop computer. That technically-savvy friend might have grumbled a bit, but was still willing to show off the required expertise.
But lately, the boom of wireless networking has meant a proliferation of Internet access points everywhere, from local coffee shops to laundromats, from (if you live in the right location) city parks to public libraries, from train cars to airports. And each time a laptop computer needs to access a new wireless point, configurations would have to be done anew. Bringing your technically-savvy friend with you everywhere became infeasible. An easy and intuitive way to set up network connectivity suddenly became more important.
The desktop team at Red Hat realized the current interface in Linux networking is unacceptable. They wanted to create a new application that is simple to use. However, simplicity is a concept that is easier to understand than to define. With this in mind, they came up with some guidelines for their new application. They believe that a network tool should:
Another important feature planned from the start of NetworkManager is its ability to function with any Linux distribution. Among the distributions which already offer NetworkManager packages are Fedora, Gentoo, Debian, and Slackware. As NetworkManager was designed with portability in mind, packaging for other distributions should be relatively painless. With such broad distribution support, application developers are able to utilize the features of NetworkManager with the knowledge that their efforts reap widespread rewards.
Although I know a few people who already run NetworkManager as a standard part of their desktop, it is not currently ready for widespread use as NetworkManager is still a work in progress. The hope is that with enough work, NetworkManager will be the network tool of choice for people with mobile computers. In the interim, those that are lucky enough to have supported hardware can use it while others have to wait until appropriate drivers are implemented.
Another drawback of NetworkManager is that it cannot implement all command line possibilities. For most hardware configurations, this lack does not matter as it does not affect its ability to connect to the Internet. However, for those configurations that require various tricks and obscure incantations to get working, NetworkManager most likely will not work.
Now that we know where NetworkManager came from, it is time to get it running on your system.
NetworkManager packages are available for some Linux distributions. For Fedora, enter the following at a command prompt:
yum install NetworkManager NetworkManager-gnome
NetworkManager is now installed on your computer.
If you are unable to find a prepackaged version of NetworkManager for your distribution, you could try and build it yourself. Download the source tarballs from the GNOME FTP site.
Build and install as per the method appropriate for your particular distribution.
Once NetworkManager is installed on the system, it can be started by entering the following on a command line as root:
service NetworkManager start
If you are unsure about using NetworkManager as your primary network application, using this command is a good way to test it out. You can run this command every time you boot up your computer to start NetworkManager.
However, if you know NetworkManager works well for you and you want to have it start up every time by default, enter the following command as root:
chkconfig --add NetworkManager
Once the NetworkManager daemon is running, log in as the user and enter the following in a terminal:
NetworkManagerInfo &
The NetworkManager icon should appear in the Notification Area.
If you do not have a Notification Area in your panel, you can create one. Start by right clicking on the panel and selecting . Choose the from the dialog box.
To make the NetworkManager icon return every time you log in, enter the following in a terminal:
gnome-session-save
NetworkManager attempts to intelligently select a network connection. The first thing it checks is whether or not an Ethernet card is connected and running. Because an Ethernet card creates a wired connection, it is assumed to be inherently faster than any wireless possibility. If such a connection exists, NetworkManager tries to get a DHCP lease on that connection.
If there is no wired connection available, NetworkManager uses the wireless card to scan for available ESSIDs (Extended Service Set Identifier, a code used to identify packets on a wireless network). If one or more of these access points have been used in the past, the one that was used most recently is automatically selected. If none of them have been used before, NetworkManager waits for user input.
Since NetworkManager considers wireless selection as a preference, it does not connect to any wireless networks unless a user is logged onto a desktop and one is selected. At a casual glance, this inactivity might seem unusual. What could be simpler than to have NetworkManager automatically pick the best connection?
There are a few reasons why this is not a good idea. First of all, NetworkManager has no way of knowing whether or not an access point is actually yours to use. It could belong to a neighbor who would not be happy if you used it. Second, there is no way for NetworkManager to gauge which connection would be best. Although it can tell signal strength, that is not a good way to compare connections. A connection to an access point with lower signal strength may be a better pick if the access point is connected to a much faster connection down the line. Lastly, some access points may be more secure than others. Because a user may one day prefer to choose a connection that offers a faster connection with lower security and on a different day choose differently, network selection has to be selected on a per-user basis.
NetworkManager is constantly scanning for changes in network hardware on the system as well as for new access points. If a new wired network becomes available, NetworkManager switches to it automatically. If the wire is disconnected, NetworkManager quietly switches back to the preferred wireless connection.
The first time you log in to the computer with NetworkManager running, the NetworkManager icon shows up in the Notification Area. Click on this icon and the selection menu pops up as shown in Figure 1, “The network selection menu”. This menu shows the available networks and their various strengths. Selecting a network activates that connection.
If a network is password protected, the listing of that network in the menu has an icon of a lock next to it. Selecting a password protected network pops up a dialog box. Select the appropriate hash type and enter your password to activate that connection.
Some access points are intentionally hidden by the administrator as a security measure. If you know the ESSID, you can still access it. From the NetworkManager icon in the Network Area, select . In the dialog box (shown in Figure 2, “Entering information for a hidden network”), enter the ESSID. If necessary, enter the password type and password as well.
Now that we have covered how to use NetworkManager, let us explore how it works.
The NetworkManager application is made up of four distinct parts:
These components interact with each other to perform tasks associated with NetworkManager. A diagram displaying their interactions is shown in Figure 3, “NetworkManager interactions”.
NetworkManager uses D-BUS (a message bus that allows applications to talk to each other) to interact with other applications. Using D-BUS allows for the flexibility of a standard interface while also including built-in security.
D-BUS is used internally for communication between:
Externally, NetworkManager uses D-BUS to broadcast information about various state changes. Other applications can monitor this information and theoretically be able to change network status.
Included in Fedora Core 3 and in upcoming Red Hat Enterprise Linux releases, HAL, or Hardware Abstraction Layer, provides the ability for applications to learn about existing and new hardware. For more information on HAL, read David Zeuthen's article on HAL.
NetworkManager queries HAL at startup to learn what network interfaces are available. Any changes in network hardware and link information is detected by HAL, and this information is immediately relayed to NetworkManager. HAL can also provide information about the network card's driver, which allows NetworkManager to special case certain cards.
There are many future features planned for NetworkManager. The following are a few of the more exciting ones currently being developed:
NetworkManager is still a work in progress. The developers welcome help from the community. Testing wireless cards, writing documentation, packaging for currently unsupported distributions, and contributing code are various ways that you can help NetworkManager achieve its full potential.
The latest release of the source code for NetworkManager can be downloaded as stated in the section called “Getting the source”. Although this method does not get the absolute latest improvements, there is a much better chance that the version is stable. For people helping with documentation or testing, these tarballs are more than adequate.
For those people who are adventurous or want to contribute code, getting the latest version is essential. This involves getting the code fresh out of CVS.
Before building NetworkManager from CVS, you need to check the following:
gtk2-devel package needs to be
installed on the system. If you do not have it, enter in
a terminal as root:
yum install gtk2-devel
gnome-autogen.sh from the
gnome-common module has to be in your
$PATH. If you do not have it, enter
into a terminal:
cvs -d :pserver:anonymous@anoncvs.gnome.org:/cvs/gnome get gnome-common
Copy gnome-common/macros2/gnome-autogen.sh into
~/bin
If necessary, update your PATH by executing the command:
export PATH=~/bin:$PATH
To download the NetworkManager code from CVS, execute:
cvs -d :pserver:anonymous@anoncvs.gnome.org:/cvs/gnome get NetworkManager
Once the downloading is complete, you are ready to build a new version of NetworkManager. Enter the following commands in a terminal:
cd NetworkManager
./autogen.sh --prefix=/usr --sysconfdir=/etc
make
and as root, type:
make install
Congratulations! You have just built the newest version of NetworkManager onto your computer.
To get your computer to recognize this new build, enter the following as root:
service NetworkManager restart
This command restarts the
NetworkManager daemon. To restart
the front end, issue the command killall
NetworkManagerInfo in a terminal.
Whether you have questions, suggestions, or offers to help, you need to be able to contact the developers. Here is a list of ways to get more information:
NetworkManager creator and developer Dan Williams took time out of his hectically busy schedule to answer some questions.
Here are some network cards that have been shown to work with NetworkManager:
Network cards that currently do not work with NetworkManager include:
With NetworkManager anticipating and fulfilling the new needs of network management, Internet connectivity becomes an easy and forgettable task. Users can configure it quickly themselves. With all the time you save, you can take your technically-savvy friend out to lunch!