1.网络地址转换 NAT: 主机能够上网,虚拟机设置为自动获取ip,然后查看ifconfig 能够ping通主机。就可以上网了。
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
2桥接网卡 Bridged : 主机与虚拟机 同一网段,相互ping通 , 然后IP设为固定的。如 192.168.1.108 ,另外一个就设为 192.168.1.88
重启网络后 也是可以的
3. 连接网络 设置网络~~~
[root@localhost root]# ifconfig eth0 up
[root@localhost root]# ifup eth0
--------------------]# service network restart
---都行----
vi /etc/sysconfig/network-scripts/ifcfg-eth0