This post is part of a series, other related posts are:
- 26 Mar 2015 - Site to Site IPSEC VPN between NSX Edge and Linux strongSwan: The following post will show how to configure a L3 VPN between VMware NSX Edge and a Linux box with strongSwan.
- 10 Feb 2015 - VXLAN on VMware NSX: VTEP, proxy, Unicast/Multicast/Hybrid mode: Virtual Extensible LAN (VXLAN) is a network which help to build an overlay network and it's the base of network virtualization. In simple words, VXLAN encapsulates Ethernet frames on a UDP routable packet. With VXLAN a single L2 segment can span L3 boundaries. Moreover VXLAN overcomes VLAN limits: 802.1q standard define a maximum of 4094 VLANs, VXLAN define a maximum of 2^24 VNIs (VXLAN Network Identifier).
- 19 Jan 2015 - Configuring NAT and firewall on a NSX Edge Router: In this post we'll see how to configure NAT and firewall policies on a NSX Edge Router.
- 19 Jan 2015 - Configuring a load balancer with VMware NSX: In this post we'll see how to configure a load balancer on a NSX Edge Router.
- 15 Jan 2015 - Connecting Edge Router to physical LAN using VMware NSX: In this post we'll see how to connect an Edge Router to a physical LAN.
In this post we'll see how to configure a load balancer on a NSX Edge Router.
In the previous post a NAT has been configured to allow access from external networks:
Now the edge router will act as a load balancer too: connection to the edge router with destination port 2222 will be balanced on both internal VM using the port 22.
Go to “Networking & Security -> NSX Edges”, double click over the edge router and go to “Load Balancer -> Application Profiles”. Add a new TCP profile:
Other options are available when choosing HTTP or HTTPS protocols. Go now to “Pools” and create a new pool with both internal VMs:
Go to “Virtual Servers” and add a TCP virtual server bound to the TCP_wo_persistence profile and to the SSH_2222_Pool:
Finally go to “Global Configuration” and enable the load balancer:
Remind that the firewall must allow connection to the load balancer IP address.
Now SSH connection from external networks to the IP address of the edge router using the port 2222 will be balanced to both VMs using a round-robin algorithm:
client$ ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 2222 firstname.lastname@example.org hostname ubuntu1 client$ ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 2222 email@example.com hostname ubuntu3