Solve the problem that the network card configuration file cannot be found after adding a new network card in CentOS

After installing the CentOS 7 virtual machine using the VMware Workstation virtual machine , there is a problem that CentOS 7 has no network card configuration file after adding a network card. After adding a second network card, after entering the CentOS 7 system, the network card configuration file cannot be seen.

After entering the CentOS7 system, use ip addr to check the status as follows:

It is found that ens33 and ens77 have IP addresses and can be used normally. ens33 uses manually configured IP, and ens37 uses IP address automatically obtained by dhcp, but ifcfg- cannot be found in /etc/sysconfig/network-scripts/ directory. ens37 configuration file

Solve the problem that the network card configuration file cannot be found after adding a new network card in CentOS Solving the problem that the network card configuration file cannot be found after adding a new network card in CentOS

solution:

1. Use the nmcli con show command to view the UUID information of the network card and write down the UUID value

Solve the problem that the network card configuration file cannot be found after adding a new network card in CentOS Solving the problem that the network card configuration file cannot be found after adding a new network card in CentOS

2. Use the ip addr command to view the network card information and write down the MAC address of the ens37 network card

Solve the problem that the network card configuration file cannot be found after adding a new network card in CentOS Solving the problem that the network card configuration file cannot be found after adding a new network card in CentOS

3. Copy the ifcfg-ens33 file in the /etc/sysconfig/network-scripts/ directory and name it ifcfg-ens37, re-modify the configuration file, and pay attention to modifying the necessary hardware information.

Solve the problem that the network card configuration file cannot be found after adding a new network card in CentOS Solving the problem that the network card configuration file cannot be found after adding a new network card in CentOS

4. Finally restart the network card.

Solve the problem that the network card configuration file cannot be found after adding a new network card in CentOS Solving the problem that the network card configuration file cannot be found after adding a new network card in CentOS

The original text comes from: https://www.linuxprobe.com/centos-network-scripts.html

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325365083&siteId=291194637