Citrix NetScaler

How to REALLY set a NetScaler back to factory defaults (factory new condition)


This is my follow-up to my original article on setting a Netscaler back to factory defaults ( The instructions I provided wiped the config but what about if your actual Netscaler system is corrupted and you need to bring it back to factory new conditions? Well here is the procedure which is also outlined here on CTX116742 ( ZebOS by the way if you are interested is what does the routing on the Netscaler ( This is a commercial version of GNU Zebra ( Development on Zebra stopped back in 2005 and Quagga became the successor ( A lot of network appliances out there are based on these two.

1. After completing the following steps, the NetScaler will have no configuration left and will be ready for the next installation or environment. Connect to the device using the serial console or with a Secure Shell client (SSH). Delete the system, routing, and SSL configuration:

> shell
# cd /etc
# for file in *; do
# rm /nsconfig/$file 2> /dev/null
# done
(Ignore warnings about files or directories missing. Not all files in /nsconfig are present in /etc)
# cd /nsconfig
# rm ns.conf* ZebOS.conf rc.conf
(Ignore warnings about files or directories missing)
# cd ssl
# rm *
# exit
> reboot

2. Perform an initial system configuration. Connect to the device using the serial console:

> set ns config –ipaddresss nsip -netmask netmask
> save config
> reboot

About Jason Samuel

Jason Samuel lives in Houston, TX with a primary focus on strategic advisory and architecture of end-user computing, security, enterprise mobility, virtualization, and cloud technologies from Citrix, Microsoft, & VMware. He also has an extensive background in web architecture and networking over his 20+ year career in IT. He is an Author, Speaker, and Local User Group Community Leader. He is certified in several technologies and is 1 of 63 people globally that is a recipient of the prestigious Citrix Technology Professional (CTP) award. He is 1 of 42 people in the world that has been awarded as a VMware EUC Champion and VMware vExpert. He is a featured author on DABCC which provides the latest IT Community News on Cloud, Data Center, Desktop, Mobility, Security, Storage, & Virtualization. In his spare time Jason enjoys writing how-to articles and evangelizing the technologies he works with. Disclaimer: The content and opinions expressed in articles and posts are his own and are by no means associated with his employer.

Recommended for you


  1. patriot61

    July 3, 2010 at 3:09 PM

    This helped me fix a routing issue with an older Netscaler. Thanks for posting this.

  2. Jason Samuel

    July 3, 2010 at 3:23 PM


    You’re welcome!

  3. joebonsai

    December 28, 2016 at 8:56 PM

    this is old news – does it still work on newer firmware?
    Has anyone tested it on NS 11?

  4. Frank

    March 3, 2017 at 4:30 AM

    Thank you for this, I mis-typed the gateway when doing initial config of a Netscaler and could not find how to change the gateway after. This worked perfectly to get me back to square 1

  5. thomas

    November 9, 2017 at 6:48 AM

    actually, it seems there’s another (simpler and cleaner) way:

    > shell
    [email protected]# cd /flash/.recovery; sh rc.system_wipe_and_reset X Y
    Platform SYSID = XXXXX

    >>> Running this script is dangerous. It will destroy all <<>> customer data on this NetScaler, including the licenses. <<>> If something goes wrong, the box may be rendered unbootable, <<>> and would need to be returned to Citrix for remanufacturing. <<>> <<>> Are you absolutely sure you want to run this script? <<<

    Enter yes to continue, no to exit

  6. thomas

    November 13, 2017 at 10:16 AM


    cleaner and easier way to do full factory reset would be to use the wipe script on the flash card:

    cd /flash/.recovery; sh rc.system_wipe_and_reset 3 3


  7. Michael Switzer

    July 18, 2018 at 12:19 AM

    thanks for the info – much appreciated

  8. Sebastian

    February 11, 2019 at 6:52 AM

    The solution with the script sounds like an easy one.
    But are you sure it is available on all Netscalers?
    /flash/.recovery does not exist on our MPX 5500

Leave a Reply

Your email address will not be published. Required fields are marked *