Getting to know Citrix NetScaler CPX

Citrix NetScaler is a commercial load balancer that competes with open source load balancers such as HAProxy and Nginx. NetScaler is available as a container as well, in a product version known as NetScaler CPX. Even better, there is a free version available, called the CPX Express. For the rest of the blog post, I’m using my Mac laptop running OS X Sierra, and Docker for Mac version 1.12.

CPX Express can be installed from the Docker Store.

$ docker pull store/citrix/netscalercpx:11.1-53.11

You should now have the CPX image available:

$ docker images store/citrix/netscalercpx 
REPOSITORY                  TAG                 IMAGE ID
store/citrix/netscalercpx   11.1-53.11          267dfad3a03e        4 weeks ago         413MB

Create a container from this image:

$ docker run -e EULA=yes -dt -p 22 -p 80 --name cpx --ulimit core=-1 --cap-add=NET_ADMIN store/citrix/netscalercpx:11.1-53.11
275626b96389755a88362c8df3ae4851f13e45d22f502b29900612fc2da28444

Determine the SSH port of this running container:

$ docker port cpx 22
0.0.0.0:32849

Login to the NetScaler CPX using the id/password combination of ‘root/linux’:

$ ssh -p 32849 root@127.0.0.1 
The authenticity of host '[127.0.0.1]:32849 ([127.0.0.1]:32849)' can't be established.
ECDSA key fingerprint is SHA256:N3dlhNYbvYjOPkbt9ogrg2fwwUDWPVs8JwvLuE64/RQ.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '[127.0.0.1]:32849' (ECDSA) to the list of known hosts.
root@127.0.0.1's password: 
Welcome to Ubuntu 14.04 LTS (GNU/Linux 3.19.0-39-generic x86_64)

Once logged in, you can execute almost any regular NetScaler CLI command by passing the command to the cli_script.sh script. For example:

root@275626b96389:~# cli_script.sh 'show ip'   
exec: show ip
    Ipaddress        Traffic Domain  Type             Mode     Arp      Icmp     Vserver  State
    ---------        --------------  ----             ----     ---      ----     -------  ------
1)  172.17.0.2       0               NetScaler IP     Active   Enabled  Enabled  NA       Enabled
2)  192.0.0.1        0               SNIP             Active   Enabled  Enabled  NA       Enabled
Done

In the next blog we’ll see how to exercise the CPX’s primary function: load balancing.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s