Linux Desktop uses the network manager to manage your network interfaces. However, these two commands are still available on the server version that does not have the Network Manager installed. If you want to configure the network manager on the command line,
After Linux is installed, it cannot communicate with other machines in the network. This course will solve the problem of Linux network configuration for you. First, we will introduce the basic knowledge of the network, configure the IP address, summarize the problems frequently encountered in configuring the network environment, and finally introduce the use of several common remote login tools, such as XShell and SecureCRT.
Network Manager is a dynamic Network controller and configuration system. It is used to enable and activate a device and connection when a Network device is available. By default, CentOS/RHEL 7 is installed with a network manager and enabled.
Interface for Detecting Network connector cable connection
You can useNmcli,Command
$ Nmcli dev status
DEVICE TYPE STATEeth1 802-3-ethernet connectedeth0 802-3-ethernet connected
The above command will list all available network interfaces. If the status is "unmanaged", it means it is not used. If the status is other (such ., "connected"), it means that you are using
Completely disable network connectors
The following method describes how to completely disable a network connector.
In Debian 8 or later:
$ Sudo systemctl stop NetworkManager. service
$ Sudo systemctl disable NetworkManager. service
In Debian 7 or earlier versions:
$ Sudo/etc/init. d/network-manager stop
$ Sudo update-rc.d network-manager remove
On Ubuntu or other Linux Mint:
$ Sudo stop network-manager
$ Echo "manual" | sudo tee/etc/init/network-manager.override
After Debian or Ubuntu is disabled, you can configure the file: use/etc/network/interfaces.
In ora or CentOS/RHEL 7 or later versions:
$ Sudo systemctl stop NetworkManager. service
$ Sudo systemctl disable NetworkManager. service
In CentOS/RHEL 6 or earlier versions:
$ Sudo service NetworkManager stop
$ Sudo chkconfig NetworkManager off
After disabling the network connector on the Fedora or CentOS system, remember to configure the/etc/sysconfig/network-scripts/ifcfg-ethX interface file.
Disable a specific network Connection Manager In Debian, Ubuntu or Linux Mint
First open the configuration file/etc/NetworkManager and set "managed = false" to false.
$ Sudo vi/etc/NetworkManager. conf
[ifupdown]managed=false
In the file/etc/network/interfaces, add the one you want to disable. In this example, disable eth1, and then configure the static IP address.
$ Sudo vi/etc/network/interfaces
# The loopback network interfaceauto loiface lo inet loopback# network interface not managed by Network Managerallow-hotplug eth1iface eth1 inet staticaddress 10.0.0.10netmask 255.255.255.0gateway 10.0.0.1dns-nameservers 8.8.8.8
In this way, the Manager Automatically ignores the network you have set.
You can check whether eth1 is disabled.
$ Nmcli dev status
Disable a network on Fedora or CentOS/RHEL
Create a configuration file for the eth1 Network (if it does not exist), and then add "NM_CONTROLLED = no ".
TYPE="Ethernet"NAME="eth1"BOOTPROTO="static"IPADDR=10.0.0.10NETMASK=255.255.255.0GATEWAY=10.0.0.1HWADDR="00:90:29:95:EA:57"ONBOOT="yes"DEFROUTE="yes"NM_CONTROLLED=no
Enable the eth1 network so that it will be enabled as the machine starts up.
On Fedora or CentOS/RHEL 7 or later
$ Sudo systemctl enable network. service
On CentOS/RHEL 6 or earlier:
$ Sudo chkconfig network on
After the restart, let's see if eth1 is disabled.NmcliCommand to detect.
$ Nmcli dev status