1. 使用NAT模式linux
2.查看虛擬機IP網絡
Subnet IP用來控制虛擬機想要的IP網段,NAT Settings看一下虛擬機網關,我這裏是192.168.152.2dom
3.配置linux ip.net
DEVICE="eth0"rest
BOOTPROTO="static" //指明靜態ipserver
HWADDR="00:0C:29:16:DB:2F" //ifconfig查看本身的ip
IPV6INIT="no"get
NM_CONTROLLED="yes"虛擬機
ONBOOT="yes"it
IPADDR=192.168.152.138
NETMASK=255.255.255.0
GATEWAY=192.168.152.2
DNS1=192.168.152.2 //來自步驟二的截圖
TYPE="Ethernet"
UUID="62c32299-a340-4c7c-8905-98f019ec19b5" //每一個機子的值要不同
4.設置DNS地址
,運行命令#vi /etc/resolv.conf
# Generated by NetworkManager
search localdomain
nameserver 192.168.152.2
5 重啓網絡服務 [root@HE1 ~]# /etc/init.d/network restart