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
Jason Samuel is a visionary product leader and trusted advisor with a proven track record of shaping strategy and driving technology innovation. With extensive expertise in enterprise end-user computing, security, cloud, automation, and virtualization technologies, Jason has become a globally recognized authority in the IT industry. His career spans consulting for hundreds of Fortune 500 enterprises across diverse business sectors worldwide, delivering cutting-edge digital solutions from Citrix, Microsoft, VMware, Amazon, Google, and NVIDIA that seamlessly balance security with exceptional user experiences.
Jason’s leadership is amplified by his dedication to knowledge-sharing as an author, speaker, podcaster, and mentor within the global IT and technology community. Recognized with numerous prestigious awards, Jason’s contributions underscore his commitment to advancing technology and empowering organizations to achieve transformative results. Follow him on LinkedIn.
patriot61
July 3, 2010 at 3:09 PM
This helped me fix a routing issue with an older Netscaler. Thanks for posting this.
Jason Samuel
July 3, 2010 at 3:23 PM
@patriot61
You’re welcome!
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?
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
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
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
Michael Switzer
July 18, 2018 at 12:19 AM
thanks for the info – much appreciated
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