If you are using a few Ubuntu servers installed on a virtual machine for IP configuration
Be aware of the following points:
<1> installed on virtual machine The default network connection mode for Ubuntu server is NAT and should be changed to bridge network card (connection mode, network, settings, and so on)
<2> set the IP of the host
Enter ipconfig on the command line to view IP
Turn on network Sharing Center, change adapter settings, Ethernet, modify IP (command line IP)
<3> set up IP on a virtual host
sudo vi/etc/hosts
#根据你自己IP地址书写
192.168.56.1 localhost
192.168.56.1 K
<4> Modify/etc/network/interfaces
sudo vi/etc/network/interfaces
Auto Eth0
Iface eth0 inet Static
Address 192.168.56.11
Netmask 255.255.255.0
Network 192.168.56.0
Broadcast 192.168.56.255
Gateway 192.168.56.1
Dns-nameservers 202.106.46.151
Dns-search Pcat
Esc:wq to save
<5> Restart Network Services
sudo/etc/init.d/networking restart
<6> shut down the firewall
sudo ufw disable
Ubuntu connection to multiple Ubuntu server issues