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

4
  • 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, 2011 at 5: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, 2011 at 6:27
  • Is there any kernel flags which can control network manager operations?
    – Souvik
    Mar 18, 2011 at 5: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 bugs.launchpad.net/ubuntu/+source/network-manager/+bug/1485558 . In the meantime, any solution working on 15.04 would be nice! Aug 19, 2015 at 17:19

4 Answers 4

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.

4
  • note that the file should sometimes be located at /etc/NetworkManager/nm-system-settings.conf , depending on your distribution
    – bjesus
    Mar 2, 2013 at 22:22
  • Didn't work for me on Gentoo using Systemd and NetworkManager 1.0.6, any ideas?
    – Debianita
    Oct 31, 2015 at 15:41
  • 5
    You can also ignore device by name using unmanaged-devices=interface-name:vboxnet0 etc. May 27, 2016 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 May 30, 2019 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.

1
  • If network manager is using ifupdown plugin, the NetworkManager.conf file should have managed=False in [ifupdown] section.
    – jhonkola
    Jan 22, 2017 at 15:58
10

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     --    
1
  • 1
    The interface will be managed again by networkmanager after reboot
    – Jruv
    Sep 8, 2020 at 7:04
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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.