IP address aliases



Seeing another thread mention IP aliases reminded me of my experience with
them. Linux implements this by having fake interfaces for each one, as if
an interface could have only one. But I think that is a wrong way to do it.
Additionally, the logic used by the networking in Linux is to treat an IP
address as belonging to the whole system, rather than a some interface.

One approach I have done on machines with multiple real interfaces to have
the alias IP addresses in an expected place is to place the aliases on the
"lo" interface. They still get ARP-ed OK on each real interface. It works.

One day, I had some time to waste, and I tried to see how many aliases I
could configure. As I added more and more, the act of adding them, and the
network traffic, got slower and slower. By around 27,000 IP aliases added,
it was at the point where I would treat that as worse than a hard limit.
Maybe the only limit is how much memory the machine has. But it seemed
the aliases were stored in a list, perhaps a linked list.

I would suggest a mechanism be made to store IP addresses and IP subnets
in a tree structure with fast lookup (similar to a routing table). This
could be made in one instance for the whole system. Or it could be used
with each interface to handle its IP addresses (one primary IP address and
a tree of aliases) if there remains any need to associate them with an
interface. The mechanism to add and remove these addresses and subnets
should work by the address/subnet itself, imposing no requirement to do a
lookup of which psuedo-interface is being used to hold it.

--
|---------------------------------------/----------------------------------|
| Phil Howard KA9WGN (ka9wgn.ham.org) / Do not send to the address below |
| first name lower case at ipal.net / spamtrap-2007-06-11-0730@xxxxxxxx |
|------------------------------------/-------------------------------------|
.



Relevant Pages

  • Re: Possible? eth0:1 ... eth0:50000
    ... Toni Erdmann wrote: ... > Is it possible to have 50000 IP aliases on one ... > interface in Linux? ...
    (comp.os.linux.networking)
  • Re: [Q] how to set virtual IP on AS 4
    ... is it possible to create aliases for the lo interface? ... I'd like to create multiple ip aliases to do some apache test with but ... don't want them on a real eth0 interface because they get in the way ... Redhat Channel Partner and Training Partner 74, Nalanda Complex, Satellite Rd, Ahmedabad 25, The Emperor, Fatehgunj, Baroda. ...
    (RedHat)
  • Re: gif interface not passing IPv6 packets
    ... qi>> missing an alias on my lo0 interface. ... qi> You don't need any aliases to make this configuration work. ... but doing configuration on the same interface multiple times ...
    (freebsd-net)
  • Re: Sendmail takes ages to start at bootup
    ... it's ages since I relied on hosts files, I use an internal DNS server, ... name (for that interface) and associated with any aliases that you use ... if your mail server starts up thinking that it's "mailserver" ... *then* aliases. ...
    (Fedora)
  • Re: ntpq no longer working -
    ... the same name as an alias as you've got as a hostname, the aliases are ... I'm not sure that it's essential that you name each interface. ... as I have a DNS server that works with my DHCP server. ... hosts file, you're going to get some strange behaviours. ...
    (Fedora)