NetworkManager

From Gentoo Linux Wiki
Jump to: navigation, search

NetworkManager is a utility to auto configure wireless and wired networks with the capability to switch between wireless and wired automatically, selecting an optimum configuration. It also allows you to configure your usb modem or share an internet connection over wifi easily. NetworkManager is divided into a core and a UI so it doesn't matter which desktop environment or window manager you are using. Many applications can connect to NetworkManager over dbus to gather information about the network status. For example net-im/pidgin can disconnect / reconnect according to the status of the connection.

Contents

[edit] Installation

Possible USE flags for NetworkManager are:

  • avahi - Enables IPv4LL support (automatic network configuration).
  • bluetooth - Enables support for Bluetooth.
  • connection-sharing - Enables support for internet connection sharing with net-dns/dnsmasq and net-firewall/iptables.
  • dhclient - Use dhclient from net-misc/dhcp for DHCP.
  • dhcpcd - Use net-misc/dhcpcd for DHCP.
  • doc - Install documentation.
  • gnutls - Enables support for TLS and SSL using net-libs/gnutls.
  • nss - Enables support for Network Security Service.
  • ppp - Enable support for mobile broadband and PPPoE connections using net-dialup/ppp.
  • resolvconf - Use net-dns/openresolv for managing DNS information.

Set the USE flags you need and emerge networkmanager:

emerge -av networkmanager

After the installation you can start networkmanager with:

/etc/init.d/NetworkManager start

To make sure that it is started every time you boot your system add it to your default runlevel:

rc-update add NetworkManager default

Regardless of whether your wireless device needs it; networkmanager needs CONFIG_CFG80211_WEXT (wireless extensions) to be enabled in the kernel configuration.

[edit] Configuration

You will also need to block OpenRC from attempting to automatically initialize your network interfaces. This can be done by modifying /etc/rc.conf:

Code: /etc/rc.conf
rc_hotplug="!net.*"

[edit] Troubleshooting

[edit] Ignore Devices

If you have some network devices which you want to configure by yourself (For example mobile phones which connect over a USB network interface) NetworkManager can ignore these devices. Just add the MAC Adresses of the devices you want to ignore to your configuration file /etc/NetworkManager/nm-system-settings.conf

Code: NetworkManager.conf
[keyfile]
   unmanaged-devices=mac:00:11:22:ab:cd:ef;mac:33:44:55:66:77:88

[edit] Connection Sharing

To enable this feature of NetworkManager you have to set the connection-sharing USE flag. This feature enables a quick and dirty way to share a network connection for example an internet connection over UMTS. It is not recommended to use this feature in your real router. In the following example PC-A is connection with PC-B over eth0 and PC-A wants to share the internet connection from an UMTS modem. Right click on the NetworkManager icon in the tray area -> Edit connections. Now select the network interface that is connected to the other host (eth0) Select IPv4 Settings -> Method: Shared to other computers. Now PC-B will get an ip adress from DHCP and you are done.

[edit] Hidden SSID

Fix me: Is this still true?

By default NM cannot connect to wireless networks with the SSID hidden and the 'Available to all users' setting enabled. The way this works is that NM caches the BSSID of the known APs when you first manually connect to the network. However that is stored in the .gconf directory in $HOME which isnt used if 'Available to all users' is enabled.

You can manually add the BSSIDs to the global config though.

  • cd to '/etc/NetworkManager/system-connections'
  • edit the file for the network you wish to configure
  • go to the 802-11-wireless section
  • add "seen-bssids=00:00:00:00:00:00;11:11:11:11:11:11;", using your BSSIDs here
  • save the file

You can get your BSSID by running 'nm-tool' or 'iwconfig'. Each needs to be terminated by a semicolon in the config.

[edit] User Interface

You can choose different user interfaces for NetworkManager. A QT and GTK GUI and also a CLI is available.

[edit] GTK

The GTK Application is running in the system tray area and is called gnome-extra/nm-applet. The ebuild pulls in the gnome-base/gnome-panel by default. If you have a desktop environment that is not Gnome or XFCE you will have to install x11-misc/trayer to satisfy the application depencies.

emerge -av trayer

If you have Gnome or XFCE running it should work with emerging nm-applet

emerge -av nm-applet

To start the applet you will need a WM or a panel or some other application which can handle system tray applications. Start the applet with

nm-applet

An icon should appear immediately in your system tray area.

You may also need to do:

rc-update add consolekit

Or you may need to run

ck-launch-session

before starting nm-applet.

[edit] KDE

The KDE NetworkManager widget is kde-misc/networkmanagement. Add it to your panel.

[edit] CLI

The Command Line Interface is marked as unstable in the portage tree. You will have to unmask it before installation

echo "net-misc/cnetworkmanager ~x86" >> /etc/portage/package.keywords emerge -av net-misc/cnetworkmanager
Personal tools
In other languages