Linux Commands Examples

A great documentation place for Linux commands


network management daemon

see also : nm-tool - nm-online - nmcli - nm-applet - nm-connection-editor


NetworkManager [--version] | [--help]

NetworkManager [--no-daemon] [--pid-file=<filename>] [--state-file=<filename>] [--config=<filename>] [--plugins=<plugin1>,plugin2>,...] [--log-level=<level>] [--log-domains=<domain1>,<domain2>,...] [--connectivity-uri=<uri>] [--connectivity-interval=<int>] [--connectivity-response=<resp>]

add an example, a script, a trick and tips

: email address (won't be displayed)
: name

Step 2

Thanks for this example ! - It will be moderated and published shortly.

Feel free to post other examples
Oops ! There is a tiny cockup. A damn 404 cockup. Please contact the loosy team who maintains and develops this wonderful site by clicking in the mighty feedback button on the side of the page. Say what happened. Thanks!



Not authorized to control networking in SSH console

By default, DBus only allows root and users sitting at the physical console to control networking settings.

This can be changed by editing DBus policy files, in this case /etc/dbus-1/system.d/NetworkManager.conf


Disabling networkmanager for a specific interface

To quote /usr/share/doc/network-manager/README.Debian:

Configuration of wireless and ethernet interfaces ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Only devices that are not listed in /etc/network/interfaces or which have been configured "auto" and "dhcp" (with no other options) are managed by NM.

This way you can setup a custom (static) configuration for a device and NM will not try to override this setting.

After modifying /etc/network/interfaces you have to restart NM with the command "/etc/init.d/network-manager restart".

and then it has some examples.


Network stopped working on Ubuntu after system had locked up

Got it working using the following sequence of commands. Use sudo on all

service network-manager stop
rm /var/lib/NetworkManager/NetworkManager.state
service network-manager start 

Enable eth0 by default on Fedora 12

Edit file /etc/sysconfig/network-scripts/ifcfg-eth0 and be sure there is line like this: ONBOOT = yes


How to set up VPN on a new Fedora 16 install?

It sounds like you're supposed to make a directory named ~/.cert and then copy the riseup.pem into that directory.


How to force NetworkManager to make a connection before login?

The issue with this idea is that the NetworkManager service takes its commands from nm-applet (or the KDE analogue, if you're in KDE. To avoid confusing myself, I'll assume you're in GNOME). There is a command-line NetworkManager interface in the repositories called cNetworkManager (that's, oddly enough, written in Python). You could try to stick a command to connect to your network using cNetworkManager in a startup script (I'm not entirely sure where you'd have to put this script, but I know it's possible :D). I don't know whether or not this approach will connect or if it'll stay connected after you logout, but i DO know that there are at least 2 issues you'll have to reconcile.

1) You'll have this script fighting with nm-applet. If you want to do this, i'd disable nm-applet from starting automatically (which should be configurable in either preferences -> sessions or preferences -> startup programs, depending on whether or not you're using fedora 11).

2) if you ever want to change networks (and do fancy things like automatically detect them), you'll either have to do so using cNetworkManager (which is a real pain), or start up nm-applet and lose your ability to keep the connection open after you logout.

Best of luck, and let us know if this works!


is there a way to prevent network manager from storing the password for a wireless network

The network manager provides you a checkbox to "Save Password" as far as I remember. Please check it.


Primary/secondary ethernet interfaces via NetworkManager in Ubuntu 9.10

It would be good to see your routing table, because I'm just guessing here, but it sounds like your default gateway is not set correctly. You can set that with the route command. It would be something like this:

route add default gw XXX.XXX.XXX.XXX dev eth0

EDIT: I should mention that this route is not persistant, so if this works, you'd need to add the line to your network scripts or rc.local. Also, I have no idea how avahi works so you're on your own on that.


Perlscript runs fine when executed manually but not under cron

In your script, try dumping the system PATH before the "exec nm-applet" call. nm-applet exists in /usr/bin on my system, and I cannot imagine the default PATH not containing /usr/bin but stranger things have happened.


How do I make nm-applet the default network manager instead of knetworkmanager in KDE (Kubuntu)?

I don't use KDE, but I expect it's the same basic process. You want to remove knetworkmanager from the list of programs started at the beginning of your Session.

Here's instructions for using KDE's Session Manager to set a manually-saved session as the default:

  1. Open K-Menu > Control Center > KDE Components > Session Manager
  2. Select Restore manually saved session. This will cause a Save Session button to appear on the K-Menu. (See the link for a description of the other options.)
  3. Open all the applications you want started when you login to KDE; close any running applications you don't want started.
  4. Open K-Menu > Save Session

Static IP Address with NetworkManager?

Command-Line Instructions

After much digging, I found that the ifcfg-* file names, and the NAME= variable in the file have very little to do with the actual assignment. You can literally change them to whatever you want... I did a test on my machine changing them to eth0 and the manual/static IP was still applied upon startup. The key here seems to the be HWADDR variable inside the file. The NAME= value only seems to be the name displayed in the graphical Network Manager settings. So, that being said I believe all you need to do is...

  1. Make sure NetworkManager.service is still enabled, and network.service is disabled.

  2. The most IMPORTANT step is to delete the current ifcfg-enp2s5 script.

    sudo rm /etc/sysconfig/network-scripts/ifcfg-enp2s5
  3. Create a new script named ifcfg-p3p1

    sudo nano /etc/sysconfig/network-scripts/ifcfg-p3p1
  4. Set the contents of ifcfg-p3p1 to the following, and update the respective IP settings with your desired settings.


As for why the ifcfg-* name was different from the actual device name. I don't know but suspect it has something to do with how the Network settings were applied during installation.

Graphical Instructions

  1. Open System Settings
  2. Click on Network
  3. Click on Options...
  4. Click on the IPv4 Settings* or IPv6 Settings tab depending on what IP version your home network is using (most likely IPv4).
  5. Click on the Method combo-box and select the Manual option.
  6. Click on the Add button.
  7. Type the address you want in the Address columns (e.g.
  8. Type the netmask for your network in the Netmask column (e.g.
  9. Enter the gateway (usually your router's IP) in the Gateway column (e.g.
  10. Enter your DNS server in the DNS servers text-box (e.g.

    Wired Connection Options Dialog

  11. Click on Save...
  12. When you return to the Network settings, turn the Wired interface OFF.
  13. It should automatically turn back on with the static address information you entered in the previous steps. If it does not turn on, click the toggle switch to turn it on.

    Network Settings After Manual IP Selection

To answer your question about using the NetworkManager.service over network.service. There is definitely potential it could be removed in later releases. As a general rule of thumb though, no matter the topic is, you should always try to avoid using anything "included for backwards compatibility". So, you should stick to using NetworkManager if you can.


Change VPN password from Linux client

You can use smbpasswd


smbpasswd -r <domain-server> -U <user name>
Change Windows Domain password from Linux
If you use Linux in a Windows domain and there are N days to expiry, this is how you can change it without resorting to a windows machine.

I have not tested this.


VPN - force a selective range of ip to run on VPN (linux)

I think you are going to have a problem in any case. This command will route the host out of the VPN:

ip route add dev ppp0

This is for the command line, but you can add it above in the dialog box of the first image.

Gateway:  (the ubuntu vpnc client does not let you specify a device)

Your problem is that will need to route back to you. So it will see packets coming from and think that this address is on its local network. So it will then broadcast on the local network asking who has the IP address, and it will go unanswered.

So you need the same route back. But this doesn't help you, because you are over a VPN and your IP address is changing. This route added to would tell it that .247 is behind the VPN gateway:

ip route add via xxx.YY.ZZ.106 [ip address of vpn server]

This will only last as long as you remain on .247 As soon as you disconnect and reconnect, you'll have another IP address, and need to change the route.

The golden rule here is that you should avoid using the same address range for both ends of the VPN.


Set more than one DNS in NetworkManager

Like the tooltip says, separate the DNS server addresses by commas. Do note that most resolvers won't use more than 3 DNS servers though.


The NetworkManager daemon attempts to make networking configuration and operation as painless and automatic as possible by managing the primary network connection and other network interfaces, like Ethernet, WiFi, and Mobile Broadband devices. NetworkManager will connect any network device when a connection for that device becomes available, unless that behavior is disabled. Information about networking is exported via a D-Bus interface to any interested application, providing a rich API with which to inspect and control network settings and operation.

NetworkManager will execute scripts in the /etc/NetworkManager/dispatcher.d directory in alphabetical order in response to network events. Each script should be:


a regular file


owned by root


not writable by group or other


not set-uid


and executable by the owner

Each script receives two arguments, the first being the interface name of the device just activated, and second an action.



The interface has been activated. The environment contains more information about the interface; CONNECTION_UUID contains the UUID of the connection. Other variables are IP4_ADDRESS_N where N is a number from 0 to (# IPv4 addresses - 1), in the format "address/prefix gateway". IP4_NUM_ADDRESSES contains the number addresses the script may expect. IP4_NAMESERVERS contains a space-separated list of the DNS servers, and IP4_DOMAINS contains a space-separated list of the search domains. Routes use the format IP4_ROUTE_N where N is a number from 0 to (# IPv4 routes - 1), in the format "address/prefix next-hop metric", and IP4_NUM_ROUTES contains the number of routes to expect. If the connection used DHCP for address configuration, the received DHCP configuration is passed in the environment using standard DHCP option names, prefixed with "DHCP4_", like "DHCP4_HOST_NAME=foobar".


The interface has been deactivated.


A VPN connection has been activated. The environment contains the connection UUID in the variable CONNECTION_UUID.


A VPN connection has been deactivated.


The system hostname has been updated. Use gethostname(2) to retrieve it.


The DHCPv4 lease has changed (renewed, rebound, etc).


The DHCPv6 lease has changed (renewed, rebound, etc).


The following options are supported:

Print the NetworkManager software version and exit.


Print NetworkManager’s available options and exit.


Do not daemonize. This is useful for debugging, and directs log output to the controlling terminal in addition to syslog.


Specify location of a PID file. The PID file is used for storing PID of the running proccess and prevents running multiple instances.


Specify file for storing state of the NetworkManager persistently. If not specified, the default value of ’<LOCALSTATEDIR>/lib/NetworkManager/NetworkManager.state’ is used; where <LOCALSTATEDIR> is dependent on your distribution (usually it’s /var).


Specify configuration file to set up various settings for NetworkManager. If not specified, the default value of ’<SYSCONFDIR>/NetworkManager/NetworkManager.conf’ is used with a fallback to the older ’nm-system-settings.conf’ if located in the same directory; where <SYSCONFDIR> is dependent on your distribution (usually it’s /etc). See NetworkManager.conf(5) for more information on configuration file.

--plugins=<plugin1>,<plugin2>, ...

List plugins used to manage system-wide connection settings. This list has preference over plugins specified in the configuration file. Currently supported plugins are: keyfile, ifcfg-rh, ifcfg-suse, ifupdown. See NetworkManager.conf(5) for more information on the plugins.


Sets how much information NetworkManager sends to the log destination (usually syslog’s "daemon" facility). By default, only informational, warning, and error messages are logged. See NetworkManager.conf(5) for more information on log levels and domains.

--log-domains=<domain1>,<domain2>, ...

Sets which operations are logged to the log destination (usually syslog). By default, most domains are logging-enabled. See NetworkManager.conf(5) for more information on log levels and domains.


Sets the URI of a web page that will be used for connectivity checking. By default connectivity checking is disabled. See NetworkManager.conf(5) [connectivity] section for more information on connectivity checking feature.


Sets the interval (in seconds) in which connection checks for the URI are done. 0 means no checks. The default value is 300 seconds. See NetworkManager.conf(5) [connectivity] section for more information on connectivity checking feature.


If set, it controls what body content NetworkManager checks for when requesting the URI for connectivity checking. If missing, defaults to "NetworkManager is online". See NetworkManager.conf(5) [connectivity] section for more information on connectivity checking feature.


The following environment variables are supported to help debugging. When used in conjunction with the "--no-daemon" option (thus echoing PPP and DHCP helper output to stdout) these can quickly help pinpoint the source of connection issues. Also see the --log-level and --log-domains to enable debug logging inside NetworkManager itself.

When set to anything, causes NetworkManager to turn on PPP debugging in pppd, which logs all PPP and PPTP frames and client/server exchanges.

see also

nm-tool , nm-online , nmcli , NetworkManager.conf, nm-settings, nm-applet , nm-connection-editor .

How can this site be more helpful to YOU ?

give  feedback