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

Re: IP aliasing



On Thu, Sep 11, 1997 at 03:30:18PM +1000, Terry Dawson wrote:
: Maarten Boekhold wrote:
: 
: > I tried to steup an IP alias on a machine here. According to the
: > Virtual-Web mini-HOWTO, I can do:
: > 
: > ifconfig eth0 alias new-address
: > 
: > However, ifconfig says 'alias' is not a hostname. 'man ifconfig' doesn't
: > say anything about aliasing. This is with netbase 2.13-1.
: > 
: > Anybody who can get me goin' on this?
: 
: NET-3-HOWTO, but more specifically:
: 
: ifconfig eth0 myrealaddr options....
: ifconfig eth0:1 myfirstipalias options...
: ifconfig eth0:2 mysecondipalias options...

I propose this get included in a subsequent Debian release...  I run this
as /etc/init.d/virtualhosts.  I wrote it, you can have it...

----cut here-----
#!/bin/bash

# Copyleft Jason Costomiris <jcostom@sjis.com>
# Reserved rights?  Nah, just leave these comment lines.
# Stick your IPs or hostnames in the names line, put a space between them.

names=""

count=0

if [ "$1" = "stop" ]; then
  for addr in $names
  do
	/sbin/route del $addr
	/sbin/ifconfig eth0:$count- $addr
	let count=$count+1
  done
elif [ "$1" = "start" -o "$1" = "" ]; then
  for addr in $names
  do
	/sbin/ifconfig eth0:$count $addr
	/sbin/route add -host $addr dev eth0:$count
	let count=$count+1
  done
else
  echo 'Usage: '$0' [start|stop]'
fi
----cut here-----

-- 
Jason Costomiris                 | Finger for PGP 2.6.2 Public Key
jcostom@sjis.com                 | "There is a fine line between idiocy
My employers like me, but not	 | and genius.  We aim to erase that line"
enough to let me speak for them. |			--Unknown

	        	http://www.jasons.org/~jcostom


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-user-request@lists.debian.org . 
Trouble?  e-mail to templin@bucknell.edu .


Reply to: