1 Introduction
Today, when I was operating Jedis to connect to the redis database of the virtual machine, I couldn't connect. I found many solutions but couldn't solve it. Finally, I found that it was a configuration problem of the virtual machine. The virtual machine could not connect to the network and the local IP address was not set, so ifconfig The IP address cannot be found at all, and Jedis cannot connect at all. Here is a summary of the solution:
2. Steps
First, log in with the root user and enter /etc/sysconfig/network-scripts
. There is a ifcfg-ens33
file like this. Different users may have different files, but they all use it to modify the IP address.
3. Modify configuration
Note:
IPADDR here refers to the local IP.
GATEWAY refers to the gateway. Note: the gateway here must be consistent with the gateway in step 4 to access the external network.
NETMARK refers to the network mask.
4. Step 4
Enter the virtual network editor and check the network configuration. The NAT mode of my host is configured. The configuration here is different in different modes.
5. Check the "Adapter" option of your win10
Supplementary information screenshot: