3

I want to access my VM (the SQL Server instance to be specific) via 2 different IP addresses, one for internal use and one specific IP requested by a client that they will use. In my virtual network I need 2 different address spaces because the IP's are far apart. I also need 2 subnets then as far as I know (subnet A and subnet B).

In my internal load balancer I added both IP's (in different subnets) as frontend IP's, and added a rule to forward the traffic to my SQL Server VM instance (which is in subnet A). The rules are for different ports, but SQL Server is listening on both ports so the port thing works.

However...I can't connect via the 2nd (client requested IP), even if I switch the ports around, so it is the IP itself that's causing issues, perhaps because it is in subnet B and the VM is in subnet A? that would make sense because the first IP that is in the address space of subnet A does work?

In my load balancer rule I can specify the target VM and network adapater for both rules, so I would think the 2 subnets wouldn't be a problem.

My configuration -------

1 (internal) loadbalancer:

frontend IP's:

 10.4.2.250 (in subnet A, and addressspace 1)
 172.4.2.1 (in subnet B, and addressspace 2)

Backendpools (1 pool):

1 VM, in subnet A

Healthprobes (1 probe):

1 probe, TCP port 1440

Load balancing rules:

TCP 1440 to backendpool port 1440 with probe 1440
TCP 1450 to backendpool port 1450 with probe 1440

My MSSQL instance is configured via the Sql Server Configuration Manager > SQL Server Network Configuration > Protocols for MyInstance > TCP/IP properties

  Protocol -> Enabled = Yes, Listen All = Yes

  IP Addresses -> for all fields with 'TCP Port' = 1440,1450
user2713516
  • 2,983
  • 5
  • 23
  • 49

1 Answers1

0

According to your description, we can use internal load balancer to add two internal IP addresses to one VM.

However...I can't connect via the 2nd (client requested IP)as frontend IP's, and added a rule to forward the traffic to my SQL Server VM instance (which is in subnet A). The rules are for different ports, but SQL Server is listening on both ports so the port thing works

All the VMs in the same Vnet? you create a internal load balancer, so all VMs should in the same Vnet, only in the same Vnet, other VM can communicate with the internal load balancer.

The SQL server is listening on bouth ports so the port thing works.

Have you configure it correctly? maybe we should test it. create a VM in the same Vnet with SQL Server, then use this VM to connect SQL Server with different ports. if it works, it means we should check load balancer configure, or we will check the SQL server port settings.

About internal Load balancer, we can add multiple frontend IP addresses(same Vnet, different subnets) in it.

In my test, I configure a web server on it, and listening on two ports (80 and 8080), I add two internal IP addresses in it:
frontend IP pool: sub1 10.0.1.5 sub2 10.0.2.9
backend pools: VM1 10.0.1.4
Health probes: TCP port 80
Load balancer rules:
1.sub1 front IP address 10.0.1.5 port 80
2.sub2 front IP address 10.0.2.9 port 8080

Then I create a VM in subnet2, and test the internal load balancer, with different frontend IP addresses with different ports, it works for me.

Jason Ye
  • 13,710
  • 2
  • 16
  • 25
  • @user2713516 Does sub1 and sub2 in the same virtual network? – Jason Ye Apr 04 '17 at 07:35
  • @user2713516 can you use SSMS tool to access two ports in the VM? – Jason Ye Apr 04 '17 at 07:38
  • Yes all in the same Vnet, I can access the 2 ports in the VM, but only using the IP from the same subnet that the VM is in – user2713516 Apr 04 '17 at 07:40
  • what settings in particular? – user2713516 Apr 04 '17 at 07:45
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/139824/discussion-between-jason-ye-msft-and-user2713516). – Jason Ye Apr 04 '17 at 07:45
  • @JasonYe-MSFT: In case of Internel load balancer, all the VMs in the backend pool should be part of the same VNET. Does that apply to Internet load balancer as well? If VMs from multiple VNets can be added to backend pool of internetLB, then should the VNETs be in the same subscription as the LB? – girip11 Jan 16 '18 at 09:19
  • 1
    @girip11 No, we can't add VMs in different vnets to LB backend, single VM or availability set can be add in to LB backend. – Jason Ye Jan 16 '18 at 09:23
  • @JasonYe-MSFT: And an availability set can host VMs from only one VNet. Is that correct? And does the same is applicable to application gateways, (i.e) App gateways can have VMs from the same VNET as itself in its backend pool? – girip11 Jan 16 '18 at 10:02
  • @girip11 yes, only vnet. – Jason Ye Jan 17 '18 at 02:30