正文
windows server 2016 docker 之创建使用虚拟交换机
小程序:扫一扫查出行
【扫一扫了解最新限行尾号】
复制小程序
【扫一扫了解最新限行尾号】
复制小程序
windows server 2016 Create a virtual switch for Hyper-V virtual machines
操作步骤:
服务器只有一块网卡连接了网络
尝试1:
- hyper-v创建并应用交换机
- 在虚拟机设置该switch
- 在centos设置了ip 正确联网。
新尝试2:
- Get-NetAdapter
- New-VMSwitch -name ExternalSwitch -NetAdapterName NIC1 -AllowManagementOS $true
- 使用该交换机
- 设置IP 即可
背景:
windows server 2016 docker ee 17.06.2-ee ,只能支持windows container ,项目需要同时使用 linux + windows的容器。
截至日前,windows能同时支持两种核心的,只有 windows server 1709版本,通过linuxkit + hyper-v方式。
拿到的服务器是 server 2016 的,而1709不是可以直接升级的版本 。
所以本次采用 windows 容器: docker ee 17.06.2-ee-6 ; linux 容器: hyper-v centos7.4 + docker 17.09.1-ce 方式 。
hyper-v 虚拟机 的centos7 若需要连接外网,先取得一个IP 地址,然后进行设置