Add IP addresses

This function adds an IPv4 address or addresses to the server. When you add an IP address, the system attempts to add an alias of that IP address to the main network interface. This process rebuilds the IP address pool, which resides in the /etc/ipaddrpool file. The system stores IP addresses within the /etc/ips file. The ipaliases service activates those IP addresses when the server starts.

SecurityBasicAuth
Request
query Parameters
ips
required
string

The IPv4 address or address range in Class C CIDR format.

Examples:
ips=192.168.0.0
ips=192.168.0.20/28
netmask
required
string <ipv4>

The IPv4 address' netmask.

Note:

If the ips parameter is in Class C CIDR format, the range mask must be a value from 24 through 30.

Example: netmask=255.255.255.0
excludes
string

An IPv4 address or comma-delimited list of IPv4 addresses to exclude.

Note:

If you do not specify a value, the function does not exclude any IPv4 addresses.

Examples:
excludes=excludes=192.0.20.0,192.0.20.1
excludes=192.0.20.0
Responses
200

HTTP Request was successful.

Response Schema: application/json
object
get/addips
Request samples
whmapi1 --output=jsonpretty \
  addips \
  ips='192.168.0.0' \
  netmask='255.255.255.0'
Response samples
application/json
{
  • "metadata": {
    • "command": "addips",
    • "output": {
      • "messages": [
        • "eth0:cp1 is now up. 192.168.0.20/255.255.255.0 broadcast 192.168.0.255 has been added."
        ]
      },
    • "reason": "Success",
    • "result": 1,
    • "version": 1
    }
}