Skip to content

Commit 07b8139

Browse files
authored
Merge pull request #201642 from brianlehr/newbranch
modify floating IP page
2 parents 11dea09 + e2dcc28 commit 07b8139

File tree

1 file changed

+60
-16
lines changed

1 file changed

+60
-16
lines changed

articles/load-balancer/load-balancer-floating-ip.md

Lines changed: 60 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,49 +26,93 @@ Some application scenarios prefer or require the same port to be used by multipl
2626

2727
If you want to reuse the backend port across multiple rules, you must enable Floating IP in the rule definition.
2828

29-
When Floating IP is enabled, Azure changes the IP address mapping to the Frontend IP address of the Load Balancer frontend instead of backend instance's IP.
30-
31-
Without Floating IP, Azure exposes the VM instances' IP. Enabling Floating IP changes the IP address mapping to the Frontend IP of the load Balancer to allow for more flexibility. Learn more [here](load-balancer-multivip-overview.md).
29+
When Floating IP is enabled, Azure changes the IP address mapping to the Frontend IP address of the Load Balancer frontend instead of backend instance's IP. Without Floating IP, Azure exposes the VM instances' IP. Enabling Floating IP changes the IP address mapping to the Frontend IP of the load Balancer to allow for more flexibility. Learn more [here](load-balancer-multivip-overview.md).
3230

3331
Floating IP can be configured on a Load Balancer rule via the Azure portal, REST API, CLI, PowerShell, or other client. In addition to the rule configuration, you must also configure your virtual machine's Guest OS in order to use Floating IP.
3432

3533
## Floating IP Guest OS configuration
36-
For each VM in the backend pool, run the following commands at a Windows Command Prompt.
34+
35+
In order to function, the Guest OS for the virtual machine needs to be configured to receive all traffic bound for the frontend IP and port of the load balancer. To accomplish this requires:
36+
* a loopback network interface to be added
37+
* configuring the loopback with the frontend IP address of the load balancer
38+
* ensure the system can send/receive packets on interfaces that do not have the IP address assigned to that interface (on Windows, this requires setting interfaces to use the "weak host" model; on Linux this model is normally used by default)
39+
The host firewall also needs to be open to receiving traffic on the frontend IP port.
40+
41+
> [!NOTE]
42+
> The examples below all use IPv4; to use IPv6, substitute "ipv6" for "ipv4". Also note that Floating IP for IPv6 does not work for Internal Load Balancers.
43+
44+
### Windows Server
45+
46+
<details>
47+
<summary>Expand</summary>
48+
49+
For each VM in the backend pool, run the following commands at a Windows Command Prompt on the server.
3750

3851
To get the list of interface names you have on your VM, type this command:
3952

4053
```console
41-
netsh interface show interface
54+
netsh interface ipv4 show interface
4255
```
4356

44-
For the VM NIC (Azure managed), type this command:
57+
For the VM NIC (Azure managed), type this command.
4558

4659
```console
4760
netsh interface ipv4 set interface “interfacename” weakhostreceive=enabled
4861
```
62+
(replace **interfacename** with the name of this interface)
63+
64+
For each loopback interface you added, repeat the commands below.
65+
66+
```console
67+
netsh interface ipv4 add addr "loopbackinterface" floatingip floatingipnetmask
68+
netsh interface ipv4 set interface "loopbackinterface" weakhostreceive=enabled weakhostsend=enabled
69+
```
70+
(replace **loopbackinterface** with the name of this loopback interface and **floatingip** and **floatingipnetmask** with the appropriate values, e.g. that correspond to the load balancer frontend IP)
4971

50-
(replace interfacename with the name of this interface)
72+
Finally, if firewall is being used on the guest host, ensure a rule set up so the traffic can reach the VM on the appropriate ports.
5173

52-
For each loopback interface you added, repeat these commands:
74+
A full example configuration is below (assuming a load balancer frontend IP configuration of 1.2.3.4 and a load balancing rule for port 80):
5375

5476
```console
55-
netsh interface ipv4 set interface “interfacename” weakhostreceive=enabled
77+
netsh int ipv4 set int "Ethernet" weakhostreceive=enabled
78+
netsh int ipv4 add addr "Loopback Pseudo-Interface 1" 1.2.3.4 255.255.255.0
79+
netsh int ipv4 set int "Loopback Pseudo-Interface 1" weakhostreceive=enabled weakhostsend=enabled
80+
netsh advfirewall firewall add rule name="http" protocol=TCP localport=80 dir=in action=allow enable=yes
5681
```
82+
</details>
5783

58-
(replace interfacename with the name of this loopback interface)
84+
### Ubuntu
85+
86+
<details>
87+
<summary>Expand</summary>
88+
89+
For each VM in the backend pool, run the following commands via an SSH session.
90+
91+
To get the list of interface names you have on your VM, type this command:
92+
93+
```console
94+
ip addr
95+
```
96+
For each loopback interface, repeat these commands, which assigns the floating IP to the loopback alias:
5997

6098
```console
61-
netsh interface ipv4 set interface “interfacename” weakhostsend=enabled
99+
sudo ip addr add floatingip/floatingipnetmask dev lo:0
62100
```
101+
(replace **floatingip** and **floatingipnetmask** with the appropriate values, e.g. that correspond to the load balancer frontend IP)
102+
103+
Finally, if firewall is being used on the guest host, ensure a rule set up so the traffic can reach the VM on the appropriate ports.
63104

64-
(replace **interfacename** with the name of this loopback interface)
105+
A full example configuration is below (assuming a load balancer frontend IP configuration of 1.2.3.4 and a load balancing rule for port 80). This example also assumes the use of [UFW (Uncomplicated Firewall)](https://www.wikipedia.org/wiki/Uncomplicated_Firewall) in Ubuntu.
65106

66-
> [!IMPORTANT]
67-
> The configuration of the loopback interfaces is performed within the guest OS. This configuration is not performed or managed by Azure. Without this configuration, the rules will not function.
107+
```console
108+
sudo ip addr add 1.2.3.4/24 dev lo:0
109+
sudo ufw allow 80/tcp
110+
```
111+
</details>
68112

69113
## <a name = "limitations"></a>Limitations
70114

71-
- Floating IP is not currently supported on secondary IP configurations for Load Balancing scenarios. This does not apply to Public load balancers with dual-stack configurations or to architectures that utilize a NAT Gateway for outbound connectivity.
115+
- Floating IP isn't currently supported on secondary IP configurations for Load Balancing scenarios. This doesn't apply to Public load balancers with dual-stack configurations or to architectures that utilize a NAT Gateway for outbound connectivity.
72116

73117
## Next steps
74118

@@ -77,4 +121,4 @@ netsh interface ipv4 set interface “interfacename” weakhostsend=enabled
77121
- Learn more about [Azure Load Balancer](load-balancer-overview.md).
78122
- Learn about [Health Probes](load-balancer-custom-probe-overview.md).
79123
- Learn about [Standard Load Balancer Diagnostics](load-balancer-standard-diagnostics.md).
80-
- Learn more about [Network Security Groups](../virtual-network/network-security-groups-overview.md).
124+
- Learn more about [Network Security Groups](../virtual-network/network-security-groups-overview.md).

0 commit comments

Comments
 (0)