Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 870271

Summary: ifdown of an alias removes all ipv6 addresses of parent interface
Product: Red Hat Enterprise Linux 6 Reporter: Tom Lanyon <tom>
Component: initscriptsAssignee: David Kaspar // Dee'Kej <deekej>
Status: CLOSED DUPLICATE QA Contact: qe-baseos-daemons
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.3CC: deekej, jarrod.makin, jrieden, ovasik, psimerda, wbachman
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Release Note
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-10-27 09:00:32 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1356047    
Attachments:
Description Flags
Patch we're using to fix this issue none

Description Tom Lanyon 2012-10-26 02:17:27 UTC
Created attachment 633606 [details]
Patch we're using to fix this issue

Description of problem:
shutting down an (ipv4) interface alias (e.g. eth0:1) flushes/removes all ipv6 addresses on the parent interface (e.g. eth0).


Version-Release number of selected component (if applicable):
initscripts-9.03.31-2.el6.x86_64


How reproducible:
every time

Steps to Reproduce:
1.  configure some interface aliases - parent eth0 has ipv6 connectivity (ipv6 autoconfig):
$ ifconfig | egrep 'Link|inet'
eth0      Link encap:Ethernet  HWaddr 52:54:00:37:1D:02
          inet addr:192.0.2.1  Bcast:192.0.2.255  Mask:255.255.255.0
          inet6 addr: 2001:db8::5054:ff:fe37:1d02/64 Scope:Global
          inet6 addr: fe80::5054:ff:fe37:1d02/64 Scope:Link
eth0:2    Link encap:Ethernet  HWaddr 52:54:00:37:1D:02
          inet addr:192.0.2.2  Bcast:192.0.2.255  Mask:255.255.255.0
eth0:3    Link encap:Ethernet  HWaddr 52:54:00:37:1D:02  
          inet addr:192.0.2.3  Bcast:192.0.2.255  Mask:255.255.255.0

2.  'ifdown' one of the aliases
$ ifdown eth0:3


Actual results:
The interface alias is shutdown, however all ipv6 addresses of the parent interface are also removed:

$ ifconfig | egrep 'Link|inet'
eth0      Link encap:Ethernet  HWaddr 52:54:00:37:1D:02  
          inet addr:192.0.2.1  Bcast:192.0.2.255  Mask:255.255.255.0
          inet6 addr: fe80::5054:ff:fe37:1d02/64 Scope:Link
eth0:2    Link encap:Ethernet  HWaddr 52:54:00:37:1D:02  
          inet addr:192.0.2.2  Bcast:192.0.2.255  Mask:255.255.255.0



Expected results:
The interface alias is shutdown, and the ipv6 addresses of the parent interface remain:

$ ifconfig | egrep 'Link|inet'
eth0      Link encap:Ethernet  HWaddr 52:54:00:37:1D:02  
          inet addr:192.0.2.1  Bcast:192.0.2.255  Mask:255.255.255.0
          inet6 addr: 2001:db8::5054:ff:fe37:1d02/64 Scope:Global
          inet6 addr: fe80::5054:ff:fe37:1d02/64 Scope:Link
eth0:2    Link encap:Ethernet  HWaddr 52:54:00:37:1D:02  
          inet addr:192.0.2.2  Bcast:192.0.2.255  Mask:255.255.255.0


Additional info:


/sbin/ifdown calls ifdown-eth which correctly shuts down the alias address and then calls ifdown-ipv6 on the alias device.

ifdown-ipv6 munges the alias device name from "eth0:X" to the realdevice name of "eth0" and then issues an "ipv6_cleanup_device eth0" which erroneously removes all addresses on the parent device.

We have fixed this by modifying ifdown-ipv6 to only attempt to shutdown the alias, which will be a silent noop because the 'eth0:X' alias interface has no ipv6 addresses:

% diff -ur ifdown-ipv6.*
--- ifdown-ipv6.a	2012-10-26 12:22:52.000000000 +1030
+++ ifdown-ipv6.b	2012-10-26 12:22:59.000000000 +1030
@@ -46,6 +46,7 @@
 source_config
 
 REALDEVICE=${DEVICE%%:*}
+DEVICE=$REALDEVICE
 
 [ -f /etc/sysconfig/network-scripts/network-functions-ipv6 ] || exit 1
 . /etc/sysconfig/network-scripts/network-functions-ipv6
@@ -131,4 +132,4 @@
 fi
 
 # Delete all current configured IPv6 addresses on this interface
-ipv6_cleanup_device $REALDEVICE
+ipv6_cleanup_device $DEVICE

Comment 2 Lukáš Nykrýn 2012-10-29 12:57:20 UTC
With you patch (I assume it should be backwards) ifdown-ipv6 will still call some sysctl on parent device and I don't think that this is desired behavior.

Comment 4 Jarrod Makin 2015-12-31 11:45:51 UTC
I have recently encountered a variation of this behaviour with the latest 9.03.49-2.3 initscript package.
Running ifdown on an alias interface is dropping all ipv4 addresses from the parent interface, which is extremely dangerous.

Comment 5 Lukáš Nykrýn 2016-01-04 11:46:21 UTC
ipv4 is a separate new issue. So far only fixed in upstream. https://git.fedorahosted.org/cgit/initscripts.git/commit/?id=18d3aae0b1a9e58d5a970602d756a9ecf7cd1515

Comment 6 David Kaspar // Dee'Kej 2016-10-27 09:00:32 UTC

*** This bug has been marked as a duplicate of bug 842421 ***