15

I would like to disable network manager service for particular interface(s). "/etc/init.d/NetworkManager stop" is not going to serve my purpose since will stop the service. Please let me know how to achieve this. Please suggest commands/code only - I am not interested in graphical configuration. If there is some rpm/patch available already please refer it to me. Can we configure network manager in such a way so that it will not detect any new network card plugged into the system?

Thanks in advance,

Souvik

Souvik
  • 601
  • 1
  • 8
  • 16
  • Is it possible to disable network manager for wireless network? Or can I configure the system so that network manager does not get notified when a new card is plugged in? – Souvik Mar 17 '11 at 05:10
  • If I uncheck the wireless network checkbox from the network manager icon, then also network manager scans for available APs once I plugged the card in which is creating trouble for me. – Souvik Mar 17 '11 at 06:27
  • Is there any kernel flags which can control network manager operations? – Souvik Mar 18 '11 at 05:23
  • In Ubuntu 14.10 and before, NetworkManager correctly ignored interfaces created by VirtualBox (vboxnet*). In 15.04 it insists on managing them and solutions here do not work. See https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/1485558 . In the meantime, any solution working on 15.04 would be nice! – Stéphane Gourichon Aug 19 '15 at 17:19

4 Answers4

28

Put this in your NetworkManager.conf (usually at /etc/NetworkManager/):

[main]
plugins=keyfile

[keyfile]
unmanaged-devices=mac:xx:xx:xx:xx:xx:xx

of course, adjust the mac address to the device your want to ignore.

bjesus
  • 478
  • 6
  • 10
  • note that the file should sometimes be located at /etc/NetworkManager/nm-system-settings.conf , depending on your distribution – bjesus Mar 02 '13 at 22:22
  • Didn't work for me on Gentoo using Systemd and NetworkManager 1.0.6, any ideas? – Debianita Oct 31 '15 at 15:41
  • 5
    You can also ignore device by name using `unmanaged-devices=interface-name:vboxnet0` etc. – Ondrej Machulda May 27 '16 at 13:08
  • 2
    @aliopi add multiple interfaces separated by commas. Example: `unmanaged-devices=interface-name:vmnet8,interface-name:vmnet1,interface-name:vmnet2,interface-name:vmnet0` – Jeff McJunkin May 30 '19 at 13:10
10

I realise this question is a bit old, but it came up when I was trying to Google the answer to this myself. What eventually worked for me was:

  1. Add the interface to /etc/network/interfaces. For mine:
    iface eth1 inet static
        address 192.168.168.1
        netmask 255.255.255.0
        gateway 192.168.168.1
  1. Restart networking: sudo /etc/init.d/networking restart
  2. Restart Network Manager: sudo service network-manager restart

Network Manager should ignore any interfaces it finds in /etc/network/interfaces. At this point obviously you're on your own for managing this interface with ifconfig or something similar.

  • If network manager is using _ifupdown_ plugin, the `NetworkManager.conf` file should have `managed=False` in `[ifupdown]` section. – jhonkola Jan 22 '17 at 15:58
8

NetworkManager will not attempt to control a given interface if you set the interface to unmanaged using the nmcli command.

nmcli dev set wlp2s0 managed no

You can verify the interface is no longer managed with the following:

nmcli dev status

Output example:

DEVICE             TYPE      STATE         CONNECTION      
wlp2s0             wifi      unmanaged     --    
2

On my RHEL 6.5 system, I had to edit the configuration file for the particular adapter (/etc/sysconfig/network-scripts/ifcfg-eth0) and add the following line:

NM_CONTROLLED=no

The 2nd part of your question, "Can we configure network manager in such a way so that it will not detect any new network card plugged into the system?", I think is handled in the /etc/NetworkManager/NetworkManager.conf file with the line:

no-auto-default=00:80:A4:0A:3C:20,

Set this property of course to the value of the MAC address for your adapter. More info on this option can be read here.