Virtualbox-CentOS网络配置
1.记下虚拟网卡IP

2. 配置网卡1、网卡2
网卡1 ---对应---eth0----NAT(网络地址转换)用来与外网通信
网卡2 ---对应---eth1----Host-only用来与主机通信


3.启动虚拟机
4. 配置eth0、eth1文件
cd /etc/sysconfig/network-scripts //进入配置目录

4.1 配置eth0---对应---网卡1
vi ifcfg-eth0

4.2 配置eth1---对应---网卡2
cp ifcfg-eth0 ifcfg-eth1 //如果ifcfg-eth1不存在,从ifcfg-eth0拷贝
vi ifcfg-eth1

5. 重启网络服务
servic network restart

6. 查看ip
ifconfig

7. 测试虚拟机网络
ping www.baidu.com

8. 测试主机--》虚拟机



浙公网安备 33010602011771号