Subject: IP-aliasing

From: Maarten Boekhold <[email-masked]>
Date: Fri, 26 Jul 1996 00:15:24 +0200 (MET DST)

Hi,

How do I use IP-aliasing? I came across 2 different syntaxis to call
ifconfig, namely:

ifconfig eth0:N address
and
ifconfig eth0 alias address

I could ofcourse always try it out (still 3 numbers left in our 4-bit
subnet :), but I don't have aliasing compiled in the kernel or as module,
and compiling a kernel takes over 1/2 an hour on my system :(

Maarten

_______________________________________________________________________
| Maarten Boekhold, Faculty of Electrical Engineering TU Delft,   NL  |
|   [email-masked] [email-masked]   |
-----------------------------------------------------------------------

---

From: [email-masked] (Bernd Eckenfels)
Date: Fri, 26 Jul 1996 04:49:56 +0200 (MET DST)

Hi,

> ifconfig eth0:N address

yes, this is right.

> ifconfig eth0 alias address

this is BSD style and there was an pacth for old kernels.

> and compiling a kernel takes over 1/2 an hour on my system :(

You can simply read /usr/src/linux/Documentation/networking/alias.txt

Greetings
Bernd
-- 
  (OO)      -- [email-masked] --
 ( .. )  ecki@lina.{inka.de,ka.sub.org}  http://home.pages.de/~eckes/
  o--o     *plush*  2048/A2C51749  eckes@irc  +4972573817  *plush*
(O____O)       If privacy is outlawed only Outlaws have privacy

---

From: Behan Webster <[email-masked]>
Date: Fri, 26 Jul 1996 12:14:22 -0400

> You can simply read /usr/src/linux/Documentation/networking/alias.txt

I've added this to the bottom of my /etc/init.d/network file.

#
# IP Aliases (give this host another IP address)
#
# Uncomment the following to assign a secondary IP to this host.
# This can be used to allow you to setup a multi-homed web site.
#
# NOTE: You should have "Network aliasing" and "IP: aliasing support"
#       enabled in your kernel for this to work.
#
#       Please read the file "Documentation/networking/alias.txt"
#       that comes with the kernel source for more information.
#
#DEVALIAS="eth0:0"
#IPALIAS="xxx.xxx.xxx.xxx"
#ifconfig ${DEVALIAS} ${IPALIAS} netmask ${NETMASK} broadcast
${BROADCAST}
#route add -host ${IPALIAS} dev ${DEVALIAS}

I've also written the following simple script for one of the
machines I manage that is used as a multi-homed web site (it
has about 6 ip addresses right now.)  Just give it a list of
ip addresses on the command line.  It's to be used once at
boot time.

>#!/usr/bin/perl
>#
># IP Alias this machine (ipalias)
>#
># Written by: Behan Webster <[email-masked]> (96.07.17)
>#
>
>$device     ="eth0";            # Aliased device
>$netmask    ="255.255.255.0";   # Your netmask.
>
>
>for ($i=0; $ARGV[$i]; $i++) {
>    $_ = $ARGV[$i];
>    s/[^.]$/255/;
>    system "/sbin/ifconfig $device:$i $ARGV[$i] netmask $netmask broadcast $_";
>    system "/sbin/route add -host $ARGV[$i] dev $device:$i";
>}

I hope this is helpful.

Behan Webster

-- 
Behan Webster
[email-masked]
(613) 224-7547