Add an IP alias to ethernet interface

Dan Nicholson dbn.lists at gmail.com
Mon Jun 4 16:22:56 PDT 2007


On 6/4/07, Andrew Beverley <andy at andybev.com> wrote:
> On Sun, 2007-06-03 at 00:09 +0200, Rabenkind wrote:
>
> > I've one card in my box and the box is a member of 3 subnets. Because here are
> > three routers so i setup two aliases and the routes to have access to all
> > subnets. I've some customers where i need this cause i'm admin there. :-)
>
> I personally don't have this need :) However, if you do, maybe this
> could be something for the contrib directory that Dan referred to
> earlier?

I think this would work with the changes in the script you sent before
(except maybe setting up the routes). Assuming the ALIAS or LABEL
option is added to ipv4-static, you'd just have 3 conf files in
ifconfig.eth0.

ifconfig.eth0/ipv4:
SERVICE=ipv4-static
ONBOOT=yes
IP=<first IP>
GATEWAY=<first gateway>
PREFIX=<first subnet prefix>
BROADCAST=<first broadcast>

ifconfig.eth0/ipv4-alias1:
SERVICE=ipv4-static
ONBOOT=yes
IP=<second IP>
ALIAS=<first alias>
GATEWAY=<second gateway>
PREFIX=<second subnet prefix>
BROADCAST=<second broadcast>

ifconfig.eth0/ipv4-alias2:
SERVICE=ipv4-static
ONBOOT=yes
IP=<third IP>
ALIAS=<second alias>
GATEWAY=<third gateway>
PREFIX=<third subnet prefix>
BROADCAST=<third broadcast>

And, of course, you could name the files something far more
descriptive so that you knew which subnet you're referring to.
However, if he's referring to adding more routes with support for
aliases, then that support would probably need to be added to
ipv4-static-route, too. That would be trivial, though, and probably
should be done if ipv4-alias isn't a separate script.

--
Dan



More information about the lfs-dev mailing list