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 (http://www.jasonsamuel.com/2010/06/22/how-to-reset-a-citrix-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 (http://support.citrix.com/article/CTX116742). ZebOS by the way if you are interested is what does the routing on the Netscaler (http://www.ipinfusion.com/products/products_home.html). This is a commercial version of GNU Zebra (http://www.zebra.org). Development on Zebra stopped back in 2005 and Quagga became the successor (http://www.quagga.net). 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
# GLOBIGNORE=”ns-*”
# 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

8 Comments

  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

    @patriot61

    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
    root@ns# 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
    yes

  6. thomas

    November 13, 2017 at 10:16 AM

    hi,

    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

    cheers

  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 *

You May Also Like

Apache

Today I would like to go over proper URL redirection when using SSL but first I would like to preface this by describing what...

Citrix Workspace

You can use FIDO2 hardware security keys plugged into your physical desktop over the Citrix HDX remoting protocol for use with virtualized Windows Desktop...

Exchange 2003

A useful Exchange 2003 guide I wrote for a friend’s blog originally but I am posting it here on mine now for your viewing...

Cloud Design Architecture

The community-driven paperback book initiated by my friends Bas van Kaam and Christiaan Brinkhoff is available for sale on Amazon. If you haven’t picked...

JasonSamuel.com began in 2008 as a way for me to give back to the IT community. This website features the latest news and how-to's on enterprise mobility, security, virtualization, cloud architecture, and other technologies I work with. This website has evolved over time to become a go-to reference hub for these technologies. It receives hundreds of thousands of unique visitors from all over the world each month. More details on the About Me page.
Copyright © 2008-2023 JasonSamuel.com

Exit mobile version