hyper-v虚拟机安装了centos7之后并不能上网,有些测试就无法继续进行,接下来就需要进行一些配置。
新建虚拟交换机
![hyper-v虚拟机安装Linux Centos 7 网络配置-第0张图片](https://www.mlplus.net/wp-content/uploads/2020/02/20200225125037.png)
下图紧接着2、3、4步。
![hyper-v虚拟机安装Linux Centos 7 网络配置-第1张图片](https://www.mlplus.net/wp-content/uploads/2020/02/20200225123722.png)
设置名称并设置连接类型。
![hyper-v虚拟机安装Linux Centos 7 网络配置-第2张图片](https://www.mlplus.net/wp-content/uploads/2020/02/20200225124015.png)
设置网络适配器。
![hyper-v虚拟机安装Linux Centos 7 网络配置-第3张图片](https://www.mlplus.net/wp-content/uploads/2020/02/20200225124152.png)
![hyper-v虚拟机安装Linux Centos 7 网络配置-第4张图片](https://www.mlplus.net/wp-content/uploads/2020/02/20200225124506.png)
启动虚拟机系统Centos并登录, 进入到network-scripts目录 。
cd /etc/sysconfig/network-scripts
![hyper-v虚拟机安装Linux Centos 7 网络配置-第5张图片](https://www.mlplus.net/wp-content/uploads/2020/02/20200225101400.png)
![hyper-v虚拟机安装Linux Centos 7 网络配置-第6张图片](https://www.mlplus.net/wp-content/uploads/2020/02/20200225101449.png)
vi ifcfg-eth0
![hyper-v虚拟机安装Linux Centos 7 网络配置-第7张图片](https://www.mlplus.net/wp-content/uploads/2020/02/20200225101625.png)
将ONBOOT=no
改为 ONBOOT=yes
保存后重启网络。
systemctl restart network
![hyper-v虚拟机安装Linux Centos 7 网络配置-第8张图片](https://www.mlplus.net/wp-content/uploads/2020/02/20200225131436.png)
转载请注明:清风亦平凡 » hyper-v虚拟机安装Linux Centos 7 网络配置