3.2.1.2. Using GNOME NetworkManager
The GNOME NetworkManager facility provides an alternative to the use of profiles. NetworkManager is a service that automatically detects network configuration changes and determines available options. A small GUI application permits you to quickly select the network option you wish to use. It's ideal for laptop users because it permits rapid switching between multiple wired and wireless networks.
At this time, NetworkManager is a work in progress. When it works, it works well, but some hardware that works fine with other configuration techniques does not work at all with NetworkManager. It is proposed that NetworkManager will eventually become the configuration tool of choice.
The NetworkManager service is enabled in the same way as every other service (see Lab 4.6, 'Managing and Configuring Services '). You can configure it to start at the next boot by choosing the menu option System>Administration>Services, and then selecting the checkboxes labeled NetworkManger (the related NetworkManagerDispatcher service is not usually required); to start the services immediately, select each of them in turn and then click the Start button.
From the command line, you can start the service immediately using the service command, and you can configure it to start at boot time using
# service NetworkManager start
Setting network parameters...
Starting NetworkManager daemon: [ OK ]
# chkconfig NetworkManager on
Notice the nonstandard use of capital letters in the name NetworkManager.
As soon as the NetworkManager starts, an icon should appear in your panel's notification area, which is shown in Figure 3-21 . This icon will indicate the type of IP connection currently in use. To switch to a different connection, click on the icon; a list of available connections will appear (including all broadcast local network names if you have a wireless card, plus a little signal-strength bar graph for each wireless network). Click on the network you wish to connect to, and NetworkManager will attempt to make the connection. You will be prompted to enter WEP or WPA encryption keys if necessary.
Figure 3-21. NetworkManager icon (left), showing that a wired Ethernet connection is active
NetworkManager will establish connections with wired networks automatically, but it will not automatically connect to wireless networks to which you have not previously connected because they may belong to your neighbor, or to companies that you are passing if you are in a vehicle. It will also detect the loss of network connectivity when a wireless signal is no longer usable or a network cable is unplugged.
You can also view the NetworkManager status from the command line by using
# nm-tool
NetworkManager Tool
State: connected
- Device: eth0 ----------------------------------------------------------------
NM Path: /org/freedesktop/NetworkManager/Devices/eth0
Type: Wired
Driver: b44
Active: yes
HW Address: 00:0D:56:33:D7:18
Capabilities:
Supported: yes
Carrier Detect: yes
Speed: 100 Mb/s
Wired Settings
Hardware Link: yes
IP Settings:
IP Address: 172.16.97.100
Subnet Mask: 255.255.255.0
Broadcast: 172.16.97.255
Gateway: 172.16.97.254
Primary DNS: 24.153.23.66
Secondary DNS: 24.153.22.67
3.2.1.3. Configuring networking from the command line
The GUI network configuration tool and NetworkManager both work well for desktop users, but when you're logged in to a server that is a few time zones away or need to make a fast change, it's useful to be able to configure networking from the command line.
The main interface configuration command is
$ /sbin/ifconfig
eth0 Link encap:Ethernet HWaddr 00:0D:56:33:D7:18
inet addr:172.16.97.100 Bcast:172.16.97.255 Mask:255.255.255.0
inet6 addr: fe80::20d:56ff:fe33:d718/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:289 errors:0 dropped:0 overruns:0 frame:0
TX packets:228 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:45844 (44.7 KiB) TX bytes:27193 (26.5 KiB)
Interrupt:177
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1