Debian Bug report logs - #360155
ifupdown does not work for IPv6 with IPv4-style interface aliases

version graph

Package: ifupdown; Maintainer for ifupdown is Andrew Shadura <andrewsh@debian.org>; Source for ifupdown is src:ifupdown.

Reported by: Tushar Gohad <tgohad@mvista.com>

Date: Thu, 30 Mar 2006 23:33:02 UTC

Severity: wishlist

Tags: ipv6, patch

Merged with 168776, 359618, 395826

Found in versions 0.6.4-4, ifupdown/0.6.7, ifupdown/0.6.5

Fixed in version ifupdown/0.7~alpha4

Done: Andrew Shadura <bugzilla@tut.by>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Anthony Towns <ajt@debian.org>:
Bug#360155; Package ifupdown. Full text and rfc822 format available.

Acknowledgement sent to Tushar Gohad <tgohad@mvista.com>:
New Bug report received and forwarded. Copy sent to Anthony Towns <ajt@debian.org>. Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Tushar Gohad <tgohad@mvista.com>
To: submit@bugs.debian.org
Subject: ifupdown does not work for ipv4 style interface aliases
Date: Thu, 30 Mar 2006 16:11:49 -0700
[Message part 1 (text/plain, inline)]
Package: ifupdown
Version: 0.6.5


When I put the IPv4 style network interface aliases (e.g. eth0:10)
in the config file and try to assign an IPv6 address to it,

# /etc/network/interfaces

iface eth0:10 inet static
      address 3ffe::01
      netmask 64

The command

# ifup eth0:10

gives the error "SIOCSIFFLAGS: Cannot assign requested address."

Although, 'aliases' are IPv4 style labels for interfaces, and IPv6
specification already allows an interface to have more than one
address, it would be useful sometimes to bring up only certain IPv6
address on an interface.

Attached herewith is the patch for ifupdown-0.6.5 that allows
addition of IPv6 addresses based on an IPv4 style virtual interface
'alias'

supplied to the 'ifup' command.


I am using Debian stable ifupdown_0.6.7 package from
  http://packages.debian.org/stable/base/ifupdown

