How to set up a wired connection on CentOS 7?

To set up a wired connection on CentOS 7, you can follow these steps:

  1. Open the terminal and enter the following command to check the network interfaces:
ip addr
  1. Find the name of the wired network interface you want to connect to (usually starting with eth0 or enp), and then use the following command to activate that interface:
sudo ifup eth0(将“eth0”替换为您实际的网络接口名称)
  1. Check the network connection status using the following command:
nmcli connection show
  1. If you need to configure a wired connection, you can use the following command to create a new wired connection configuration file:
sudo nmcli connection add con-name "MyWiredConnection" ifname eth0 type ethernet ip4 192.168.1.2/24 gw4 192.168.1.1
  1. Start the newly created wired connection.
sudo nmcli connection up "MyWiredConnection"
  1. Finally, you can use the following command to check the status of the wired connection:
nmcli connection show

By following the steps above, you should be able to successfully set up a wired connection on CentOS 7. If you encounter any issues, feel free to ask me for help at any time.

bannerAds