FS#18699 - [netcfg] add IPv6 support

Attached to Project: Arch Linux
Opened by Olivier Mehani (shtrom) - Tuesday, 16 March 2010, 03:01 GMT
Last edited by Rémy Oudompheng (remyoudompheng) - Monday, 13 June 2011, 10:54 GMT
Task Type Feature Request
Category Arch Projects
Status Closed
Assigned To Thomas Bächler (brain0)
Rémy Oudompheng (remyoudompheng)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 13
Private No

Details

Description:

Currently, netcfg only allows configuring IPv4 connectivity.
It would be good to also be able to configure IPv6 parameters using the same mechanism.

The following options would be sufficient to replicate what is available for IPv4.

IP6='static' # or 'stateless' or 'dhcp'
ADDR6='2001:DB8::1' # example prefik from RFC 3849
PREFIXLEN='...' # default 64
IP6CFG='...'
This task depends upon

Closed by  Rémy Oudompheng (remyoudompheng)
Monday, 13 June 2011, 10:54 GMT
Reason for closing:  Implemented
Additional comments about closing:  Coming in netcfg 2.6
Comment by Olivier Mehani (shtrom) - Tuesday, 16 March 2010, 08:26 GMT
Ok, here is a tentative patch. It works fine as far as I tested, but I do not have a DHCPv6 server handy. In the absence of such server, the dhcp configurations fail in the same way as the IPv4 ones, which is a good sign. Only dhclient supports DHCPv6, so dhcpcd is not usable as it is in the IPv4 block. The rest of the parameters work fine.

Also, there is something unclear about how to set net.ipv6.conf.all.accept_ra. The commit message explains it further.

====
The following options are added:
- IP6:
- none: deactivate autoconfiguration and don't do anything else
- stateless: “normal” autoconfiguration
- dhcp: use “dhclient -6”
- dhcp-noaddr: use “dhclient -6 -S” and stateless autoconfiguration
- static: configure $INTERFACE with $ADDR6/$PREFIXLEN
* 'dhcp' and 'static' also deactivate stateless autoconfiguration; it
is reactivated in any case when the interface is brought down to
restore a “neutral” situation
- GATEWAY6, IP6CFG: similar to their IPv4 counterparts except the commands
are run ith “ip -6”

Both DHCPv6 options also use variable DHCLIENT6_OPTIONS for further
configuration

IFOPTS is used for both IPv4 and IPv6, and only if the interface is not
already up.

Potential bug: The relationship of the net.ipv6.conf.*.accept_ra sysctl
values is not straigthforward nor well documented. According to scarce
information [0,1,2], it would seem that:
- net.ipv6.conf.default.accept_ra is used to initialise new interfaces,
- net.ipv6.conf.INTERFACE.accept_ra controls the actual value BUT
- net.ipv6.conf.all.accept_ra is combined with the previous value
before any decision is applied to the interface.

Now, “combined” seems to take a varying meaning depending on the
parameter under consideration [0, 2]. I couldn't dedicate much time to
crawling the kernel source, so I did some tests instead. My tentative
conclusion is that net.ipv6.conf.all.accept_ra is ORed with
net.ipv6.conf.INTERFACE.accept_ra. So, to really ignore RAs, both these
settings have to be set to 0.

[0] http://marc.info/?l=linux-kernel&m=123606366021995&w=2
[1] http://lkml.indiana.edu/hypermail/linux/kernel/0103.0/0440.html
[2] http://marc.info/?l=linux-kernel&m=123617372002934&w=2
Comment by Mark (voidzero) - Friday, 27 August 2010, 09:21 GMT
Hi, I'd like to dig up this bug/feature request for the following reason.
Today a major Dutch ISP launched native IPv6 for their customers. It has
been calculated that there will be no more new IPv4-delegationspace in
less than 300 days. I'd like to jump on the bandwagon.

Olivier are you still interested in this bug? Perhaps we can work toogether
on writing patches so that we can do the work ourselves.
Comment by Olivier Mehani (shtrom) - Saturday, 28 August 2010, 08:25 GMT
Hi Mark,

I sure am interested!

Did you try out my patchsets yet? Are there features that didn't work as expected or weren't present?
Comment by Andrej Podzimek (andrej) - Tuesday, 08 February 2011, 18:43 GMT
Severity: low
Priority: normal

WTF?! This should be:

