Azure load balancer with IPv6 and IPv4 frontend support - azure

Currently my LB has a IPv4 frontend address and one backend pool with 5 VMs with IPv4 private addresses.
We would like to add IPv6 support to our Service Fabric cluster. I found this article: https://learn.microsoft.com/en-us/azure/load-balancer/load-balancer-ipv6-overview and I see a lot of "Currently not supported" texts.
The IPv6 address is assigned to the LB, but I cannot make rules:
Failed to save load balancer rule 'rulename'. Error: Frontend ipConfiguration '/subscriptions/...' referring to PublicIp with PublicIpAddressVersion 'IPv6' does not match with PrivateIpAddressVersion 'IPv4' referenced by backend ipConfiguration '/subscriptions/...' for the load balancer rule '/subscriptions/...'.
When I try to add a new backend pool, I get this message:
One basic SKU load balancer can only be associated with one virtual machine scale set at any point of time
Questions:
When can we expect the feature to have multiple LBs before one VMSS?
Is it possible to add IPv6 frontend without adding IPv6 to the backend (NAT64?)?
Is it possible to add IPv6 addresses to an existing VM scale set without recreating it?

Not sure I am understanding you exactly, It seems that some limitations are in that article.
For your questions:
I guess you mean mapping multiple LB frontends to one backend pool. If so, the same frontend protocol and port are reused across multiple frontends since each rule must produce a flow with a unique combination of destination IP address and destination port. You can get more details about multiple frontend configurations with LB.
It is not possible. The IP version of the frontend IP address must match the IP version of the target network IP configuration.
NAT64 (translation of IPv6 to IPv4) is not supported.
It is not possible, A VM Scale Set is essentially a group of load balanced VMs. There are a few differences between VM and A Vmss, you can refer to this. Also, If a network interface has a private IPv6 address assigned to it, you must add (attach) it to a VM when you create the VM. Read the network interface constraints.
You may not upgrade existing VMs to use IPv6 addresses. You must
deploy new VMs.

Related

How to whitelist source IPs on Azure VMs fronted by Azure Load Balancer

I have a public facing, standard sku, Azure Load Balancer that forwards the incoming requests for a certain port to a virtual machine, using load balancing rules. This virtual machine has a NSG defined at the subnet level, that allows incoming traffic for that port, with source set to as 'Internet'.
Presently, this setup works, but I need to implement whitelisting - to allow only a certain set of IP addresses to be able to connect to this virtual machine, through the load balancer. However, if I remove the 'Internet' source type in my NSG rule, the VM is no longer accessible through the Load Balancer.
Has anyone else faced a similar use case and what is the best way to setup IP whitelisting on VMs that are accessible through Load Balancer. Thanks!
Edit: to provide more details
Screenshot of NSGs
These are the top level NSGs defined at the subnet.
We have a public load balancer that fronts the virtual machine where above NSGs are applied. This virtual machine doesn’t have a specific public IP and relies on the Load Balancer’s public IP.
The public Load Balancer forwards all traffic on port 8443 and port 8543 to this virtual machine, without session persistence and with Outbound and inbound using the same IP.
Below are the observations I have made so far:
Unless I specify the source for NSG rule Port_8443 (in above table) as ‘Internet’, this virtual machine is not accessible on this port, via the load balancer’s public IP.
When I retain the NSG rule Port_8543, which whitelists only specific IP addresses, this virtual machine is not accessible on this port, via the load balancer’s public IP – even when one of those whitelisted clients try to connect to this port.
I tried adding the NSG rule Custom_AllowAzureLoadBalancerInBound, to a higher priority than the port_8543, but it still didn’t open up this access.
I also tried to add the Azure Load balancer VIP (168.63.129.16) to the Port_8543 NSG, but that too didn’t open-up the access to port 8543, on load balancer’s public IP.
I have played with Load Balancing rules options too, but nothing seems to achieve what I am looking for – which is:
Goal 1: to open-up the virtual machine’s access on port 8443 and port 8543 to only the whitelisted client IPs, AND
Goal 2: allow whitelisted client IPs to be able to connect to these ports on this virtual machine, using the load balancer’s public IP
I am only able to achieve one of the above goals, but not both of them.
I have also tried the same whitelisting with a dedicated public IP assigned to the virtual machine; and that too loses connectivity to ports, where I don't assign 'Internet' source tag.
Azure has default rules in each network security group. It allows inbound traffic from the Azure Load Balancer resources.
If you want to restrict the clients to access your clients, you just need to add a new inbound port rule with the public IP address of your clients as the Source and specify the Destination port ranges and Protocol in your specific inbound rules. You could check the client's public IPv4 here via open that URL on your client's machine.
Just wanted to add a note for anyone else stumbling here:
If you are looking to whitelist an Azure VM (available publicly or privately) for few specific client IPs, below are the steps you must perform:
Create a NSG for the VM (or subnet) - if one not already available
Add NSG rules to Allow inbound traffic from specific client IPs on specific ports
Add a NSG rule to Deny inbound traffic from all other sources [This is really optional but will help in ensuring security of your setup]
Also, please note that look at all public IPs that your client machines are planning to connect with. Especially while testing, use public IPs and not the VPN gateway address ranges - which is what we used and ended up getting a false negative of our whitelisting test.

When do dynamic IPv6 addresses for Azure load balancer front-end configurations change?

