> vi /etc/hostname server01
> vi /etc/hosts 127.0.0.1 localhost 127.0.1.1 server01 # 域名解析使用 192.168.227.131 server01 192.168.227.132 server02 192.168.227.133 server03 # The following lines are desirable for IPv6 capable hosts ::1 localhost ip6-localhost ip6-loopback ff02::1 ip6-allnodes ff02::2 ip6-allrouters
> vi /etc/network/interfaces # This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). source /etc/network/interfaces.d/* # The loopback network interface auto lo iface lo inet loopback # The primary network interfac auto ens33 iface ens33 inet static address 192.168.227.131 # 與網關下同一網段便可 netmask 255.255.255.0 gateway 192.168.227.2 # vmware nat模式下的網關 dns-nameserver 192.168.1.1 # 聯網dns解析使用,外部windows的網關地址
注:windows的虛擬機的網絡適配器(VMware Network Adapter VMnet8)記得設置固定IP,避免再也不同一網段。node
> reboot
注:圖片過小的,請右擊並在新標籤頁中打開圖片ubuntu