Bug 1015729 - DHCPv6 addresses and default route aren't being set
Summary: DHCPv6 addresses and default route aren't being set
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: dhcp
Version: 19
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jiri Popelka
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-10-05 01:24 UTC by Matt Domsch
Modified: 2014-01-24 07:37 UTC (History)
4 users (show)

Fixed In Version: dhcp-4.2.5-30.fc20
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-01-24 07:37:08 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
0001-ensure-DHCPv6-address-is-on-interface-set-default-ro.patch (1.50 KB, patch)
2013-10-05 01:24 UTC, Matt Domsch
no flags Details | Diff

Description Matt Domsch 2013-10-05 01:24:53 UTC
Created attachment 807993 [details]
0001-ensure-DHCPv6-address-is-on-interface-set-default-ro.patch

Description of problem:
dhclient-script does not set an IPv6 address if obtained via DHCPv6 and if it hasn't changed since the last lease.  However, the address may have been removed from the device (e.g. 'ifdown eth0; ifup eth0').  We need to always set the obtained address on the interface, and we may need to delete the "old" address from an interface if it did change.

Furthermore, we need to set the IPv6 default gateway.  The approach I took was to find the router via ip -6 neighbor | grep router, as dhclient6 does not store the router address anywhere I can find (aside from a syslog message, which I don't want to go grep for).

See attached patch.

Version-Release number of selected component (if applicable):
dhclient-4.2.5-23.fc19.i686

How reproducible:
always

Steps to Reproduce:
1. ifdown eth0; ifup eth0
2.
3.

Actual results:
"old" IPv6 address is removed from eth0, but not put back, if obtained by DHCP6.  No default route is set.

Expected results:
address is put back on the interface, and default route is set.

Additional info:

Comment 1 Jiri Popelka 2013-11-12 14:46:57 UTC
Hi Matt,

sorry for the delay.

(In reply to Matt Domsch from comment #0)
> Created attachment 807993 [details]
> 0001-ensure-DHCPv6-address-is-on-interface-set-default-ro.patch

Thank you !

> Description of problem:
> dhclient-script does not set an IPv6 address if obtained via DHCPv6 and if
> it hasn't changed since the last lease. However, the address may have been
> removed from the device (e.g. 'ifdown eth0; ifup eth0').

It took mi a while to get your use case. Given that you modify RENEW6|REBIND6 case in your patch
I think you were running 'dhclient -6 eth0' by hand and then did 'ifdown eth0; ifup eth0', right ?
That's quite an artificial use case and I can't imagine how that could occur in normally set system without your interference (running dhclient by hand).
I expect you know that, but just for sure: if you want to have an interface configured via dhcpv6 (while using initscripts) you have to add DHCPV6C=yes into ifcfg-eth0. Initscripts (ifup/ifdown) then run dhclient.
When you run dhclient by hand you break this workflow - it's expected that once you run (manually or via initscripts) dhclient to manage the configuration you are not messing it yourself behind dhclient's back.

> We need to always set the obtained address on the interface,

Even dhcpv4 client doesn't do that.

I'm of course willing to add sanitizing of the corner cases, but not in this case, because
before we add (in dhclient-script) ipv6 address we do duplicate address detection (DAD), which takes some time during which the interface will be without an address.

> and we may need to delete the "old" address from an interface if it did change.

I can imagine such case, so I'm going to add this change.

    if [  ! "${new_ip6_address}" = "${old_ip6_address}" ]; then
+        if [ -n "${old_ip6_address}" ]; then
+            ip -6 addr del ${old_ip6_address} dev ${interface}
+        fi
        add_ipv6_addr_with_DAD
    fi

> Furthermore, we need to set the IPv6 default gateway.

I'm no so sure. See [1] for details.
I don't think we want to mess with IPv6 default gateway until [2] is implemented.

[1] https://www.isc.org/blogs/routing-configuration-over-dhcpv6-2/
[2] http://datatracker.ietf.org/doc/draft-ietf-mif-dhcpv6-route-option/

Comment 2 Matt Domsch 2013-11-14 19:13:19 UTC
Thanks Jiri.

How are reboots handled with respect to dhclient -6 ?  I provided the suggestion of (ifdown eth0; ifup eth0;) which when testing network configurations, do on occasion.  The alternative is a system reboot.  I believe the same problem would occur - the interface won't get an IPv6 address even though it doesn't have one anymore due to the reboot.

I agree [1] and [2] would be the better solution.  In the absence of those though, what is a user supposed to do?  Hence my suggestion, the only router my client knows about implicitly.

Comment 3 Jiri Popelka 2013-11-15 11:19:52 UTC
(In reply to Matt Domsch from comment #2)
> How are reboots handled with respect to dhclient -6 ?

reboot means sequence of PREINIT6 (always flush all old adresses) and BOUND6 (always add new address) so that should be OK.

Comment 4 Jiri Popelka 2013-11-15 11:22:03 UTC
(In reply to Matt Domsch from comment #2)
> I agree [1] and [2] would be the better solution.  In the absence of those
> though, what is a user supposed to do?  Hence my suggestion, the only router
> my client knows about implicitly.

I may be wrong but IMHO the IPv6 network requires a "router" which sends Router Advertisement (RA) in response to RS. RA tells the client where's default gateway and how to obtain IPv6 address and other info. But I don't think it's possible to configure a client solely by DHCPv6 until [2] gets standard.

CCing Pavel Simerda, Pavel if you have a minute could you confirm/disprove what I've just stated ? Thanks

Comment 5 Jiri Popelka 2013-11-19 11:58:07 UTC
(In reply to Jiri Popelka from comment #4)
> Pavel if you have a minute could you confirm/disprove
> what I've just stated ? Thanks

I'll reply myself. Yes, I seem to be right ;-)
https://mail.gnome.org/archives/networkmanager-list/2012-August/msg00020.html

Comment 6 Pavel Šimerda (pavlix) 2013-11-19 12:24:30 UTC
(In reply to Jiri Popelka from comment #5)
> (In reply to Jiri Popelka from comment #4)
> > Pavel if you have a minute could you confirm/disprove
> > what I've just stated ? Thanks
> 
> I'll reply myself. Yes, I seem to be right ;-)
> https://mail.gnome.org/archives/networkmanager-list/2012-August/msg00020.html

Sorry, je to přesně tak. Tedy alespoň zatím, všiml jsem si, že v této oblasti probíhají drobné a nenápadné změny.

Pavel

Comment 7 Fedora Update System 2014-01-21 11:03:52 UTC
dhcp-4.2.5-30.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/dhcp-4.2.5-30.fc20

Comment 8 Fedora Update System 2014-01-22 03:08:55 UTC
Package dhcp-4.2.5-30.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing dhcp-4.2.5-30.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-1252/dhcp-4.2.5-30.fc20
then log in and leave karma (feedback).

Comment 9 Pete Zaitcev 2014-01-22 19:09:46 UTC
I installed dhcp-4.2.5-30.fc20.i686 and dhclient-4.2.5-30.fc20.i686 from
the update-testing repo and they do not fix my lack of default route problem.

wrt. comment #4, I have autoconf enabled with:

[root@elanor zaitcev]# grep IPV6 /etc/sysconfig/network-scripts/ifcfg-ethmain.2 
IPV6INIT=yes
#IPV6TO4INIT=yes
IPV6_AUTOCONF=yes

[root@elanor zaitcev]# cat /proc/sys/net/ipv6/conf/ethmain.2/accept_ra
1
[root@elanor zaitcev]# cat /proc/sys/net/ipv6/conf/ethmain.2/accept_ra_defrtr 
1

Should I open a new bug rather than hog Matt's?

Comment 10 Jiri Popelka 2014-01-23 09:24:23 UTC
(In reply to Pete Zaitcev from comment #9)
> I installed dhcp-4.2.5-30.fc20.i686 and dhclient-4.2.5-30.fc20.i686 from
> the update-testing repo and they do not fix my lack of default route problem.

I haven't changed anything regarding the default route.

> Should I open a new bug rather than hog Matt's?

Setting default route according to RA is AFAIK NetworkManager's work,
there's no support for this in initscripts.
If you have NM running, please fill a bug against NM.

Comment 11 Fedora Update System 2014-01-24 07:37:08 UTC
dhcp-4.2.5-30.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.