I need a static ip address for IPv6 on Azure, but it looks like only dynamic IPv6 addresses are supported. I'm wondering about the relative stability of a dynamic IPv6 address for Azure load balancers. How often will it change?
In the Azure Docs, it says that dynamic ip addresses for VMs change when the vm is restarted, stopped, or deallocated. How does this work for load balancers, since they are not restarted or stopped?
If I have a load balancer with an availability set of vms as a backend pool, will the public IPv6 front-end ip configuration be relatively stable even if it's technically "dynamic", as long as I don't change the backend pool?
I'm wondering about the relative stability of a dynamic IPv6 address
for Azure load balancers. How often will it change?
For now, IPv6 allocation static method are not supported.
Any unreserved IP address(IPv4 and IPv6) will remain static if you:
1.Don't delete the public IP object associated with the load balancer.
2.Maintain at least 1 VM in the backend pool.
So, if we don't delete public IP address or disassociate it, and keep a VM running in the backend pool, we will keep the Public IPv6 address(will not change).

IPv6 support for Azure other than the load balancer thing

I have two questions regarding azure and IPv6. I understand that you can assign private IPv6s to VMs and then connect them to a load balance with a public IPv6, but is there anyway to use IPv6 with other resources in Azure, such as, cloud services, virtual networks, Application gateway, NSG, VPN Gateway, App Services, SQL databases, and SQL DWH?
Also,
I see that it says you cannot upgrade VMs to IPv6 and you need to make new ones. Does that mean that you would only have to remake VMs that were created before the time in which IPv6 support was released? Or does it mean you have to remake every VM that wasnt created specifically with the feature of IPv6?
is there anyway to use IPv6 with other resources in Azure, such as,
cloud services, virtual networks, Application gateway, NSG, VPN
Gateway, App Services, SQL databases, and SQL DWH?
Unfortunately, we can't use IPv6 without LB right now, because the public IPv6 addresses cannot be assigned to a VM, they only can be assigned to a load balancer.
The IPv6 address of the VMs are private, the IPv6 Internet client cannot communicate directly with the IPv6 address of the VMs, the internet-facing load balancer routes the IPv6 packages to the private IPv6 addresses of the VMs using network address translation (NAT).
Does that mean that you would only have to remake VMs that were
created before the time in which IPv6 support was released? Or does it
mean you have to remake every VM that wasnt created specifically with
the feature of IPv6?
No, if we want to use IPv6, we should deploy LB and new vms, because we can't add other VMs to the Availability set which used for the LB. so
you may not upgrade existing VMs to use IPv6 addresses. You must deploy new VMs.

Azure external load balaner - Source IP security

I have two VMs being load balanced by an external facing load balancer. I am able to successfully connect to those VM's from the internet through that LB rule.
However, I want to restrict access to that load balancer's public IP address (or more precisely - to the VM's behind it) to a specific source network. So that rather than the entire internet being able to access it, only specific public subnets could use it.
Looking in TCP connection tables on the VM's - it looks like the Azure LB is natting the source IP coming through it. So, my NSG's on the VM guests cannot filter on "SourceIP = Desired Source".
Is there any way to do this in the Resource Manager version of Azure?
The source port and address range are from the originating computer, not the load balancer.
From https://azure.microsoft.com/en-us/documentation/articles/virtual-networks-nsg/#design-considerations (look under "Load Balancers")
Similar to public facing load balancers, when you create NSGs to
filter traffic coming through an internal load balancer (ILB), you
need to understand that the source port and address range applied are
the ones from the computer originating the call, not the load
balancer. And the destination port and address range are related to
the computer receiving the traffic, not the load balancer.
I'm guessing it's using x-forwarded-for and that NSGs understand that. Connection tables don't. They're raw connections and as such show the NAT.

azure multiple public ip for a vm

I want to have three public ip addresses for my VM in azure. I got one when I created the VM and now I want to assign two reserved ip addresses to my VM. I was able to create the reserved ip address but not sure how to assign them to existing VM or assign multiple to a new VM. Any suggestions on how to do this?
In Azure, a Load Balancer is required in order to direct traffic from multiple VIP addresses to a single (or multiple) VMs.
If, for example, you want a single VM to host multiple websites, all of which need to be accessible externally via port 443, you'd need three VIP addresses assigned to the Load Balancer, with a NAT on each at least two of the VIPs; i.e.
Site a: Incoming 443-443 to VM
Site b: Incoming 443-444 to VM
Site c: Incoming 443-445 to VM
All the traffic from the Load Balancer could then be routed to one VM, where you'd direct traffic on each incoming port to the required website based. This MS article explains it really well: https://azure.microsoft.com/en-gb/documentation/articles/load-balancer-multivip/
Reserved IP addresses are a way of ensuring that your VIP is no longer dynamic, which they are by default. The following article explains it well, including how to take an existing Cloud Service's currently-running dynamic VIP and making it static (Reserved): https://azure.microsoft.com/en-gb/documentation/articles/virtual-networks-reserved-public-ip/
An Azure VM can have two public IP addresses - one is the VIP of the cloud service containing the VM (as long as there are endpoints configured for the VM) and the other is the PIP (or public instance IP address) associated with the VM. A reserved IP address is an orthogonal concept to VIPs and PIPs and its use is documented here. I did a post on VIPs, DIPs and PIPs that you may find helpful.

Resources