Remote routing access I have been configured for a long time, and after a multi-party search, the present command can implement port mapping
First, the query port mapping situation
netsh interface portproxy show v4tov4
Query all port mappings for this IP.
Second, add a port mapping
netsh interface portproxy add v4tov4 listenport= extranet port listenaddress= primary IP connectaddress= private IP connectport= Private IP port
For example:
netsh interface portproxy add v4tov4 listenport=8888 listenaddress=118.123.13.180 connectaddress=192.168.1.10 connectport=2222
Third, remove a port mapping
netsh interface portproxy delete v4tov4 listenaddress= primary IP listenport= External network port
For example:
netsh interface portproxy delete v4tov4 listenaddress=118.123.13.180 listenport=8888
In the case of shutting down the Hyper-V virtual machine, select Virtual Switch Manager in the Hyper-V management interface
In the popup dialog box, "New virtual network Switch", select "Internal" and click "Create Virtual Switch".
On the IP adapter switch to the "Share" tab, tick "Allow other network users to connect via this computer's Internet connection" and select the virtual Switch--vethernet (Hyper-V switch) you just created in the "Home network Connection" below, click "Confirm
Hyper-V shared network link port mappings