Severity: critical
Priority: flash

This IPv6-agnostic approach of ArchLinux may soon force me to switch to another distro. :-(
Comment by Thomas Bächler (brain0) - Tuesday, 08 February 2011, 19:23 GMT
Andrej, if this is so important to you, you should try the patch posted above, give feedback and so on. Maybe write your own improvements.

I can't test it, as I do not know a single provider that offers IPv6 support that I would have access to.
Comment by Thomas Bächler (brain0) - Tuesday, 08 February 2011, 19:27 GMT
About the patch itself - I just noticed it uses ifconfig to bring the interface up, it should use ip instead. Also, can we do this with dhcpcd (we use it everywhere) instead of dhclient?
Comment by Daniel Roethlisberger (roe) - Tuesday, 08 February 2011, 19:44 GMT
Regarding the "cannot test" argument:

1) You can set up a local IPv6 network not connected to the Internet.
If you are limited in hardware, use VirtualBox or other virtualization
software to run your simulated network of a few IPv6 nodes, routers etc.

2) You can use a tunneling solution; SixXS.net is good and free and
certainly stable enough for use in testing and development.
IMO, static tunneling would even be fit for production use.

3) You can switch ISP to one which has already done their homework:
http://www.sixxs.net/faq/connectivity/?faq=native&country=de
(not sure if they fall in the "don't have access" category)
Comment by Thomas Bächler (brain0) - Tuesday, 08 February 2011, 20:42 GMT
Let's say it another way: I can't test it because I don't have the time to set all that stuff up and test. Sorry, I just don't.

What about the guy that thinks this is such a high priority - he could test it.


About the topic of IPv6 in general: At some point in the very near future, I will contact my ISP and see what their timeline towards IPv6 support is. I remember a quote from a guy that manages a big university network - he says that while the hardware vendors claim that there is IPv6 support in their products, none of it actually works right and their promises don't add up. This means that setting up IPv6 infrastructure is impossible for them right now, even though they desperately want to. That is of course no excuse that IPv6 support on Arch is moving along so slowly - Linux should work fine in general.
Comment by Ionut Biru (wonder) - Saturday, 12 February 2011, 13:43 GMT
for ipv6 static gateway i think is best to see  FS#18700 
Comment by Chris Darnell (cedeel) - Wednesday, 09 March 2011, 01:13 GMT
I really don't see this bug as being valid.
The only thing about IPv6 not being supported by netcfg is DHCPv6, so file a bug about that instead please.

Static addresses work
Stateless addresses work

For stateless, without DHCP support, all you'd need is a DNS server in /etc/resolv.conf
For stateful static addressing, use iproute2, which is the supported networking mechanism.

ifconfig and route have both been deprecated for years now.
Comment by Bob Bregant (bregant2) - Friday, 10 June 2011, 17:19 GMT
I stumbled across this while fighting to get my fresh Arch install to connect to my DHCPv6 server properly. It's not that much trouble to get a 6-in-4 tunnel from SixXS (and their customer support is top notch) in case you want to test this one out yourselves, but this patch (against the current GIT tree) should be a simpler version of the original that eliminates some of the concerns of the commenters. It does not handle stateless or stateful static, just DHCPv6. It still does not support dhcpcd, though, as it appears that there is no way to configure dhcpcd to use IPv6.

Here's a brief description of the changes:
Added an explicit IPv4 declaration to the original dhclient call and specified a lease file for it just to make sure that it wouldn't conflict with the IPv6 version. Copied the original dhclient call for the new IPv6 call and placed it within a separate checkyesno block. Modified that dhclient call to be explicit in supporting IPv6 and to use a separate PID file and lease file (so that the two processes don't clobber each other's data).

Here's the new parameters that it adds to the profiles:
DHCLIENT_V6 - This defaults to "no" just like the DHCLIENT parameter and is within the DHCLIENT if statement, so if you aren't using DHCLIENT, then you won't need to worry about this.
DHCLIENT6_OPTIONS - This is just a separate version of the DHCLIENT_OPTIONS parameter because some parameters only apply to DHCPv6, so you need to put them in their own string.

EDIT: Just to be clear this patch does work on my systems.
Comment by Rémy Oudompheng (remyoudompheng) - Saturday, 11 June 2011, 18:29 GMT
Please test my Git repository at git://projects.archlinux.org/users/remy/netcfg.git

Loading...