The NSX Advanced Load Balancer supports configuration of static private IP address and public IP address for virtual service in the Azure cloud. The steps to configure private IP address and public IP address are discussed in this topic.

Creating a Virtual Service with Static Private and Public IP Address

Log in to the NSX Advanced Load Balancer CLI and use the configure vsvip <vsvip name> command to associate the virtual service with a public IP address and a private IP address.

[admin:10-10-10-1]: > configure vsvip vsvip1
[admin:10-10-10-1]: vsvip> use_standard_alb
[admin:10-10-10-1]: vsvip> vip
New object being created
[admin:10-10-10-1]: vsvip:vip> subnet_uuid rahulr-subnet
[admin:10-10-10-1]: vsvip:vip> ip_address 10.145.130.20
[admin:10-10-10-1]: vsvip:vip> floating_ip <floating_ip>
[admin:10-10-10-1]: vsvip:vip> save
[admin:10-10-10-1]: vsvip> save
[admin:10-10-10-1]: > configure virtualservice vs1
[admin:10-10-10-1]: virtualservice> pool_ref vs-pool
[admin:10-10-10-1]: virtualservice> services port 80
New object being created
[admin:10-10-10-1]: virtualservice:services> save
[admin:10-10-10-1]: virtualservice> vsvip_ref vsvip1
[admin:10-10-10-1]: virtualservice> save

Changing Private IP Allocation Type from Auto Allocate to Static IP

Log in to the NSX Advanced Load Balancer CLI and perform the following changes:

  • Set an index value for the virtual service.

  • Set the value of avi_allocated_vip and auto_allocate_ip to No and configure the required private IP address.

[admin:10-10-10-1]: > configure vsvip vsvip1
[admin:10-10-10-1]: vsvip> vip index 1
[admin:10-10-10-1]: vsvip:vip> no avi_allocated_vip
[admin:10-10-10-1]: vsvip:vip> no auto_allocate_ip
[admin:10-10-10-1]: vsvip:vip> ip_address 10.145.130.111
[admin:10-10-10-1]: vsvip:vip> save
[admin:10-10-10-1]: vsvip> save

Changing Public IP allocation type from Static to Auto allocate

Log in to the NSX Advanced Load Balancer CLI and perform the following changes:

  • Set an index value for the virtual service.

  • Configure the required subnet_uuid once the auto_allocate_ip flag is enabled. Use the no ip_address command to set the public IP address allocation from static to auto allocate.

[admin:10-10-10-1]: > configure vsvip vsvip1
[admin:10-10-10-1]: vsvip> vip index 1
[admin:10-10-10-1]: vsvip:vip> no avi_allocated_fip
[admin:10-10-10-1]: vsvip:vip> auto_allocate_floating_ip
[admin:10-10-10-1]: vsvip:vip> no floating_ip
[admin:10-10-10-1]: vsvip:vip> save
[admin:10-10-10-1]: vsvip> save
Note:

Changing public IP allocation type from auto allocate to static is not allowed.

Configuring VS VIP Using Avi CLI for Azure Cloud

Login to Avi CLI, use the configure vsvip command to provide the necessary configuration objects to configure VS VIP for a virtual service deployed in an Azure cloud.

[admin:10-10-10-1]: > configure vsvip azure-vs-vip
[admin:10-10-10-1]: vsvip> vrf_context_ref global
Multiple objects found for this query.
    [0]: vrfcontext-5cec2262-7d8d-4b5d-b5a5-594dc8ab46f4#global in tenant admin, Cloud Default-Cloud
    [1]: vrfcontext-696bf48d-386b-4ec3-bd48-8b56909da66a#global in tenant admin, Cloud azure-cloud
Select one: 1
[admin:10-10-10-1]: vsvip> cloud_ref azure-cloud
[admin:10-10-10-1]: vsvip> vip
New object being created
[admin:10-10-10-1]: vsvip:vip> vip_id 1
[admin:10-10-10-1]: vsvip:vip> ipam_network_subnet
[admin:10-10-10-1]: vsvip:vip:ipam_network_subnet> subnet 10.95.0.0/24
[admin:10-10-10-1]: vsvip:vip:ipam_network_subnet> subnet_uuid avi-vnet-1
[admin:10-10-10-1]: vsvip:vip:ipam_network_subnet> save
 
[admin:10-10-10-1]: vsvip:vip> subnet 10.95.0.0/24
[admin:10-10-10-1]: vsvip:vip> subnet_uuid avi-vnet-1
[admin:10-10-10-1]: vsvip:vip> auto_allocate_ip_type v4_only
[admin:10-10-10-1]: vsvip:vip> auto_allocate_ip
[admin:10-10-10-1]: vsvip:vip> avi_allocated_vip
[admin:10-10-10-1]: vsvip:vip> save
[admin:10-10-10-1]: vsvip> save