SUMMARY: Multiple IP addresses on one interface

From: Kalpesh Dharia (
Date: Fri Jul 21 1995 - 18:45:05 CDT

Hi Sun Managers,

>Has anyone tried assigning multiple IP addresses to the same ethernet
A few people answered YES!

>I have a situation here where I need to assign multiple IP addresses
>to one ethernet interface and would appreciate if someone can fill me
>up on any gotchas involved in it; I mean it's effects on the network,
>security, etc., &/or provide me with pointers to information on it.
This is the question whose answer I was really interested in, but only a couple
answered. However, a couple of them said that they had no network or security
problems, and I haven't heard any complaints from anyone, so I conclude it
is SAFE to do this. The only word of caution I received here is that all
your packets might go out with a different ip address (if it matters to you).

>Of course, any good suggestions on how to set multiple ip addresses on
>the same ethernet interface of the machine would be more than welcome.
>The system I'm talking about is a SS5 running Solaris 2.4.
The unanimous answer here is to use the command (or a variation of it with
slightly different parameters)

#ifconfig <interface>:n <ip-address|name> up
#ifconfig le0 a.b.c.d up
#ifconfig le0:1 a.b.c.e up
#ifconfig le0:2 a.b.c.f up
and so on.
For each virtual interface you add like this, create a corresponding file
/etc/hostname.le0:n with that name/address in it.

I was cautioned not to use unplumb to remove a virtual interface, you'll
remove the *entire* interface. To remove the virtual interface, use
ifconfig le0:n down

Another word of caution here for anyone who is adding addresses from different
#ifconfig leO:1 a.b.c.d
#ifconfig leO:1 a.e.f.g
This might need some extra work like setting up special routes, etc. I didn't
receive much detail on it.

A couple of people also pointed out that the method was in the Solaris FAQ.

On the same lines, does anybody know what is the upper limit on the number
of virtual interfaces we can set this way? Thanks again, and if I get a
definite number for an answer, I'll mail it to the group.

Last, but most imporatant, thanks a lot to all of you here and all others
whose replies are still coming. I don't think I missed anybody, but sorry
if I did.

Pablo Ruiz <> (Kevin Sheehan {Consulting Poster Child}) (Richard C. Mills) (Carlo Musante) (Syd Weinstein)
"Mark C. Henderson" <>
"Henry Katz" <>
Gary Merinstein <> (Rob Beverly)
Casper Dik <casper@Holland.Sun.COM> (Stephen Harris)
Marc Samama <> (Anthony Clarke) (Gerhard Lausser) (Anatoly M. Lisovsky)
Simon Burr <> (Pierre-Yves Bonnetain)
mshon@sunrock.East.Sun.COM (Michael J. Shon {*Prof Services} Sun Rochester)
stern@sunrise.East.Sun.COM (Hal Stern - Distinguished Systems Engineer)
Anchi Zhang <anchi@Starbase.NeoSoft.COM> (David Burwell) (Tim Evans)

This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:10:30 CDT