How to remove extra network cards in CentOS 7?

To remove extra network cards on CentOS 7, you can follow the steps below:

  1. Use the following command to view network card information on the system:
  2. What is the IP address?
  3. Please identify the name of the redundant network card you wish to delete. Network card names typically start with “eth” or “ens”, such as “eth0” or “ens33”.
  4. Edit the network interface configuration file using the following command:
  5. Open the file ifcfg- located in /etc/sysconfig/network-scripts using the sudo command and vi text editor.
  6. Please replace with the actual name of the network card you want to delete.
  7. In the open file, remove all lines related to the network card to be deleted, such as DEVICE, IPADDR, NETMASK, etc.
  8. Save and close the file.
  9. Restart the network service using the following command:
  10. Restart the network using the command “sudo systemctl restart network”.
  11. Alternatively, you can restart the network service using the following command.
  12. Please restart the network service using the command “sudo service network restart”.
  13. Use the following command to check the network card information on the system again, ensuring that any extra network cards have been successfully deleted:
  14. internet protocol address

Please make sure to backup the network interface configuration file before editing it to prevent any unforeseen errors.

bannerAds