Skip to contentSkip to conversation

issue: deleting one IP alias deletes all

DISCUSSION Tim Hockin 4 participants 5 messages Oct 23, 2001 – Oct 26, 2001

lore
Share & tools
lore

Tim Hockin

author
#0 lore raw

So we've noticed, and taken issue with this behavior.

If you have several IP aliases on an interface (eth0:0, eth0:1, eth0:2) you get inconsistent behavior when downing them.

* if I 'ifconfig down' eth0:1, I am left with eth0:0 and eth0:2
* if I 'ifconfig down' eth0:0, eth0:1 and eth0:2 go away, too

I assert that this should not happen. I have a simple patch to fix this behavior, but I want to know a few things.

* Is this supposed to happen? Why?
* Is it correct that both the real interface and the first alias are marked as primary (! IFA_F_SECONDARY), while all other aliases are secondary? It seems to me that ALL ALIASES should be secondary. Is this wrong? Why?

Can anyone fill me in?

Thanks
Tim

Signature · 4 lines
Tim Hockin
Systems Software Engineer
Sun Microsystems, Cobalt Server Appliances
[email protected]
#1 lore raw
Quoted 7 lines · Tim Hockin

So we've noticed, and taken issue with this behavior.

If you have several IP aliases on an interface (eth0:0, eth0:1, eth0:2) you get inconsistent behavior when downing them.

* if I 'ifconfig down' eth0:1, I am left with eth0:0 and eth0:2
* if I 'ifconfig down' eth0:0, eth0:1 and eth0:2 go away, too

This was reported ages ago too.

Quoted 1 line

From what I remember, because eth0:x is an AF_INET hack only, you

should only do a down of it with an AF_INET socket. Some versions of ifconfig did it with a socket of the wrong type, which resulted in the whole interface going down.

Which version of ifconfig (nettools) are you using?

Kurt

#2 lore raw
In reply to Tim Hockin
Quoted 8 lines · Kurt Roeckx
Quoted 7 lines · Tim Hockin

So we've noticed, and taken issue with this behavior.

If you have several IP aliases on an interface (eth0:0, eth0:1, eth0:2) you get inconsistent behavior when downing them.

* if I 'ifconfig down' eth0:1, I am left with eth0:0 and eth0:2
* if I 'ifconfig down' eth0:0, eth0:1 and eth0:2 go away, too

Oops, I seem to have responded a little too fast.

It used to be, if you ifconfig down eth0:1, that eth0, eth0:2 were gone too.

If you down eth0:0, does eth0 go down too?

Kurt

#3 lore raw
In reply to Tim Hockin
Quoted 7 lines · Tim Hockin

So we've noticed, and taken issue with this behavior.

If you have several IP aliases on an interface (eth0:0, eth0:1, eth0:2) you get inconsistent behavior when downing them.

* if I 'ifconfig down' eth0:1, I am left with eth0:0 and eth0:2
* if I 'ifconfig down' eth0:0, eth0:1 and eth0:2 go away, too

Use ip.

Quoted 7 lines

I assert that this should not happen. I have a simple patch to fix this behavior, but I want to know a few things.

* Is this supposed to happen? Why?
* Is it correct that both the real interface and the first alias are marked as primary (! IFA_F_SECONDARY), while all other aliases are secondary? It seems to me that ALL ALIASES should be secondary. Is this wrong? Why?

iif - using ip then

ip addr add 10.1.1.1/24 dev eth0

creates 10.1.1.1 as a primary address for the 10.1.1.0/24 address space as defined. Now:

ip addr add 10.1.1.2/32 dev eth0

10.1.1.2 in this case IS NOT a secondary alias because it is _not_ within the scope of 10.1.1.0/24 by definition (it is in the scope of 10.1.1.2/32 by definition).

Now try:

ip addr add 10.1.1.3/24 dev eth0

and 10.1.1.3 is a secondary alias by definition as it is within the scope of 10.1.1.0/24

Better yet:

ip addr add 10.1.1.4/25 dev eth0

This defines a third scope on dev eth0 and now:

ip addr add 10.1.1.5/25 dev eth0

defines 10.1.1.5 as a seconday within 10.1.1.0/25

So to summarize we now have:

Three (3) Primary addresses:

	10.1.1.1   for scope 10.1.1.0/24
	10.1.1.2   for scope 10.1.1.2/32
	10.1.1.4   for scope 10.1.1.0/25

Two (2) Secondary addresses:

	10.1.1.3   for scope 10.1.1.0/24
	10.1.1.5   for scope 10.1.1.0/25

Now let us see what the interactions are:

ip addr del 10.1.1.1/24 dev eth0

Will wipe out both 10.1.1.1 and 10.1.1.3

Make sense now? BTW - don't use ifconfig and coloned addresses (which are deprecated) as you will merely confuse yourself. Remeber that ifconfig = InterFace CONFIGure which has everything to do with Interfaces and very little to do with IP addresses... ;-}

Quoted 1 line

Can anyone fill me in?

RPDB documentation is your freind.

Quoted 4 lines

Thanks
Tim
--
Tim Hockin

Quoted 9 lines

Systems Software Engineer
Sun Microsystems, Cobalt Server Appliances
[email protected]
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

--------------------------------------------------
Matthew G. Marsh, President
Paktronix Systems LLC
1506 North 59th Street
Omaha NE 68104
Phone: (402) 932-7250 x101
Email: [email protected]
WWW: http://www.paktronix.com
--------------------------------------------------

#4 lore raw
In reply to Tim Hockin
Quoted 5 lines · Matthew G. Marsh
Quoted 1 line · Tim Hockin

Can anyone fill me in?

RPDB documentation is your freind.

The main problem with this documentation is that, wherever I have seen it, it comes _only_ as few sizeable Postscript files. Like this (after 'ls -s' so sizes are in kilobytes):

120 /usr/share/doc/iproute-2.2.4/api-ip6-flowlabels.ps 336 /usr/share/doc/iproute-2.2.4/ip-cref.ps 124 /usr/share/doc/iproute-2.2.4/ip-tunnels.ps

Mighty helpful if you happen to have only a text interface as is often the case when you work on more complicated routing setups. It is also excellent for grepping (NOT!) through a 60 pages long document if you want to find something on a particular topic. Unfortunately it was not apparently written in 'texinfo', or similar, as then one would have also _at least_ .info files and an easy way to search through the whole thing does not matter what kind of a display you have.

HTML format would be of some help but searches through that, especially if multiple files are involved, are also not that nice. Right now your best bet is probably to print that out and carry a stack of papers with you wherever you may need it. Other than that you are currently reduced to '/sbin/ip help' although you may follow up with something like '/sbin/ip addr help' and you will get something to parse. :-)

Michal