NM_CONTROLLED 网卡参数作用及配置指南

Kevin 教程 5,414 次浏览 62条评论

CentOS 网卡配置文件中有个名为 NM_CONTROLLED 参数,其默认值是 yes。然而在很多教程里看到建议设置 no,但未进一步解释其含义。为了弄明白这个问题网上查了相关资料,下面概要总结下。


NM_CONTROLLED 设置 yes 表示网卡允许用 NetworkManager 程序管理。它可以降低网络配置使用难度,便于管理无线网络、虚拟专用网等网络连接,适合普通台式机和笔记本电脑使用。

当 NM_CONTROLLED 设为 yes 并有安装运行 NetworkManager 服务,若编辑了网卡配置文件,需要先重启 NetworkManager 再重启 network 服务。


NM_CONTROLLED 设置 no 表示网卡使用传统方式管理而不用 NetworkManager。好处是修改网卡配置文件后直接重启 network 就生效,不受 NetworkManager 干扰。适合用以太网连接的服务器使用。

禁用 NetworkManager 服务

CentOS Minimal 默认未启用 NetworkManager 服务。若不清楚现在系统是否启用,用下面命令检查,

chkconfig --list NetworkManager

如果打印如下信息,表示没有安装启用 NetworkManager 服务。

error reading information on service NetworkManager: No such file or directory

如果打印了服务运行级别信息,但值均为 off。表示有安装 NetworkManager,但已经禁用服务。

NetworkManager 	0:off	1:off	2:off	3:off	4:off	5:off	6:off

如果打印的服务运行级别值有 on,则按下面步骤禁用 NetworkManager(如果需要禁用的话)。

1. 停止禁用正在运行的 NetworkManager 服务。

sudo service NetworkManager stop
sudo service NetworkManager disable

2. 取消服务自动运行。

sudo chkconfig NetworkManager off

3. 修改所有使用 NetworkManager 管理的网卡配置文件,将 NM_CONTROLLED 值改为 no,并确认需要自动连接的网卡有设置ONBOOT=yes参数。

要快速查询哪些网卡使用 NetworkManager 管理,可以用nmcli device status命令检查(不支持 CentOS 6),STATE 状态下非 unmanaged 值的网卡都由 NetworkManager 管理。

4. 重启网络使修改生效,并确认设置网络自动运行。

sudo service network start
sudo service network restart
sudo chkconfig network on

完成禁用 NetworkManager。后续若要修改网络连接,直接修改其配置文件重启网络即可。


  1. #1

    Hi, very nice website, cheers!
    Need cheap and reliable hosting? Our shared plans start at $10 for an year and VPS plans for $6/Mo.
    Check here: https://www.reliable-webhosting.com/

  2. #2

    coronavirus treatment antivirals https://www.herpessymptomsinmen.org/productacyclovir/

  3. #3

    when generic viagra in usa https://buszcentrum.com/

  4. #4

    bimatoprost without an rx fast shipping https://carepro1st.com/

  5. #5

    can you give ivermectin orally https://ivermectin.webbfenix.com/

  6. #6

    what is cialis tablets used for http://www.lm360.us/

  7. #7

    vidalista dose chart https://vidalista.mlsmalta.com/

  8. #8

    how much does viagra cost at walmart http://droga5.net/

  9. #9

    hydroxychloroquine coronavirus africa https://hydroxychloroquine.webbfenix.com/

  10. #10

    studies show hydroxychloroquine works https://hydroxychloroquine.mlsmalta.com/

  11. #11

    ivermectin for pinworms in humans https://ivermectin.mlsmalta.com/

  12. #12

    viagra dapoxetine levitra comparison chart https://ddapoxetine.com/

  13. #13

    vidalista dosing information https://vidalista40mg.mlsmalta.com/

  14. #14

    generic cialis cost https://tadalafili.com/

  15. #15

    over the counter bronchitis inhaler https://amstyles.com/

  16. #16

    cialis.com https://wisig.org/

  17. #17

    325mg aspirin daily

  18. #18

    cost of generic hydroxychloroquine

  19. #19

    free adult cam

  20. #20

    retino 0.025 cream

  21. #21

    canadian pharmacy no prescription needed

  22. #22

    doxycycline doryx http://doxycycline.zolftgenwell.org/

  23. #23

    canadian online pharmacy no prescription

  24. #24

    texas loan

  25. #25

    tadalafil price in india

  26. #26

    payday loans in georgia

  27. #27

    hydroxychloroquine long term https://hydroxychloroquinee.com/

  28. #28

    top ten home insurance companies

  29. #29

    insurance house

  30. #30

    10mg viagra for women

  31. #31

    buy ivermectin cream

  32. #32

    buy sildenafil from canada

  33. #33

    western union loan

  34. #34

    interest rates on personal loans

  35. #35

    hydroxychloroquine stock symbol https://hydroxychloroquine.mymvrc.org/

  36. #36

    hydroxychloroquine stock symbol https://hydroxychloroquine.lm360.us/

  37. #37

    progressive auto and homeowners insurance

  38. #38

    levitra for sale canada

  39. #39

    dapoxetine without doctor prescription connect https://dapoxetine.confrancisyalgomas.com/

  40. #40

    tamoxifen weight loss message boards https://tamoxifen.mrdgeography.com/

  41. #41

    tadalafil and grapefruit juice https://tadalafil.cleckleyfloors.com/

  42. #42

    buying painkillers online https://edmeds.buszcentrum.com/

  43. #43

    metoprolol and cialis interaction http://tadalafila.online/

  44. #44

    ivermectin tablets dosage http://ivermmectin.com/

  45. #45

    cialis without doctor prescription http://ciaalis2u.com/

  46. #46

    online physician https://medpills.bee-rich.com/

  47. #47

    online physician https://buymeds.mlsmalta.com/

  48. #48

    Wow…never seen this before

  49. #49

    cialis users testimonials http://cialis.anafassia.com/

  50. #50

    cialis users testimonials https://cialis.lm360.us/

  51. #51


  52. #52

    hydroxychloroquine from india http://hydroxychloroquined.online/

  53. #53

    Fine way of explaining, and nice paragraph to take data
    regarding my presentation topic, which i am going to present in institution of
    higher education. http://antiibioticsland.com/Cephalexin.htm

  54. #54

    viagra generic without prescription http://viiagra.co/

  55. #55

    ed meds online without doctor https://atadalafil.online/

  56. #56

    viagra http://viaagra1.com/

  57. #57

    I think this is one of the most important information for me.
    And i am glad reading your article. But want to remark on few
    general things, The website style is great, the articles
    is really nice : D. Good job, cheers http://cleckleyfloors.com/viagra

  58. #58

    Sweet blog! I found it while searching on Yahoo News. Do you
    have any suggestions on how to get listed in Yahoo News?
    I’ve been trying for a while but I never seem to get there!
    Thank you https://cialis.bee-rich.com/tadalafil

  59. #59

    generic cialis tadalafil walmart http://cialis.audiovideoninja.com/

  60. #60

    generic cialis tadalafil walmart https://cialis.adicbc.com/

  61. #61

    Remarkable! Its genuinely remarkable piece of writing, I
    have got much clear idea concerning from this post. https://hydroxychloroquinej.jueriy.com/

  62. #62

    If you wish for to grow your familiarity only keep
    visiting this site and be updated with the newest news posted here. https://hydroxychloroquineb.buszcentrum.com/


电邮地址用于 Gravatar 头像显示,不会被公开可见。