18 February, 2021 #Citrix

Converting Citrix ADC policies with NSPEPI

If you are planning on upgrading your Citrix ADC from any version below Citrix ADC 12.0 build 56.20, you might need to update your ‘Classic policies’ as these will be deprecated from that version forward.

NSPEPI, a tool by Citrix and available from the Citrix ADC CLI can help us upgrade any classic policies. NSPEPI is capable of upgrading just one policy, or the whole nsconfig file alike.

Please note that NSPEPI is only available from the ‘Shell’.
To enter shell mode connect to your Citrix ADC with SSH and after logging in enter ‘Shell’.



I will show you two examples in this guide:
1. The conversion of a classic policy
2. The conversion of the whole nsconfig file



Syntax Input:
nspepi (-e "classic expression" | -f "ns config file") (-v)

*Max expression length = 1449



Syntax Output:

<Converted advanced expression> | <Convertered ns config>




Converting a Classic Policy

It’s rather simple really. Take the classic policy that you want to convert and copy it to a notepad (or make sure it’s available under your clipboard).

My classic policy will be the all time favorite ‘NS_True’
The same Advanced Expression for that is just ‘TRUE’.

The syntax for converting a classic policy is:

nspepi -e "policy"

So for my policy it would be:

nspepi -e "ns_true"

Comes out as expected!

Converting the NSConfig File

NSPEPI can also conver the whole NSConfig (ns.conf) file for you.
Not to worry that it’s not the actual file that is being upgraded, a second file is generated with the converted policies for you to review. Still, I would recommend to keep an offline backup of the file during the change period.NSPEPI also creates a warning file /nsconfig/warn_ns.conf. Be sure to read it when the conversion is done.

The syntax for the conversion is as follows:

nspepi -f /nsconfig/ns.conf

After entering I got no real confirmation that the conversion was succeeded. I believe that does happen on some versions though. However, the files are created!

Upon opening the warning file, no errors/warnings were mentioned.
The new_ns.conf file however was as expected a ns.conf file.

After reviewing the new file, you can rename the ns.conf file to ns.conf.old and rename the new_ns.conf to ns.conf.

You can do this with the following syntax:

mv <current file name> <new file name>

Now proceed with a warm reboot

Exit   (to exit the shell)
reboot -warm

You should be good to go now! :).

0 Comments on Converting Citrix ADC policies with NSPEPI

Leave a Comment

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

You Might Be Interested In