Updated on 2022-08-29 GMT+08:00

Configuring NetworkManager

Linux allows you to use NetworkManager to automatically configure the VM network. You are advised to use NetworkManager for new OS versions.

Alternatively, you can use the native network management service of the OS.

Red Hat, Oracle, CentOS 6.x, CentOS 7.x, EulerOS 2.x, Fedora 22, or Later

Install NetworkManager and use it for automatic network configuration.

  1. Run the following command to install NetworkManager:

    yum install NetworkManager

  2. Delete ifcfg-eth1 to ifcfg-eth11 from the /etc/sysconfig/network-scripts/ directory and retain only ifcfg-eth0.
  3. Run the following command to disable the network:

    service network stop

  4. Run the following command to disable automatic startup of the network:

    chkconfig network off

  5. Run the following commands to restart messagebus and NetworkManager and enable NetworkManager to start automatically at startup:

    service messagebus restart

    service NetworkManager restart

    chkconfig NetworkManager on

Debian 9.0 or Later

Install NetworkManager and use it for automatic network configuration.

  1. Run the following command to install NetworkManager:

    apt-get install network-manager

  2. Change the value of managed in the /etc/NetworkManager/NetworkManager.conf file to true.
  3. Modify /etc/network/interfaces and retain only eth0.
  4. Run the following commands to disable the network, restart messagebus and NetworkManager, and enable NetworkManager to start automatically at startup:

    service network-manager restart

    chkconfig network-manager on

    service networking stop

    service messagebus restart

    service network-manager restart

Ubuntu 14 or Later

Install NetworkManager and use it for automatic network configuration.

  1. Run the following command to install NetworkManager:

    apt-get install network-manager

  2. Change the value of managed in the /etc/NetworkManager/NetworkManager.conf file to true.
  3. Modify /etc/network/interfaces and retain only eth0.
  4. Run the following command to disable the network:

    service networking stop

  5. Run the following command to disable automatic startup of the network:

    chkconfig network off

  6. Run the following commands to restart D-Bus and NetworkManager:

    service dbus restart

    service network-manager restart

SUSE 11 SP3 and openSUSE 13 or Later

Install NetworkManager and use it for automatic network configuration.

  1. Delete ifcfg-eth1 to ifcfg-eth11 from the /etc/sysconfig/network-scripts/ directory and retain only ifcfg-eth0.
  2. Run the following command to install NetworkManager:

    zypper install NetworkManager

  3. Start YaST, choose Network Devices in the navigation pane on the left, and select Network Settings in the right pane. In the Network Setup Method area of the Global Options page, change Traditional Method with ifup to User Controlled with NetworkManager.