MDLog:/sysadmin

The Journal Of A Linux Sysadmin

CPanel: Adding a Range of IPs Using WHM

| Comments

This is just a short note showing how you can add a range of IPs in Cpanel/WHM accompanying my previous post “Linux Tips: How to quickly bind a range of IPs on RedHat based systems”. This can be easily done using the WHM interface: go to IP Functions/Add a New IP Address. Here you can choose the “Ip(s) to add” and the Subnet Mask. To add the same IPs shown in the previous post 192.168.0.100-192.168.0.200 you will just have to enter: Ip(s) to add: 192.168.0.100-200 Subnet Mask: 255.255.255.0 and click on “Do it”. This will add all the IPs in the range to the system.

In the background CPanel will add for each IP a line in the file /etc/ips:

/etc/ips
192.168.0.100:255.255.255.0:192.168.0.255
192.168.0.101:255.255.255.0:192.168.0.255
...etc

The IPs are then configured using the CPanel startup script called ipaliases (/etc/init.d/ipaliases). So keep in mind that you have to leave this to automatically start at system boot if you want your IPs managed by CPanel to be automatically configured at system start (and normally you will want that). This script is enabled by default, but I just wanted to explain its use so you will not turn it off by mistake.

Comments