- 08 Jul 2022
- DarkLight
CLI Commands for Citrix Load Balancer
- Updated on 08 Jul 2022
- DarkLight
Before you can access your load balancer, please ensure that your Service Delivery team has given you an IP address accessible from your network. Load balancers deployed at Expedient do not generally have a publicly accessible management interface, so you’ll need to be on-net to access it. This page is not intended to be an exhaustive guide on all CLI commands available on a Citrix ADC load balancer. Note that these are some of the most common CLI commands we find our clients need to understand.
Using Putty or a similar SSH client, log into your load balancer using the IP and credentials provided by your Service Delivery team. Once logged in, you will see a “>” prompt.
Show Commands
There are many show commands – here are the most useful:
Show command | Purpose |
Show ns capacity | Shows technical bandwidth limits, as well as the bandwidth limit associated with your license |
Show ns feature | Shows which features are enabled |
Show ns info | Shows version, features, and modes enabled |
Show ns ip | Shows the load balancer’s IP, as well as any SNIPs. There will be one SNIP for management and each of the attached server networks. |
Show ns savedconfig | Shows the entire saved config
|
Show ns runningconfig | Shows the entire running config
|
Show ns stats | Shows basic stats including uptime, resource utilization, thruput, and sessions |
Other Top-Level Commands
Above we saw the “show” term as a top-level command for viewing items. Below are some other top-level commands:
Add | Add a new object to the config |
Bind | Bind the object to other properties
|
Help | Displays help menu |
Ping | Perform a ping |
Quit | Quit out |
Rm | Remove, the opposite of Add |
Save | For saving the config, use “save ns config.” This will copy the runningconfig to the savedconfig |
Set | Set parameters that already exist |
Traceroute | Perform a traceroute |
unbind | The opposite of Bind. Disassociate two or more objects |
Getting familiar with the CLI
If you have many objects bound to a virtual server (as is usually the case), then sometimes your “bind” commands are rather long. Sometimes it’s challenging to try and figure out what part of the bind command to change. An excellent way to learn the ADC CLI is to perform the necessary changes in the GUI, then navigate to the “Saved v/s Running” pane to see the changes made by the CLI on the back end. This feature is located in the System -> Diagnostics category.
This screen shows the necessary CLI commands to implement the changes you’ve made in the configuration, and the CLI commands to undo what you’ve made. I’ve omitted the “saved config” as these bind commands are new; they didn’t exist in any form in the existing config.
This screen shows that we have an existing load balancer (which was added in the previous config change), and I’ve modified the load balance method and backup load balance method. This shows that you can run the “add lb server…” command again with these extra modifiers to change the config. Notice that the “Correction Configuration,” which shows how to revert these changes, specifies the lbMethod of “LEASTCONNECTION.” This is because that is the default lbMethod. So, while it’s not explicitly called out in the “Saved Configuration,” since we set it to something else, it’s easier to set “set it back to default” than doing an “rm lb server Test123” and then another “add lb server Test123.”