Why does ifdown of an IPv6 alias tear all IPs off the interface?

Solution Verified - Updated

Environment

  • Red Hat Enterprise Linux 5
  • Red Hat Enterprise Linux 6
  • Red Hat Enterprise Linus 7

Issue

  • When utilizing ifdown to manage IPv6 aliases on an interface, all IPs are removed from the specified interface. When using the ifconfig commands, the appropriate actions occur.

Resolution

Avoid the use of ifdown for network configurations where IPv6 addresses are applied to alias interfaces.

In the event that additional assistance or information regarding this recommendation, please reach out to Red Hat Support via the process outlined below:

How do I open and manage a support case on the Customer Portal? - Red Hat Customer Portal

Root Cause

In the event that the ifup/ifdown scripts are used for network configuration, the assumption is that the base interface is the primary target IPv6 addresses. As such, the removal of IPv6 addresses applied to an alias interface also results in the underlying interface IPv6 addresses being removed as well.

With legacy IPv4 networking configuration, the addition of more than a single primary IP address required aliases to be utilized. These could be used as if they were additional layered interfaces. Subsequent changes in interface configuration tools made the use of aliases unnecessary as the additional addresses could be applied directly to the primary interface.

The obsolescence of aliases was noted in the upstream linux kernel source documentation as early as 2009, in the 2.6.29-rc4 release, with the following:

commit 58092d1e0a896eb1d9163d58f93df7ed704fa8e1
Author: Stephen Hemminger <shemminger@vyatta.com>
Date:   Thu Jan 29 16:16:31 2009 -0800

    net: update documentation ip aliases
    
    This documentation is old.  Add a short note to describe why aliases
    are no long necessary, and remove the old contact/edit info.
    
    Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>

diff --git a/Documentation/networking/alias.txt b/Documentation/networking/alias.txt
index cd12c2ff518a..85046f53fcfc 100644
--- a/Documentation/networking/alias.txt
+++ b/Documentation/networking/alias.txt
@@ -2,13 +2,13 @@
 IP-Aliasing:
 ============
 
-IP-aliases are additional IP-addresses/masks hooked up to a base 
-interface by adding a colon and a string when running ifconfig. 
-This string is usually numeric, but this is not a must.
-
-IP-Aliases are avail if CONFIG_INET (`standard' IPv4 networking) 
-is configured in the kernel.
+IP-aliases are an obsolete way to manage multiple IP-addresses/masks
+per interface. Newer tools such as iproute2 support multiple
+address/prefixes per interface, but aliases are still supported
+for backwards compatibility.
 
+An alias is formed by adding a colon and a string when running ifconfig.
+This string is usually numeric, but this is not a must.
 
 o Alias creation.
   Alias creation is done by 'magic' interface naming: eg. to create a
@@ -38,16 +38,3 @@ o Relationship with main device
 
   If the base device is shut down the added aliases will be deleted 
   too.
-
-
-Contact
--------
-Please finger or e-mail me:
-   Juan Jose Ciarlante <jjciarla@raiz.uncu.edu.ar>
-
-Updated by Erik Schoenfelder <schoenfr@gaertner.DE>
-
-; local variables:
-; mode: indented-text
-; mode: auto-fill
-; end:

That aliases had been rendered obsolete by the upstream community, their use can result in difficult-to-predict behaviours. For IPv6, additional addresses are assumed to be added to the interface itself in the form of secondary IP addresses. Interaction with the secondary addresses via the specific tooling or newer network configuration utilities (such as NetworkManager) yields the most stable results.

SBR
Components
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.