Warning: If you enable Hyper-V (e.g., WSL, Docker, VMs, etc.) on Windows,[...]
and if you ever want to assign an outgoing port to any process (e.g., stunnel, adb, etc.), then you will be a very unhappy person (for years!) if you don't heed this warning outlined below.
I never took a class in networking so I don't really know why you
have to do this - but all I know it not knowing this cost me zillions
of hours over the years of wasted debugging that knowing what is in this
one post would have saved me (and which is why I'm posting this for you).
Marion, 2025-05-07 00:24:
Warning: If you enable Hyper-V (e.g., WSL, Docker, VMs, etc.) on Windows,[...]
and if you ever want to assign an outgoing port to any process (e.g.,
stunnel, adb, etc.), then you will be a very unhappy person (for years!) if >> you don't heed this warning outlined below.
I never took a class in networking so I don't really know why you
have to do this - but all I know it not knowing this cost me zillions
of hours over the years of wasted debugging that knowing what is in this
one post would have saved me (and which is why I'm posting this for you).
Well - since WSL2 provides the ability to access ports on the machine *inside* WSL2 as 127.0.0.1 from the *host*, this is the expected behaviour.
If you don't like this - don't use WSL2 but instead Hyper-V only with a "real" virtual machine inside Hyper-V and a virtual network setup for
Hyper-V which is shared with your host, for example 10.0.0.1/24 so you
can access the virtual machines at 10.0.0.2 from your host with is
10.0.0.1 (in addition to its regular IP address in your network). Then
the host won't have any blocked ports at all. To let the VM have access
to the outside world, it can then also directly use the network card of
the host as bridge and does not need NAT as well - so your host will
then be visible as two machines, one is your host and the second one is
the VM inside Hyper-V.
The only ports I mess with are in stunnel and the only reason I do that is you have to if your newsreader is a bunch of telnet scripts. I guess if I ported the telnet scripts to openssl they might not need stunnel anymore.
Is that correct?
The only ports I mess with are in stunnel and the only reason I do that is >> you have to if your newsreader is a bunch of telnet scripts. I guess if I
ported the telnet scripts to openssl they might not need stunnel anymore.
Is that correct?
Well - I don't know what you do with "telnet scripts" and why you need stunnel for them, so I can't answer your question.
But in general there is also SSH which can also tunnel connections from
your client to a server if the server does not allow you to access the services on a public IP address or if you want to protect your
connection if the server does not support TLS.
If people need to use Hyper-V, then they *must* reserve ports they want to use *ahead* of time since Winnat reservation is essentially random (AFAIK).
If people need to use Hyper-V, then they *must* reserve ports they want to >> use *ahead* of time since Winnat reservation is essentially random (AFAIK).
You can also just disable the NAT and only use direct connections in the virtual machines in Hyper-V. This is why I suggested this *instead* of
using WSL2 if you need a Linux VM in Windows - because WSL2 does not
work without NAT.
Get-NetAdapter
New-VMSwitch -Name "<MySwitchName>" -NetAdapterName "<MyPhysicalAdapterName>" -AllowManagementOS $true
On Sat, 17 May 2025 08:54:23 +0200, Arno Welzel wrote :
If people need to use Hyper-V, then they *must* reserve ports they want to >>> use *ahead* of time since Winnat reservation is essentially random (AFAIK). >>You can also just disable the NAT and only use direct connections in the
virtual machines in Hyper-V. This is why I suggested this *instead* of
using WSL2 if you need a Linux VM in Windows - because WSL2 does not
work without NAT.
I thank you for that information which will help others.
Personally, I can't even spell Hyper-V as I have no idea what it is.
All I know is I have to enable it whenever a program asks me to do that. Looking up what you said (which requires more understanding than I own), apparently Hyper-V is Microsoft's name for its virtual machine platform.
For that virtual machine to connect to the Internet, apparently it needs a port to go through in order to get outside to the Internet. NAT takes care
of the pipe of the virtual machine port on one end and the real machine
port on the other end, apparently.
Apparently your reference to "direct connections" is a bridge of some sort. That bridge has its own IP address, apparently, just like another computer.
So, I guess, the VM traffic goes out that bridge directly to the router. Apparently that bridge isn't a physical device but a software construct.
If so, is my understanding correct that this virtual switch then handles
the task of bridging the network traffic between my VM and the physical network?
Did you activate Hyper-V in that PC? Or was it someone else? Maybe you
or that person forgot what had done....
telnet localhost 55563[Mixmin]
The moral of the story is if you turn on Hyper-V and if you need to use select ports, then you will want to reserve those ports ahead of time.
1. This will display ports currently excluded by Winnat.
C:\> netsh int ip show excludedportrange protocol=tcp
netstat -aon | findstr :55555
tasklist | findstr 1234
Sysop: | Tetrazocine |
---|---|
Location: | Melbourne, VIC, Australia |
Users: | 8 |
Nodes: | 8 (0 / 8) |
Uptime: | 89:37:03 |
Calls: | 161 |
Files: | 21,502 |
Messages: | 78,348 |