Configuration of Microsoft NLB
I'm having an application hosted on a VM server2012r2. This application has a webpart, running .NET 5 (Kestrel).
The webpart is accessible via http://<serverip>:808
or https://<serverip>:4434
.
I have setup a second VM, a server 2019. The application is also installed there (.NET 5, Kestrel), where the webpart is also accessible on the server via port http:808 or https:4434.
The application is configured in such a way that they point to the same database etc...
So basically it are two applications working together but both accessible via their own portal.
The only problem I have is there are two portals pointing to the same:
http://<server2012>:808
and http://:808`
(or the same for https for ports 4434).
The idea is that I enable Microsoft network load balancer so that
(A) the end user only has to go to http://<something>:808
or https://<something>:4434
instead of remembering one of the two portal IPs;
(B) the traffic is load balanced between both (and if one is not accessible, it goes to the one available (i'm not sure if nlb is capable of doing this?)).
I've followed a tutorial as this is the first time i'm using microsoft nlb. https://www.serverlab.ca/tutorials/windows/web-servers/load-balancing-web-servers-with-windows-server-2012-r2/
The problem that I am facing is that when I create a New Cluster with Parameters, IP Address(192.168.0.88 ) and Full internet name (nlbtest.com) and add for the Cluster IP 192.168.0.88 a TCP port from 808 - 808 that I can't access my server anymore via remote desktop.
server 2012r2 (VM 1 NIC): 192.168.0.90
runs kestrel web app on http://192.168.0.90:808 or https://192.168.0.90:4434
server 2019 (VM 1 NIC): 192.168.0.91
runs kestrel web app on http://192.168.0.91:808 or https://192.168.0.91:4434
Cluster IP: 192.168.0.88 for TCP port 808
when I configure this on server2012r2 via microsoft nlb I don't have any connection anymore. I can only use hyper-v manager on the host to access the VM and in the VM I can't ping or surf to the web anymore.
What am I doing obviously wrong?
It's probably because you're running NLB in unicast mode with only one NIC in the server. There's actually a warning about this every time you open the NLB management interface:
Running NLB Manager on a system with all networks bound to NLB might not work as expected. If all interfaces are set to run NLB in "unicast" mode, NLB Manager will fail to connect to hosts.
So either use a NLB interface, as your article also suggests, or use multicast mode. Both modes have their pros and cons and it depends on your network infrastructure what mode you should prefer.
Read this: https://docs.microsoft.com/en-us/troubleshoot/windows-client/networking/configure-network-to-support-nlb-operation-mode