• The new Python extension is now available. It allows customers to deploy and manage WSGI-based Python applications on their websites directly from Plesk.
  • Debian 11 has reached its end-of-life (vendor EOL date - August 31, 2026). Plesk Obsidian 18.0.81 is the last release to support it.
    If you are running Plesk Obsidian on Debian 11, we recommend you upgrade those servers to Debian 12 using our dist-upgrade tool.
  • We plan to deprecate and remove the support for XML RPC protocol versions earlier than 1.6.9.1 in Plesk Obsidian 18.0.82. We strongly recommend that you update all existing integrations using earlier versions of the XML RPC protocol to comply with the version 1.6.9.1 specification.

Add a block of IPs

CruzMark

Regular Pleskian
Here's a simple (and insecure) perl script that will add a block of IPs to plesk from the command line. I accept no responsibility for its use or mis-use. Since it uses the plesk ipmanage tool, it is unlikely that you'll cause your system to implode.

#!/usr/bin/perl

# This script causes heavy load on the server and takes several minutes
# to run.

# The script assumes that the block is Class C or less.
# IP_SUBNET should be the first three octets of the IP.
# MASK should be in octet form (ex. 255.255.255.0)
#
# See (DIRECTORY)/psa/bin/ipmanage --help for more info

if (@ARGV != 5) {
print "Usage: create_ip_block.pl IP_SUBNET MASK INTERFACE TYPE CERT\n";
exit;
}

# Turn debug 'on' to test script before actually adding IPs!
# $debug = 'on';

# Change count based on the IPs you are trying to add. Settings below
# are for a class C subnet

my $start_count = 1;
my $end_count = 254;

# replace with path to your psa/bin directory. Below is for FreeBSD
my $psa_bin_path = "/usr/local/psa/bin";

my $ip_subnet = $ARGV[0];
my $mask = $ARGV[1];
my $interface = $ARGV[2];
my $type = $ARGV[3];
my $ssl = $ARGV[4];

for ($count="$start_count"; $count <= $end_count; $count++) {
$ip = "$ip_subnet" . "." . "$count";
if ($debug eq 'on') {
print "$psa_bin_path/ipmanage -c $ip -mask $mask -interface $interface -type $type -ssl_certificate $ssl\n";
} else {
`$psa_bin_path/ipmanage -c $ip -mask $mask -interface $interface -type $type -ssl_certificate $ssl`;
}
}
 
Back
Top