Home > Article > Operation and Maintenance > What should I do if centos cannot connect to xshell?
1. Check whether the local physical machine can ping successfully
2. If so, turn off the firewall and disable the firewall from starting at boot (CentOS 7)
systemctl stop firewalld.service firewall-cmd --state systemctl disable firewalld.service
3. If the local command line ping fails, check the Linux network
Specific: Enter ifconfig under Linux, but you cannot see the IP at this time.
Next, execute vi /etc/sysconfig/network-scripts/ifcfg-eth0. After opening the file, you find that the file is empty. This may be because the file was accidentally deleted. Enter the following information in this file:
DEVICE=eth0 ONBOOT=yes BOOTPROTO=static IPADDR=192.168.81.129 NETMASK=255.255.255.0 GATEWAY=192.168.81.2
where IPADDR is set according to your needs. The IP of my private network for the virtual machine is set to network segment 81. Here, my IPADDR is set to 192.168.81.129, and GATEWAY is set to 192.168.81.2
After the settings are completed, save and exit.
At this point, enter ifconfig again and you can view the IP address.
Recommended related tutorials: centos tutorial
The above is the detailed content of What should I do if centos cannot connect to xshell?. For more information, please follow other related articles on the PHP Chinese website!