Configuring a load balancer with VMware NSX

Series

This post is part of a series, other related posts are:

Abstract

In this post we'll see how to configure a load balancer on a NSX Edge Router.

Introduction

In the previous post a NAT has been configured to allow access from external networks:

NSX OSPF Topology

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:

Edit Profile

Other options are available when choosing HTTP or HTTPS protocols. Go now to “Pools” and create a new pool with both internal VMs:

Edit Pool

Go to “Virtual Servers” and add a TCP virtual server bound to the TCP_wo_persistence profile and to the SSH_2222_Pool:

Edit Virtual Server

Finally go to “Global Configuration” and enable the load balancer:

Global Configuration

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 ubuntu@172.31.30.21 hostname
ubuntu1
client$ ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 2222 ubuntu@172.31.30.21 hostname
ubuntu3
Posted on 19 Jan 2015 by Andrea.
  • Gmail icon
  • Twitter icon
  • Facebook icon
  • LinkedIN icon
  • Google+ icon