http://support.qacafe.com/knowledge-base/how-do-i-prevent-network-manager-from-controlling-an-interface/

Network Manager is a service for Linux which manages various networking interfaces, including physical such as Ethernet and wireless, and virtual such as VPN and other tunnels. Network Manager can be configured to control some or all of a system’s interfaces.

While Network Manager is an excellent service for managing the daily requirements of a user’s computer, its effects are typically non-optimal for a testing environment. Because of the extra variables it introduces into the state of a test machine’s networking configuration, it can be especially difficult to integrate with CDRouter, which also controls network interfaces. Due to this conflict, the start procedure will generate an error if Network Manager is controlling any interfaces used for testing. In this case you have three options:

  • Tell Network Manager to stop controlling the interfaces used by the test configuration
  • Stop the Network Manager process
  • Remove the Network Manager software from the system

Before you begin, please be aware that your LAN interface may require manual configuration should you decide to remove Network Manager from your system. If you do not have Internet access from another system, you may wish to learn how this process works before completing the removal process. This article discusses how to manually configure network interfaces under several Operating Systems.

 

Tell Network Manager to stop controlling the interfaces used by the test configuration

Network Manager has a command line tool that can be used to see which interfaces it is controlling. Pull up a terminal window and type the following command:

$ nmcli dev status

This displays a table that lists all network interfaces along with their STATE. If Network Manager is not controlling an interface, its STATE will be listed as unmanaged. Any other value indicates the interface is under Network Manager control.

Network Manager settings are controlled by a configuration file: /etc/NetworkManager/nm-system-settings.conf (NM 0.7 and 0.8.0) or /etc/NetworkManager/NetworkManager.conf (NM 0.8.1 and later). We will use this file to tell Network Manager to stop controlling a particular interface, but how this is done depends on which linux operating system is running.

 
CentOS, Fedora, Red Hat

With these linux distributions, the preferred way to tell Network Manager to stop controlling an interface is by editing the individual ifcfg-* files. First, make sure the Network Manager configuration file has the following lines.

[main]
plugins=ifcfg-rh

This plugin tells Network Manager to look at the Red Hat ifcfg-* files. Now for each interface you’d like Network Manager to ignore, edit the individual /etc/sysconfig/network-scripts/ifcfg-* interface files, adding the following lines:

NM_CONTROLLED=no
HWADDR=00:11:22:33:44:55

Of course, set the HWADDR value to be the actual MAC address of this interface. Often this line is already present.

 
Ubuntu, Debian

With these linux distributions, one way to tell Network Manager to stop controlling a particular interface is by telling Network Manager to ignore ALL interfaces listed in the /etc/network/interfaces file. This is done by adding the following lines to the Network Manager configuration file:

[main]
plugins=ifupdown [ifupdown]
managed=false

Since this will only affect interfaces listed in the /etc/network/interfaces file, any interface not listed there will remain under Network Manager control.

 
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:

