User Tools

Site Tools


ip_alias_script_for_debian

Script to Add multiple IP to Debian

This script add all IP in single file as an alias

| /etc/network/ip_range
192.168.1.4
192.168.1.5
192.168.1.7
192.168.1.8
192.168.1.11
10.10.1.34
10.10.1.23
| /etc/network/ipalias.sh
#!/bin/bash
i=0;
while read ip
do
/sbin/ifconfig eth0:${i} $ip netmask 255.255.255.240 up
let i=$i+1
done < /etc/network/ip_range
chmod 755 /etc/network/ipalias.sh

execute script in cron @reboot or /etc/rc.local

ip_alias_script_for_debian.txt · Last modified: 2010/09/28 17:56 by k2patel