[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Please help with IP Aliasing



On Thu, Jul 02, 1998 at 11:53:32AM +1000, Craig Sanders wrote:
>firstly, replace all those ifconfig & route commands with something like
>this:
>
>i=1
>while [ $i -le 254 ] ; do
>	ifconfig eth0:$i XXX.231.206.$i netmask 255.255.255.0
>	route add -host XXX.231.206.$i eth0:$i
>	$i=$(( $i + 1 ))
>done
>
>i=1
>for j in $( grep -v "^$\|^#" /etc/virtual-hosts | awk '{print $1}' ) ; do
>	ifconfig eth0:$i $j netmask 255.255.255.0
>	route add -host $j eth0:$i
>	$i=$(( $i + 1 ))
>done
>   
>alternatively, stick another ethernet card in the machine and start using
>eth1:0 - eth1:255 aliases.....the limit is per interface.

andy,
as noted in the last line, the first virtual device number should
start with zero, eth0:0, so if you use one of the cool scripts above
remember that! ( this is noted in the NET3 HOWTO ) furthermore, while
i'll admit i don't use 'make' to manage my virtual hosts on my web 
server ( yet :P ) it is relatively easy to set up a Makefile as
craig has suggested and that would most certainly be the "elegant" 
way to help you manage your 200+ virtual hosts.

good luck!

m* 





--  
Unsubscribe?  mail -s unsubscribe debian-user-request@lists.debian.org < /dev/null


Reply to: