Server 2008 R2 maps virtual machines to public networks after installing hyper-v
Limit: there is only one public network ip address
Solution: use the routing and remote services that come with server 2008 in conjunction with Microsoft Loopback Adapter.
Steps:
Add expired hardware Microsoft Loopback Adapter
Add routing and remote services
Configure routing and remote services, use loopback as the public network connection, the system automatically sets the private network address to 172.16.1.1 as the real private network address, and uses this address as the gateway address of the virtual machine.
Configure hyperv, add virtual switch, "extranet" type and link to loopback
Set the virtual machine gateway to 172.16.1.1 and configure dns
Turn on the ping function and test the intranet connection
The port that needs to be mapped, such as 8800 to a virtual machine, needs to set the ip address of the virtual machine, open the virtual machine firewall, set the real machine route mapping, and turn on the real machine firewall. So that the external network can be accessed.
Deficiency: unable to implement reverse proxy, that is, which virtual machine is determined by domain name. That is, the same port cannot realize the function of assigning to different virtual machines.