NetScaler Load Balance multiple ports on same vServer

Have you ever created different Load Balancing Virtual Servers for the same service because multiple ports are required? Fancy sending multiple or ranges of ports through the same vServer instead? This is also possible and easy to implement.

As a result, I’ve produced this quick post just to show how it is possible.

When you are creating a Load Balancing Virtual Server, choose ANY under Protocol or you can choose TCP/HTTP etc. if for example you are working with multiple ports using the same protocol. Under Port type *. Continue on with the creation of the LB vServer.

1-minWhen you have the Load Balancing Virtual Server configured how you like, click on the edit icon next to Basic Settings. 2-minThe requirement is to create a listen policy so the Load Balancing Virtual Server only listens on specific ports that you specify. Use a command such as CLIENT.TCP.DSTPORT.EQ(8080) || CLIENT.TCP.DSTPORT.EQ(80). You can add as many ports as you like. Click Continue. 3-minNow the Virtual Server will only listen and answer on ports 8080 and 80. 4-min

If you have a range of ports you can use a command such as CLIENT.TCP.DSTPORT.BETWEEN(8080, 8090).


6 Comments

  • J. Hoffmann

    January 13, 2017

    Hi George,

    found a link to your site with Carl’s weekly news. First of all: great work, we all need guys like you and Carl, otherwise we mostly won’t be able to implement all those Citrix products and components! Thumbs up, indeed!

    I’m with NetScaler since 2008 and in the meantime part of the PTEC community, but never knew about that feature desrcibed above. It’ll really help me (and so others) in the future.

    Again, I really appreciate your work – many thanks for sharing, btw.

    Regards,
    Jochen (https://www.linkedin.com/in/jochenhoffmann).

    Reply
  • George Spiers

    January 13, 2017

    Hi Jochen

    Thanks for your comment and glad I can be of help! You are right, community produced information is critical and it’s great that we can all help each other.

    Take care

    Reply
  • Joe Khalil

    April 5, 2017

    Hi George
    Will this method map the port to the server at the back-end using that port?

    example: I create a LBVS with ANY protocol and * for ports then specify 9834 and 9835 in the policy. I then bind server A which uses service port as 9834 and server B with service that uses port 9835. Will traffic then be directed to specific servers? thanks

    Reply
  • George Spiers

    April 6, 2017

    Hi Joe if both servers listen on unique ports i.e. Server A listens on port 9834 but does not listen on port 9835, you’ll need to create a two vServers for each port. This method is for servers that use multiple ports together, so the vServer has a port of * and the services also have a port of *.

    Reply
    • Joe Khalil

      April 6, 2017

      thank you, yes indeed both servers listen on different ports. server A on 9834 only and server B on 9835 only. I tried the ANY protocol on the Load balancer side with * for ports and on the service for server A I put the port as 9834 and the service for server B port 9835 and tested connection and if I came in on 9835 I was still getting directed to Server A. So there is no port mapping using this method. I think my route will be a content switch server. thanks for your help!

      Reply
  • Alex Chen

    June 6, 2017

    very like!
    Thank you!

    Reply

Leave a Reply