Saturday, June 2, 2012

Adding ip addresses to WHM


Adding ip addresses to WHM

Either using WHM, or directly editing ipaliases.
via WHM
Straightforward, go to Main >> IP Functions >> Add a New IP Address and it is self explanatory from there

You may add one or more new IPs to the system below. To add multiple IPs, use one of the following IP range formats:

    Class C CIDR (ex.: 192.168.4.128/25)
    IP/netmask (ex.: 192.168.4.128/255.255.255.128)
    IP range (ex.: 192.168.4.128-255)


by editing ipaliases
By entering the ip addresses into /etc/ips The format of the file is as follows:
<ip address>:<subnet mask>:broadcast address
these are colons inbetween.
Example: server with the following ip address information from its Manage page Ip range: 99.198.111.218 - 99.198.111.222 CIDR/29 Gateway: 99.198.111.217 Subnet mask: 255.255.255.248
the only thing missing form the Manage page, is the broadcast address.
The broadcast is usually the last ip address in the range (99.198.111.222) + 1 , that gives 99.198.111.223 (the caveat here is that HSRP ranges are listed differently, you need to really find the broacast address some other way, using a subnet calculator perhaps)



root@server2 [~]# cat /etc/ips
99.198.111.218:255.255.255.248:99.198.111.223
99.198.111.219:255.255.255.248:99.198.111.223
99.198.111.220:255.255.255.248:99.198.111.223
99.198.111.221:255.255.255.248:99.198.111.223
99.198.111.222:255.255.255.248:99.198.111.223

Lastly, restart the ipaliases service, and possibly run the buildippool script:
service ipaliases restart
/scripts/rebuildippool


Verify

/scripts/ipusage
ifconfig