[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.

 

Stop the Network Manager process

If Network Manager is not needed during testing, it can be shut off completely. The stop/start command is a little different depending on the linux distribution used:

 
CentOS, Fedora, Red Hat
$ service NetworkManager stop
$ service NetworkManager start
 
Ubuntu, Debian
$ sudo service network-manager stop
$ sudo service network-manager start
 

Remove the Network Manager software from the system

If Network Manager will not be needed at all, it can be removed from the system completely. Again, this procedure is a bit different depending on the linux distribution used:

 
CentOS, Fedora, Red Hat
$ yum remove NetworkManager
 
Ubuntu, Debian
$ sudo apt-get remove network-manager

nm applet disable的更多相关文章

  1. NetworkManager

    网络管理器(NetworManager)是检测网络.自动连接网络的程序.无论是无线还是有线连接,它都可以令您轻松管理.对于无线网络,网络管理器优先连接已知的网络并可以自动切换到最可靠的无线网络.利用网 ...

  2. Uninstall or Disable Java on a Mac

    You can run Java apps in two ways. The first is to run Java applets inside your Web browser with a p ...

  3. How to Disable Strict SQL Mode in MySQL 5.7

    If your app was written for older versions of MySQL and is not compatible with strict SQL mode in My ...

  4. 环信SDK报错处理方法obtain an updated library from the vendor, or disable bitcode for this target. for archit

    ld: '/Users/momo/Desktop/ThreeFingers/Pods/EaseMobSDKFull/EaseMobSDKFull/lib/libEaseMobClientSDK_arm ...

  5. mysql的DISABLE/ENABLE KEYS

    有一个表 tbl1 的结构如下: CREATE TABLE `tbl1` ( `id` int(10) unsigned NOT NULL auto_increment, `name` char(20 ...

  6. Disable testSuite and testCase on some environment

    def testEnv = context.expand('${#Project#testEnv}') String[] testCases = ["CheckEARouting(ADS)A ...

  7. 《java小应用程序(Applet)和java应用程序(Application)分别编写的简单计算器》

    Application和Java Applet的区别.Java语言是一种半编译半解释的语言.Java的用户程序分为两类:Java Application和Java Applet.这两类程序在组成结构和 ...

  8. Disable the screen switching about VI

    If you want to disable the screen switching, and you don't want tochange your termcap, you can add t ...

  9. Linux的nm查看动态和静态库中的符号

    功能 列出.o .a .so中的符号信息,包括诸如符号的值,符号类型及符号名称等.所谓符号,通常指定义出的函数,全局变量等等. 使用 nm [option(s)] [file(s)] 有用的optio ...

随机推荐

  1. Html网页的代码

    Html网页的代码 很全哦 1)贴图:<img src="图片地址"> 2)加入连接:<a href="所要连接的相关地址">写上你想写 ...

  2. js--数组去重3种方法

    js数组去重的三种常用方法总结 第一种是比较常规的方法 思路: 1.构建一个新的数组存放结果 2.for循环中每次从原数组中取出一个元素,用这个元素循环与结果数组对比 3.若结果数组中没有该元素,则存 ...

  3. droidcon 北京2016安卓技术大会——安卓领域国际盛会

    目前droidcon国际技术大会已成为安卓领域全球最有影响力.规模最大的技术大会,每年在世界各地举办,横跨四大洲,超过上万人次参加. droidcon国际技术大会于2009年由一个Android爱好者 ...

  4. createElement创建

    定义和用法 createElement() 方法可创建元素节点. 此方法可返回一个 Element 对象. <script type="text/javascript"> ...

  5. Oberon程序设计—目录

    内        容前   言1, 什么是Oberon? 1.1 ALGOL家族 1.2 该系统2, 第一:程序 2.1 一个符号来描述的语法: 2.2练习 第一部分,符号和基本类型,分配,控制结构, ...

  6. LNK2019解决思路

    虽然官网给出了很多可能的原因,最可能的原因还是因为缺少某个库文件.最近解决的一个为例总结一下思路 Winmm.lib; ad_win32.obj : error LNK2019: unresolved ...

  7. [ An Ac a Day ^_^ ] hdu 2553 N皇后问题 搜索

    曾经想过一天一AC 坚持下来的确不容易额 (我是没坚持下来 尽量以后坚持…… 经典的N皇后问题 搜索的入门问题 学了这么久竟然一直没敲过 今天敲一下…… 这道题也不是很简单额 纯暴力就超时了 要打一下 ...

  8. digitalocean最新优惠码赠送10美元

    digitalocean是我非常喜欢的vps服务商,目前手头还有十来个digitalocean vps服务器.用了三年多digitalocean后,我发现digitalocean一点小技巧.比如,如果 ...

  9. 再次深入 C# Attribute

    了解attribute Attribute 只是将一些附加信息与某个目标元素关联起来的方式. Attribute 是一个类,这个类可以提供一些字段和属性,不应提供公共方法,事件等.在定义attribu ...

  10. MC-设置 止盈

    using System; using System.Drawing; using System.Linq; using PowerLanguage.Function; using ATCenterP ...