How to add IPs at once?

Arthur

New member
Joined
Feb 14, 2004
Messages
2
Hello,

I need to add over thirty IPs to my server. Is there a easy way to do this except use DA IP Manager?
 
Hello,

There isn't a quick add tool at this time... if you are farmiliar with scripting, you could try:
Code:
#!/bin/sh
#this will add IP's 1.2.3.4 - 1.2.3.10
IP_PREFIX=1.2.3.
IP_START=4
IP_END=10

for (( i=$IP_START ; i <= $IP_END ; i++)) ; do
{
     IP=${IP_PREFIX}${i}
     echo "$IP" >> /usr/local/directadmin/data/admin/ip.list

     FILE=/usr/local/directadmin/data/admin/ips/$IP

     echo "gateway=" > $FILE
     echo "netmask=255.255.255.0" >> $FILE
     echo "reseller=" >> $FILE
     echo "status=free" >> $FILE
     echo "value=" >> $FILE
}
done

exit 0;
Then run "service startips start" after you've run that script so that they'll be loaded into the network device.

John
 
Back
Top