How do I mass delete IPs I no longer use on the server (secondary assignment, not prime subnet)

For example I have a specific /27 I want to remove in one shot, instead of one IP at a time via whm delete IPs function

I'm using Cpanel/WHM with Centos 5x

link|improve this question

69% accept rate
feedback

1 Answer

up vote 1 down vote accepted

You can just edit /etc/ips and rebuild the IP address pool in WHM after you are done.

A simple operation might be:

cat /etc/ips | sed '/^192.168.2/d' > /etc/ips.new

.. verify it

mv /etc/ips.new /etc/ips

Not sure on what you have in there in the neighborhood of the subnet you want to remove, so you will probably want to make the regex a bit more precise :)

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.