首页 » 学习备忘录 » 正文

记一次hyperv虚拟机添加IP不通的解决方法

最近买了一台有一个C段IP的站群服务器,但是使用时发现分配的一个C段的额外IP在母鸡上添加能正常使用,但是添加到hyperv创建的虚拟机中时,就怎么也不通,而主IP添加到虚拟机上就正常。因为以前的服务器从来没有遇到过这样的问题,一直都是直接在虚拟机上添加就可以使用,所以只能求助于机房。

答复是说机房采用了静态路由的网络,但是却始终无法给出一个满意的解决方案,我自己也百度搜索瞎折腾,什么route命令添加路由之类的,不过都没解决,好在第二天机房终于给出了解决方法并成功解决了这个问题,这里贴出这个方法以供备忘和大家参考。

机房提供的方法:

For Windows Server 2012 or Windows Server 2008 and HyperV, use the following procedure:

1 – Install the Remote Access (Windows Server 2012) or Routing and Remote Access Services (Windows Server 2008) server role
through the “Add Roles and Features Wizard”
2 – In Windows Server 2012, when you install the role, check the Routing box in the Role Services screen
3 – After the service has been installed, open the Routing and Remote Access tool.
4 – Right click on your local server, and then select Configure and Enable Routing and Remote Access
5 – From the Configuration screen, select Custom Configuration
6 – On the Custom Configuration screen, select LAN Routing and finish the wizard
7 – Once you have installed the service, you will need to add one IP address to the HyperV network interface from the secondary
prefix. This IP will be used as the gateway for the virtual machines.
8 – Your virtual machines should be configured to use the IP you configured in step 7 as their gateway.

 

用中文概括一下就是在角色中添加路由和远程访问,然后配置启用路由和远程访问,选择自定义,然后下一步选择LAN,再保存启动服务,最后在小鸡里添加上分配的IP,网关使用步骤7中添加的IP,即可正常使用了。这时母鸡相当于是额外IP的路由器。

 

发表评论