[ifupdown-0.6.5.patch (text/x-patch, inline)]
Index: ifupdown-0.6.5/ifupdown.nw
===================================================================
--- ifupdown-0.6.5.orig/ifupdown.nw
+++ ifupdown-0.6.5/ifupdown.nw
@@ -2799,9 +2799,12 @@ char *get_var(char *id, size_t idlen, in
 <<execute functions>>=
 char *get_var(char *id, size_t idlen, interface_defn *ifd) {
 	int i;
+	static char valid_iface[20];
+	char* position;
+	extern address_family addr_inet6;
 
 	if (strncmpz(id, "iface", idlen) == 0) {
-		return ifd->real_iface;
+		<<return the valid interface>>
 	} else {
 		for (i = 0; i < ifd->n_options; i++) {
 			if (strncmpz(id, ifd->option[i].name, idlen) == 0) {
@@ -2814,6 +2817,30 @@ char *get_var(char *id, size_t idlen, in
 }
 @ 
 
+For IPv6, logical interfaces are not needed and are not
+supported. But there might the /etc/network/interfaces
+files that are configured with such interfaces for IPv6
+and for the sake of compatability, support such interfaces
+but strip off the logical offset if present for IPv6
+
+<<return the valid interface>>=
+		position = strchr(ifd->real_iface, ':');
+		if (!strncmp(ifd->address_family->name, addr_inet6.name,strlen(addr_inet6.name)) &&
+				(position)) {
+			i = 0;
+			while ((strlen(valid_iface) < 20) &&
+					(ifd->real_iface+i != position)) {
+				*(valid_iface+i) = *(ifd->real_iface+i);
+				i++;
+			}
+			valid_iface[i] = '\0';
+			return (valid_iface);
+		}
+		else {
+			return (ifd->real_iface);
+		}
+@
+
 Which means we can finish of the chunk, thus:
 
 <<get [[varvalue]]>>=
Index: ifupdown-0.6.5/inet6.defn
===================================================================
--- ifupdown-0.6.5.orig/inet6.defn
+++ ifupdown-0.6.5/inet6.defn
@@ -5,14 +5,16 @@ method loopback
   description
     This method may be used to define the IPv6 loopback interface.
   up
-    ifconfig %iface% add ::1
+    ip addr add ::1 dev %iface%
   down
-    ifconfig %iface% del ::1
+    ip addr del ::1 dev %iface%
 
 method static
   description
     This method may be used to define interfaces with statically assigned
-    IPv6 addresses.
+    IPv6 addresses. With IPv6 the link is not brought down upon deleting
+    the IPv6 address, as it seems like a safe bet to presently assume that
+    the interface will continue to have one or more IPv4 address.
 
   options
     address address        -- Address (colon delimited) *required*
@@ -24,12 +26,12 @@ method static
                                  /address/ is dependent on this choice.
     mtu size               -- MTU size
   up
-    ifconfig %iface% [[media %media%]] [[hw %hwaddress%]] [[mtu %mtu%]] up
-    ifconfig %iface% add %address%/%netmask%
-    [[ route -A inet6 add ::/0 gw %gateway% ]] 
+    ip link set %iface% [[media %media%]] [[hw %hwaddress%]] [[mtu %mtu%]] up
+    ip -6 addr add %address%/%netmask% dev %iface%
+    [[ ip -6 route add ::/0 gw %gateway% ]]
 
   down
-    ifconfig %iface% down
+    ip -6 addr del %address%/%netmask% dev %iface%
 
 method v4tunnel
   description

Information forwarded to debian-bugs-dist@lists.debian.org, Anthony Towns <ajt@debian.org>:
Bug#360155; Package ifupdown. Full text and rfc822 format available.

Acknowledgement sent to Marc Haber <mh+debian-packages@zugschlus.de>:
Extra info received and forwarded to list. Copy sent to Anthony Towns <ajt@debian.org>. Full text and rfc822 format available.

Message #10 received at 360155@bugs.debian.org (full text, mbox):

From: Marc Haber <mh+debian-packages@zugschlus.de>
To: Tushar Gohad <tgohad@mvista.com>, 360155@bugs.debian.org
Subject: Re: Bug#360155: ifupdown does not work for ipv4 style interface aliases
Date: Fri, 31 Mar 2006 07:35:47 +0200
On Thu, Mar 30, 2006 at 04:11:49PM -0700, Tushar Gohad wrote:
> iface eth0:10 inet static
>       address 3ffe::01
>       netmask 64

You might want to read man 5 interfaces again and use the inet6
address family and not the ipv4-based inet family.

Greetings
Marc

-- 
-----------------------------------------------------------------------------
Marc Haber         | "I don't trust Computers. They | Mailadresse im Header
Mannheim, Germany  |  lose things."    Winona Ryder | Fon: *49 621 72739834
Nordisch by Nature |  How to make an American Quilt | Fax: *49 621 72739835



Information forwarded to debian-bugs-dist@lists.debian.org, Anthony Towns <ajt@debian.org>:
Bug#360155; Package ifupdown. Full text and rfc822 format available.

Acknowledgement sent to Tushar Gohad <tgohad@mvista.com>:
Extra info received and forwarded to list. Copy sent to Anthony Towns <ajt@debian.org>. Full text and rfc822 format available.

Message #15 received at 360155@bugs.debian.org (full text, mbox):

From: Tushar Gohad <tgohad@mvista.com>
To: Marc Haber <mh+debian-packages@zugschlus.de>
Cc: 360155@bugs.debian.org
Subject: Re: Bug#360155: ifupdown does not work for ipv4 style interface aliases
Date: Fri, 31 Mar 2006 10:28:45 -0700
That was a type in the bug report. Read the configuration file as:

# /etc/network/interfaces

iface eth0:10 inet6 static
     address 3ffe::01
     netmask 64


The bug description now correctly applies.

Thanks,
- Tushar

Marc Haber wrote:
> On Thu, Mar 30, 2006 at 04:11:49PM -0700, Tushar Gohad wrote:
>   
>> iface eth0:10 inet static
>>       address 3ffe::01
>>       netmask 64
>>     
>
> You might want to read man 5 interfaces again and use the inet6
> address family and not the ipv4-based inet family.
>
> Greetings
> Marc
>
>   




Information forwarded to debian-bugs-dist@lists.debian.org, Anthony Towns <ajt@debian.org>:
Bug#360155; Package ifupdown. Full text and rfc822 format available.

Acknowledgement sent to Ronan KERYELL <Ronan.Keryell@enstb.org>:
Extra info received and forwarded to list. Copy sent to Anthony Towns <ajt@debian.org>. Full text and rfc822 format available.

Message #20 received at 360155@bugs.debian.org (full text, mbox):

From: Ronan KERYELL <Ronan.Keryell@enstb.org>
To: 360155@bugs.debian.org
Cc: bortzmeyer@nic.fr
Subject: ifdown does not remove the IPv6 address of alias interfaces
Date: Fri, 27 Apr 2007 18:47:33 +0200
I think I hit the bug #360155 with my /etc/network/interfaces
configuration such as:

iface eth0 inet static
	address 192.168.1.2
	netmask 255.255.255.0

iface eth0:1 inet static
	address 10.0.0.5
	netmask 255.255.255.0
	broadcast 10.0.0.255
	network 10.0.0.0
	gateway 10.0.0.254
iface eth0:1 inet6 static
        address 2001:7a8:b057::5
	gateway 2001:7a8:b057::ffff
        netmask 64

and many other aliases with IPv6 addresses that I can switch on or off
according my physical location.

All the IPv6 addresses are associated to the main
interfaces by ifup but unfortunately never removed by the respective
ifdown.

keryell@an-dro:/tmp$ sudo ifup eth0
keryell@an-dro:/tmp$ ifconfig -a
eth0      Lien encap:Ethernet  HWaddr 00:0F:1F:1E:4C:96
          inet adr:192.168.1.2  Bcast:192.168.1.255  Masque:255.255.255.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 lg file transmission:1000
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
          Interruption:11

keryell@an-dro:/tmp$ sudo ifup eth0:1
keryell@an-dro:/tmp$ ifconfig -a
eth0      Lien encap:Ethernet  HWaddr 00:0F:1F:1E:4C:96
          inet adr:192.168.1.2  Bcast:192.168.1.255  Masque:255.255.255.0
          adr inet6: 2001:7a8:b057::5/64 Scope:Global
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 lg file transmission:1000
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
          Interruption:11

keryell@an-dro:/tmp$ sudo ifdown eth0:1
SIOCSIFFLAGS: Cannot assign requested address
keryell@an-dro:/tmp$ ifconfig -a
eth0      Lien encap:Ethernet  HWaddr 00:0F:1F:1E:4C:96
          inet adr:192.168.1.2  Bcast:192.168.1.255  Masque:255.255.255.0
          adr inet6: 2001:7a8:b057::5/64 Scope:Global
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 lg file transmission:1000
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
          Interruption:11



In bug #360155, a patch has been proposed more than a year ago. If it
works (I've not tested it), should it be possible to include it in the
mainstream?

It looks like it is related also to bugs bug #360155, #168776 and #395826.

Thank you,
-- 
  Ronan KERYELL               |\/  Tel:    (+33|0) 2.29.00.14.15
  Département Informatique    |/)  Fax:    (+33|0) 2.29.00.12.82
  ENST Bretagne, CS 83818     K    GSM:    (+33|0) 6.13.14.37.66
  F-29238 PLOUZANÉ CEDEX 3    |\   E-mail: rk@enstb.org
  FRANCE                      | \  http://enstb.org/~keryell
                                   sip:keryell@ekiga.net



Added tag(s) ipv6. Request was from Kenyon Ralph <kenyon@kenyonralph.com> to control@bugs.debian.org. (Fri, 03 Dec 2010 12:57:05 GMT) Full text and rfc822 format available.

Changed Bug title to 'ifupdown does not work for IPv6 with IPv4-style interface aliases' from 'ifupdown does not work for ipv4 style interface aliases' Request was from Kenyon Ralph <kenyon@kenyonralph.com> to control@bugs.debian.org. (Fri, 03 Dec 2010 12:57:05 GMT) Full text and rfc822 format available.

Severity set to 'wishlist' from 'normal' Request was from Kenyon Ralph <kenyon@kenyonralph.com> to control@bugs.debian.org. (Fri, 03 Dec 2010 13:03:03 GMT) Full text and rfc822 format available.

Merged 168776 359618 360155. Request was from Kenyon Ralph <kenyon@kenyonralph.com> to control@bugs.debian.org. (Fri, 03 Dec 2010 13:03:03 GMT) Full text and rfc822 format available.

Merged 168776 359618 360155 395826. Request was from Kenyon Ralph <kenyon@kenyonralph.com> to control@bugs.debian.org. (Fri, 03 Dec 2010 13:03:06 GMT) Full text and rfc822 format available.

Added tag(s) wheezy. Request was from Kurt Roeckx <kurt@roeckx.be> to control@bugs.debian.org. (Wed, 16 Feb 2011 19:03:03 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Andrew O. Shadura <bugzilla@tut.by>:
Bug#360155; Package ifupdown. (Wed, 11 Jan 2012 15:51:10 GMT) Full text and rfc822 format available.

Acknowledgement sent to Trent Lloyd <lathiat@bur.st>:
Extra info received and forwarded to list. Copy sent to Andrew O. Shadura <bugzilla@tut.by>. (Wed, 11 Jan 2012 15:51:10 GMT) Full text and rfc822 format available.

Message #37 received at 360155@bugs.debian.org (full text, mbox):

From: Trent Lloyd <lathiat@bur.st>
To: 360155@bugs.debian.org
Subject: worst part
Date: Wed, 11 Jan 2012 16:43:29 +0800
The worst part about this bug is if you do

ifdown eth0:1


With an IPv6 stanza configured, it downs the entire interface, including IPv4.  This caused a production server outage for me and is likely to catch people out.

In my opinion that is a much more critical bug than the fact there is no way to configure multiple IPv6 addresses.


The same fix (adding alias support) would fix both.



Information forwarded to debian-bugs-dist@lists.debian.org, Andrew O. Shadura <bugzilla@tut.by>:
Bug#360155; Package ifupdown. (Wed, 11 Jan 2012 16:12:07 GMT) Full text and rfc822 format available.

Acknowledgement sent to Andrew Shadura <bugzilla@tut.by>:
Extra info received and forwarded to list. Copy sent to Andrew O. Shadura <bugzilla@tut.by>. (Wed, 11 Jan 2012 16:12:07 GMT) Full text and rfc822 format available.

Message #42 received at 360155@bugs.debian.org (full text, mbox):

From: Andrew Shadura <bugzilla@tut.by>
To: Trent Lloyd <lathiat@bur.st>, 360155@bugs.debian.org, control@bugs.debian.org
Subject: Re: Bug#360155: worst part
Date: Wed, 11 Jan 2012 19:08:15 +0300
[Message part 1 (text/plain, inline)]
tags 360155 + pending
thanks

Hello,

On Wed, 11 Jan 2012 16:43:29 +0800
Trent Lloyd <lathiat@bur.st> wrote:

> In my opinion that is a much more critical bug than the fact there is
> no way to configure multiple IPv6 addresses.

This is going to be fixed in the next ifupdown release.

-- 
WBR, Andrew
[signature.asc (application/pgp-signature, attachment)]

Added tag(s) pending. Request was from Andrew Shadura <bugzilla@tut.by> to control@bugs.debian.org. (Wed, 11 Jan 2012 16:12:08 GMT) Full text and rfc822 format available.

Message #45 received at 395826-done@bugs.debian.org (full text, mbox):

From: Andrew Shadura <bugzilla@tut.by>
To: Douglas Calvert <dfc@douglasfcalvert.net>, 395826-done@bugs.debian.org
Subject: Re: Bug#395826:
Date: Mon, 12 Nov 2012 23:12:15 +0100
[Message part 1 (text/plain, inline)]
Hello,

On Mon, 12 Nov 2012 17:05:31 -0500
Douglas Calvert <dfc@douglasfcalvert.net> wrote:

> What is the status of this bug? It is six years old now?

Would be much easier to actually check :) It's been fixed a long time
ago.

-- 
WBR, Andrew
[signature.asc (application/pgp-signature, attachment)]

Marked as fixed in versions ifupdown/0.7~alpha4. Request was from Andrew Shadura <bugzilla@tut.by> to control@bugs.debian.org. (Mon, 12 Nov 2012 22:21:03 GMT) Full text and rfc822 format available.

Added tag(s) jessie. Request was from Julien Cristau <jcristau@debian.org> to control@bugs.debian.org. (Thu, 18 Apr 2013 17:34:27 GMT) Full text and rfc822 format available.

Removed tag(s) sid, squeeze, wheezy, and jessie. Request was from Andreas Beckmann <anbe@debian.org> to control@bugs.debian.org. (Fri, 01 Nov 2013 22:31:42 GMT) Full text and rfc822 format available.

Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Sat, 30 Nov 2013 07:35:15 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Sat Apr 19 06:44:51 2014; Machine Name: buxtehude.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.