VirtualBox 配置虚拟机网络
管理-主机网络管理
配置ip
右击虚拟机-设置-网络-网卡2-选择host-only
启动虚拟机
打开配置文件 cd /etc/sysconfig/network-scripts/
修改 ifcfg-enp0s3
保存 并重启
service network restart
查看 ip命令: ip addr
这里就可以连接网络了
为了防止网络地址变更配置
配置固定ip
复制 ifcfg-enp0s3
cp ifcfg-enp0s3 ifcfg-enp0s8
修改文件内容 ifcfg-enp0s8 保存并重启网络:service network restart
cmd 测试 ping 192.1.1.101 是否通过