How to Whitelist Multiple IPs in Imunify360 Using a Text File
When managing server security with Imunify360, you may occasionally need to whitelist several IP addresses at once. For example, trusted partners, internal monitoring systems, or known clients. Instead of adding each IP manually, you can automate the process using a simple text file and a one-line command. Imunify360 allows you to whitelist IPs or Subnets of all sizes.
Step 1: Create a List of IPs
Open your preferred text editor (such as nano or vim) and create a file named list.txt that contains all the IP addresses you want to whitelist, one per line. For example:
Then paste or type your IPs or networks like this:
Save and close the file.
Step 2: Run the Whitelist Command
Once your list is ready, execute the following command to add each IP in the file to Imunify360’s local whitelist:
Here’s what each part of this command does:
-
cat list.txt– Reads and outputs the content oflist.txt. -
xargs -n 1– Passes each line (each IP address) as a separate argument to the next command. -
imunify360-agent ip-list local add– The Imunify360 command that adds an IP to the local whitelist. -
--purpose white– Specifies that the purpose of adding the IP is to whitelist it (trust traffic from this IP).
This structure ensures that every IP from your text file is processed and added individually, reducing the chance of syntax or parsing errors.
Step 3: Verify the Whitelisted IPs
To confirm that the IPs were added correctly, you can list all locally whitelisted IPs with:
You should see each IP from your list.txt file in the results.
Optional: Removing IPs Later
If you need to remove one or more IPs from the whitelist, you can use a similar method:
Pro Tips
-
Keep a dated backup of your whitelist file (
list_2025-10-16.txt) for record-keeping. -
For large IP sets, consider logging the output of the command for troubleshooting:
-
Always double-check IPs before whitelisting — allowing a compromised IP could expose your system.