25

I do not want NetworkManager to list or manipulate my wireless card. Can I hide its interface from NetworkManager somehow?

I have tried adding this in /etc/network/interfaces,

iface wlan0 inet static
    address 192.168.1.101
    netmask 255.255.255.0
    gateway 192.168.1.1
    wireless-essid Synaptotagmin
    pre-up wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant.conf
    post-down killall -q wpa_supplicant

and this in /etc/NetworkManager/nm-system-settings.conf,

[main]
plugins=ifupdown,keyfile

[ifupdown]
managed=false

[keyfile]
unmanaged-devices=/org/freedesktop/Hal/devices/net_00_19_e0_57_86_af

but NetworkManager Applet still lists and allows me to connect to wireless networks.

2
  • Do you want other applications to be able to see your wireless card? Are you just trying to manually control the settings via your interfaces file or some non-NetworkManager mechanism? I assume a modprobe blacklist is more than you want?
    – belacqua
    Jan 18, 2011 at 3:20
  • That's correct, I still want to be able to manually control the network interface outside of NetworkManager.
    – ændrük
    Jan 18, 2011 at 4:19

7 Answers 7

31

According to Gnome Wiki, the syntax in /etc/NetworkManager/NetworkManager.conf (in older versions it was /etc/NetworkManager/nm-system-settings.conf) is different than what I'd read Arch Linux Wiki. It should be:

[main]
plugins=ifupdown,keyfile

[ifupdown]
managed=false

[keyfile]
unmanaged-devices=mac:00:19:e0:57:86:af

This configuration makes NetworkManager oblivious to the existence of my wireless card, but still allows me to control it using other methods.

1
  • 5
    the conf files seem to have changed in later releases im using oneiric. i did the same change but in the file /etc/NetWorkManager/NetworkManager.conf
    – tomodachi
    Apr 16, 2012 at 22:36
9

I think the wrong line may be:

unmanaged-devices=/org/freedesktop/Hal/devices/net_00_19_e0_57_86_af

as I didn't found that format specified in the official documentation.

Valid formats are unmanaged-devices=mac:<hwaddr> or, in recent Network Manager versions, unmanaged-devices=interface-name:<ifname>. Both are accepted together separated by semicolons, for example:

unmanaged-devices=mac:00:22:68:1c:59:b1;mac:00:1E:65:30:D1:C4;interface-name:eth2

This is an extract from NetworkManager.conf manual:

unmanaged-devices

Set devices that should be ignored by NetworkManager when using the keyfile plugin. Devices are specified in the following format:

mac: or interface-name:. Here hwaddr is the MAC address of the device to be ignored, in hex-digits-and-colons notation. ifname is the interface name of the ignored device.

Multiple entries are separated with semicolons. No spaces are allowed in the value.

Example:

unmanaged-devices=interface-name:em4

unmanaged-devices=mac:00:22:68:1c:59:b1;mac:00:1E:65:30:D1:C4;interface-name:eth2

1
  • +1 for citing the man pages and showing how you can actually use the unmanaged-devices key (besides just a single MAC address) Apr 2, 2017 at 22:23
5

Use the following /etc/NetworkManager/nm-system-settings.conf:

[main]
plugins=ifupdown,keyfile

[ifupdown]
managed=false

This way your interfaces from /etc/network/interfaces will be unmanaged by Network Manager, i.e. it will not try to do anything with them.

2
  • 1
    Thanks, but the file already contains these settings. I've updated my question to include this.
    – ændrük
    Jan 17, 2011 at 19:47
  • 1
    I too had problems with this. It started working only after a Network Manager restart.
    – Diego
    May 30, 2014 at 8:26
1

Alternate KEYFILE method

Regardless of which linux distribution is running, an alternate method can be used to tell Network Manager to stop controlling an interface. This is done by adding the following lines to the Network Manager configuration file /etc/NetworkManager/NetworkManager.conf:

[main]
plugins=keyfile

[keyfile]
unmanaged-devices=mac:00:11:22:33:44:55;mac:66:77:88:99:00:aa

List the MAC address of each interface you want Network Manager to ignore, separated with a semicolon. Make sure that MAC addresses listed here are LOWER CASE (If there already is a section [main] with plugins=..., add the plugin keyfile to that list there)

To get the mac address of your device wlan0 use

LANG=c ifconfig wlan0|grep HWaddr

This will show the mac of the device, something like

wlan0     Link encap:Ethernet  HWaddr ac:51:4f:70:13:72

Restart NetworkManager with

sudo /etc/init.d/network-manager restart
0

I assume you're on Ubuntu Desktop; if that's the case, right-click on nm-applet (I think on Natty you just click) and uncheck 'Enable wireless'. The only caveat is that you'll have to do that every time you log in.

1
  • 1
    This disables the wireless chip rather than just telling NetworkManager to ignore the interface.
    – user77111
    Feb 3, 2013 at 18:47
0

In Ubuntu 14.04, it is in the /etc/NetworkManager/NetworkManager.conf. But you may need to deal with the permissions.

-5

Just create a .sh file containing killall -q wpa_supplicant and execute it using cron when you log in.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .