1.网络连接模式:
选用NAT
2.编辑虚拟机机器的DNS配置文件/etc/resolv.conf
将nameserver 设置为VM 中NAT的网关地址
[root@andes.com /etc]#cat resolv.conf
# No nameservers found; try putting DNS servers into your
# ifcfg files in /etc/sysconfig/network-scripts like so:
#
# DNS1=xxx.xxx.xxx.xxx
# DNS2=xxx.xxx.xxx.xxx
# DOMAIN=lab.foo.com bar.foo.com
nameserver 192.168.59.2
3. 编辑网卡配置文件:
/etc/sysconfig/network-scripts/ifcfg-eth0 ,重点是设置IP,设置IP为静态方式,设置网关,以后再SecureCRT等终端登录就不用经常改变IP了。
[root@andes.com /etc/sysconfig/network-scripts]#cat ifcfg-eth0
DEVICE="eth0"
HWADDR="00:0C:29:27:F4:A8"
NM_CONTROLLED="yes"
ONBOOT="yes"
IPADDR="192.168.59.133"
GATEWAY=192.168.59.2
BOOTPROTO=static