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.
ips required | string The IPv4 address or address range in Class C CIDR format. ips=192.168.0.0 ips=192.168.0.20/28 |
netmask required | string <ipv4> The IPv4 address' netmask. Note: If the 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. excludes=excludes=192.0.20.0,192.0.20.1 excludes=192.0.20.0 |
HTTP Request was successful.
object |
whmapi1 --output=jsonpretty \ addips \ ips='192.168.0.0' \ netmask='255.255.255.0'
{- "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
}
}