Get the App
SLTechnology News&Howtos  ›  Network Security  › 

Add a new network card to cnetos6,centos7, which is not recognized by the system.

Shulou Source: shulou.com Published: 2022-06-01 03:46:02 10月06日 Update

When doing experiments today, you need to add a new network card for virtual, but the system can not recognize it, all kinds of Baidu, Google, all kinds of restarts are unsuccessful.

I thought if I added a new piece, the system would recognize it, but it didn't.

Summary: To rewrite the new network card configuration file, and modify HWADDR, otherwise LSB error will be reported.

Here is my solution:

1. After adding a new network card, execute ifconfig, and the system does not recognize it.

#ifconfig

2. Get the real mac of the new network card

#ip addr

3. Copy eth0 to eth2 and modify the configuration file

#cd /etc/sysconfig/network-scripts

#cp ifcfg-eth0 ifcfg-eth2

#vim ifcfg-eth2

The content to be modified is:

HWADD is obtained by ip addr

UUID I did not find UUID, can comment out

NAME changed to the current network card name eth2

DEVICE changed to current NIC name eth2

IPADDR,GATEWAY, etc.

save and exit

4. Restart the NIC, you can see that it has been acquired

#systemctl restart network

#ifconfig

Tags: Network card system file configuration success content fact not so method time comment error report experiment method Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi Apple Shulou Technology Docker Linux