You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/load-balancer/load-balancer-floating-ip.md
+60-16Lines changed: 60 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,49 +26,93 @@ Some application scenarios prefer or require the same port to be used by multipl
26
26
27
27
If you want to reuse the backend port across multiple rules, you must enable Floating IP in the rule definition.
28
28
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).
32
30
33
31
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.
34
32
35
33
## 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.
37
50
38
51
To get the list of interface names you have on your VM, type this command:
39
52
40
53
```console
41
-
netsh interface show interface
54
+
netsh interface ipv4 show interface
42
55
```
43
56
44
-
For the VM NIC (Azure managed), type this command:
57
+
For the VM NIC (Azure managed), type this command.
45
58
46
59
```console
47
60
netsh interface ipv4 set interface “interfacename” weakhostreceive=enabled
48
61
```
62
+
(replace **interfacename** with the name of this interface)
63
+
64
+
For each loopback interface you added, repeat the commands below.
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)
49
71
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.
51
73
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):
53
75
54
76
```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
(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:
59
97
60
98
```console
61
-
netsh interface ipv4 set interface “interfacename” weakhostsend=enabled
99
+
sudo ip addr add floatingip/floatingipnetmask dev lo:0
62
100
```
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.
63
104
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.
65
106
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>
68
112
69
113
## <aname = "limitations"></a>Limitations
70
114
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.
0 commit comments