How to remove extra network cards in CentOS 7?
To remove extra network cards on CentOS 7, you can follow the steps below:
- Use the following command to view network card information on the system:
- What is the IP address?
- 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”.
- Edit the network interface configuration file using the following command:
- Open the file ifcfg-
located in /etc/sysconfig/network-scripts using the sudo command and vi text editor. - Please replace
with the actual name of the network card you want to delete. - In the open file, remove all lines related to the network card to be deleted, such as DEVICE, IPADDR, NETMASK, etc.
- Save and close the file.
- Restart the network service using the following command:
- Restart the network using the command “sudo systemctl restart network”.
- Alternatively, you can restart the network service using the following command.
- Please restart the network service using the command “sudo service network restart”.
- Use the following command to check the network card information on the system again, ensuring that any extra network cards have been successfully deleted:
- internet protocol address
Please make sure to backup the network interface configuration file before editing it to prevent any unforeseen errors.