nmcli stop managing a particular device

5

How can I use nmcli to temporarily stop managing a particular device?

If I list my devices I get:

$nmcli dev
DEVICE  TYPE      STATE      CONNECTION         
eno1    ethernet  connected  COMPANY-LAN            
enp3s0  ethernet  connected  MY-TEST-LAN 
lo      loopback  unmanaged  --     

I want to be able to switch off nm control of enp3s0 temporarily, configure it by hand with ip or ifconfig, and then later, without rebooting or restarting any network services, hand control back to nm. And I'd like to do this all through nmcli, not the GUI.

Any help / suggestions would be appreciated.

Also, if it matters, I'm on Ubuntu 16.04, nmcli version 1.2.0.

Brian McFarland

Posted 2016-09-02T14:50:17.943

Reputation: 211

Answers

6

In recent NetworkManager versions (1.2.0 and above):

nmcli dev set eth0 managed no

In earlier versions, the only option is to edit /etc/NetworkManager/NetworkManager.conf to permanently unmanage a device:

[keyfile]
unmanaged-devices=interface-name:eth0

user1686

Posted 2016-09-02T14:50:17.943

Reputation: 283 655

1nmcli dev set eth0 managed no doesn't seems to permanently unmanage a device with NM v1.4.2. Or, should it? – Yasushi Shoji – 2016-12-13T05:02:15.217

It's temporary in 1.4, will become permanent in 1.6. – user1686 – 2016-12-13T05:31:47.113

@grawity, looks like it is still temporary in 1.8.4-7.fc27 version. – ks1322 – 2018-02-19T12:35:50.083