NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bin/56661: ip6mode=autohost after rtsol/rtsold/dhcp reshuffle is severely broken



>Number:         56661
>Category:       bin
>Synopsis:       ip6mode=autohost after rtsol/rtsold/dhcp reshuffle is severely broken
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Jan 23 22:05:00 +0000 2022
>Originator:     he%NetBSD.org@localhost
>Release:        NetBSD 9.2
>Organization:
	I Try...
>Environment:
System: NetBSD mt.urc.uninett.no 9.2 NetBSD 9.2 (GENERIC) #0: Wed May 12 13:15:55 UTC 2021  mkrepro%mkrepro.NetBSD.org@localhost:/usr/src/sys/arch/amd64/compile/GENERIC amd64
Architecture: x86_64
Machine: amd64
>Description:
	In the era before the large reshuffle of rtsol/rtsold/dhcp
	where we saw the actual commands rtsol and rtsold being
	removed and functionality-wise replaced by dhcpcd, you could
	configure a NetBSD host running on a network which allowed
	IPv6 address autoconfiguration with ip6mode=autohost, and
	choose between rtsol=YES or rtsold=YES for either a one-shot
	setting of the ipv6 default route or have a daemon which
	listens to IPv6 router advertisments and acts on the result
	wrt. setting or updating the IPv6 default route, typically
	useful if you have more than one router providing connectivity
	to your network.

	Hence, it was easy to run a host with a network with only
	"router advertisments", and to use autoconfigured IPv6
	addresses to gain working IPv6 network access.


	However, in the era after rtsol and rtosld was removed and
	dhcpcd took over the functionality, ip6mode=autohost is now
	basically broken, because /etc/rc.d/network does not ensure
	that an IPv6 default route is set.  Inside that startup file
	we find this nugget:

        if checkyesnox rtsol && ! checkyesno dhcpcd; then
                if [ "$ip6mode" = "autohost" ]; then
                        echo
                        warn "rtsol has been removed, " \
                            "please configure dhcpcd in its place."
                fi
        fi

	So... This is a joke, right?

	Suddenly, going from getting a nice working IPv6 config with
	just two settings in rc.conf, you as a user are forced to
	embark on a multi-hour project of comprehending the dhcpcd(8)
	man page, and you need to personally figure out what options
	you need to specify to get basically the same functionality as
	rtsol / rtsold.
	
	This is not reasonable.

	Even the concept that you are forced to configure something
	more (without little other guidance than the dhcpcd(8) man
	page) to get something which has "auto" in it's name working
	is, IMHO, quite user-hostile.

	
	Even though the rtsol and rtsold commands are gone, there is
	still an rtsold(8) man page which in netbsd-9 gives *some*
	information about dhcpcd, but the command provided there is
	not useful to set a default ipv6 route, but instead does
	"here's how you can inspect what data rtsol would have
	previous worked on" without actually doing anything(!)
	I.e. not exactly very helpful in solving the "no ipv6 default
	route" problem.


	In this particular case, I have a static IPv4 address, and a
	manually configured /etc/resolv.conf, neither of which I want
	dhcpcd to mess with, so I'm slightly apprehensive of "letting
	dhcpcd loose" on my config.


	Ref. the workaround below, it also feels somewhat strange to
	run "dhcpcd --nodhcp6": "run the DHCP client daemon, but,
	actually, don't do DHCP anyway", but I guess I can live with
	the command name, especially if it's run for me automatically
	by /etc/rc.d/network.


	And ... "--nodhcp6" appears to be an undocumented option in
	the dhcpcd(8) man page, both in -current and on netbsd-9.
	It's mentioned in the rtsold / rtsol man page, rtsold(8).


	I might also comment that it's quite difficult to find out via
	the dhcpcd(8) man page what options to supply to do an IPv6
	Router Solitication operation.  Sure, the man page says

     dhcpcd is also an implementation of the IPv6 Router Solicitor as
     specified in RFC 4861 and RFC 6106.

	but that's the only occurrance of "Solicit" in the man page,
	so it's quite difficult to get at what options to supply to
	get it to perform that operation.

	I know there is this dichotomy between dhcp and address auto-
	configuration in IPv6, but...  It seems that the information
	to do the equivalent of "rtsol" is buried in all the dhcp
	complexity in the dhcpcd(8) man page, almost as if the author
	wanted to push an agenda of "use DHCP instead!", which I think
	is quite counter-productive, and a stance we should not take.

	
>How-To-Repeat:
	Connect a host to a network with router advertisments for IPv6
	address autoconfiguration turned on, and ip6mode=autohost
	configured, and watch this result in no IPv6 default route.

>Fix:
	This needs fixing for improved usability.

	I would be fine with ip6mode=autohost to automatically install
	an IPv6 default route by /etc/rc.d/network, as a one-shot.

	What one should configure to correspond with rtsold=YES, I
	don't quite know.

	Pushing each and every user who wants to use ip6mode=autohost
	to deal with dhcpcd on his own does not result in a good user
	experience.


	For now I have put

	!dhcpcd -dB61 --nodhcp6 nfe0

	inside my /etc/ifconfig.nfe0 (I might drop the 'd' later), but
	that looks very much like a hack, and I would welcome a
	solution which follows the spirit of "auto" -- as this one
	doesn't.



Home | Main Index | Thread Index | Old Index