When I do IP aliasing, I can simply type:
  ip addr add x.x.x.x/x brd x.x.x.x scope global dev ethx
If you want to name it, like eth0:0 then you do:
  ip addr add x.x.x.x/x brd x.x.x.x scope global label ethx:x dev ethx

If it is the first ip address it sets it up as primary, the second and so
one are set up as secondary.

removing is simply
ip addr del x.x.x.x/x dev ethx

It's not a nice looking I don't think, but it's worked fine for me.

As for scripting, I guess you might try keeping the ethx:x for the interface
name in the script, but striping the :x after the dev call in ip. I haven't
tried this myself, but it seems like it should work.

The main thing to be careful of, and my first big stumbling block, was
making sure my firewall rules allowed the new ip address to communicate.

Andrew

----- Original Message -----
From: "David Douthitt" <[EMAIL PROTECTED]>
To: "LEAF Devel" <[EMAIL PROTECTED]>
Sent: Tuesday, July 17, 2001 6:16 PM
Subject: [Leaf-devel] IP Aliasing with iproute2


> I can't believe I'm not finding this....  I thought someone had
> mentioned how to do it.
>
> I thought I did it, but it didn't work.
>
> All I want to do is add a new IP address to an existing interface, and
> then use the knowledge of how to do it to incorporate it easily into
> /etc/network.conf and /etc/init.d/network so that aliases can be used on
> bootup.
>
> Using ifconfig, it was another interface, and all was set up
> automatically.
>
> Now it would appear that using ip requires special commands for
> everything; it doesn't appear that this new IP address is considered a
> whole new interface.  For example, using ifconfig... (feel free to
> shatter my misconceptions!), I could:
>
> <bring up eth0 alias 0>
> # ifconfig eth0:0 up
>
> <bring down eth0 alias 0>
> # ifconfig eth0:0 down
>
> <create eth0:0>
> # ifconfig eth0:0 172.16.3.59 up
>
> It's as if eth0:0 always existed, and all you have to do is use it.
> Anything that can handle networking - anything that knows what to do
> with eth0 knows what to do with eth0:0.  Simple.
>
> Now with ip, I have to write special code to handle aliases - right?
> What a pain...
>
> _______________________________________________
> Leaf-devel mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/leaf-devel
>


_______________________________________________
Leaf-devel mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/leaf-devel

Reply via email to