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
if you want to disable for example the eth0 (ethernet port), you can sudo ifconfig eth0 down which will disable (down) the port. changing down to up will re-enable it.
To disable it, we will use the “ifconfig” command in the shell followed by the interface name and state to be applied. Hence, we have mentioned the state as “down” in the below command. Now when you check the state of interfaces, the state of an interface “enp0s3” has been changed to “down”.
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 --
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With