Quantcast
Channel: Hyper-V forum
Viewing all articles
Browse latest Browse all 8743

HyperV NAT port fowarding

$
0
0

Recently I've had to create a VM which runs a process that operates on a a few set port numbers. I must connect to that VM from my local machine just for simple demo purposes. Doing this obviously requires port forwarding between my local machine and the VM which is running so I can open the frontend application.

Doing this from within VirutalBox is easier as it has some simple port forwarding options within settings on the VM itself inside the network section. 

Why is it that port forwarding is not done in the same way and you must separately use PowerShell to achieve this? It should not be too tricky to add an option for this. Suppose I am asking for a RFE. On the latest Windows 10 enterprise OS.

Took me some time to figure this out but in PowerShell can be done like this (after you manually create internal only switch):

New-NetIPAddress -IPAddress <<switch ADDR>> -PrefixLength <<eg, 23>> -InterfaceIndex 7

netsh interface portproxy add v4tov4 listenport=<<portnum>> connectaddress=<<switch ADDR>> connectport=<<portnum>> protocol=tcp

On the subject can think of a few minor improvements from the front-end viewpoint. Some of the docs I find are not the clearest but do help. It seems quite a few paths can be taken to achieve this request but the simplest is this method IMO.


Viewing all articles
Browse latest Browse all 8743

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>