How to set up a wired connection on CentOS 7?
To set up a wired connection on CentOS 7, you can follow these steps:
- Open the terminal and enter the following command to check the network interfaces:
ip addr
- 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”替换为您实际的网络接口名称)
- Check the network connection status using the following command:
nmcli connection show
- 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
- Start the newly created wired connection.
sudo nmcli connection up "MyWiredConnection"
- 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.