FS#56201 - [netctl] IPv6 autoconfiguration doesn't work
Attached to Project:
Arch Linux
Opened by Andrej Podzimek (andrej) - Thursday, 02 November 2017, 03:14 GMT
Last edited by Jouke Witteveen (jouke) - Thursday, 05 July 2018, 08:35 GMT
Opened by Andrej Podzimek (andrej) - Thursday, 02 November 2017, 03:14 GMT
Last edited by Jouke Witteveen (jouke) - Thursday, 05 July 2018, 08:35 GMT
|
Details
Description:
No IPv6 configuration is done in 'stateless' mode or with 'dhcp' mode and 'dhclient'. Only the 'dhcp' mode combined with 'dhcpcd' generates a (valid global) IPv6 address, but then fails to set the default route, which makes IPv6 unusable. NetworkManager gets the configuration right under exactly the same circumstances. (So do all Android devices, AFAICT.) BTW, the idea of selecting 'stateless' or 'dhcp' in advance is broken by design. It goes against conventions and/or standards. Router advertisements carry configuration flags (set by e.g. AdvManagedFlag and AdvOtherConfigFlag from radvd.conf) that determine whether additional configuration using DHCP will be needed or not. There is no way of knowing that in advance, unless one needs to explicitly prohibit certain types of configuration [which makes the network unusable in ~most cases]. Additional info: * package version(s) netctl 1.14-1 * config and/or log files etc. Description='outbound connection' Connection=ethernet Interface=eno1 ForceConnect=yes IP=dhcp IP6=dhcp # stateless doesn't work, dhcpc-noaddr doesn't work DHCPClient=dhcpcd DHCP6Client=dhcpcd # dhclient doesn't work at all Hostname=charon DNS=(::1) SkipNoCarrier=yes Steps to reproduce: Try to connect to an IPv6 network with a both router advertisements and additional DHCP configuration, e.g. to a default off-the-shelf configuration of a Fritz!BOX router. NetworkManager gets it right. Anroid gets it right. netctl fails. I tried to use 'dhclient' combined with the configuration that NetworkManager auto-generates for it. So I put the following stuff into /etc/dhclient.conf: send host-name "charon"; # added by NetworkManager option rfc3442-classless-static-routes code 121 = array of unsigned integer 8; option ms-classless-static-routes code 249 = array of unsigned integer 8; option wpad code 252 = string; also request rfc3442-classless-static-routes; also request ms-classless-static-routes; also request static-routes; also request wpad; also request ntp-servers; But presumably, that^^^ doesn't work either. Something is simply broken in netctl. It starts dhclient, but gets no address and no route. |
This task depends upon
Closed by Jouke Witteveen (jouke)
Thursday, 05 July 2018, 08:35 GMT
Reason for closing: Upstream
Additional comments about closing: presumably fixed in dhcpcd 7.0.2
Thursday, 05 July 2018, 08:35 GMT
Reason for closing: Upstream
Additional comments about closing: presumably fixed in dhcpcd 7.0.2
If I use dpcpcd(for example, 'systemctl enable dhcpcd@eth0, ...'), then all NIC cards can get proper global IPv6 address.
1) if the profile is added with "IP6=dhcp", then THIS netctl profile cannot start.
[user@ArchLinux netctl]$ sudo systemctl status netctl@school
● netctl@school.service - A basic dhcp ethernet connection
Loaded: loaded (/etc/systemd/system/netctl@school.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Mon 2018-04-23 08:54:40 CST; 6s ago
Docs: man:netctl.profile(5)
Process: 713 ExecStart=/usr/lib/netctl/network start school (code=exited, status=1/FAILURE)
Main PID: 713 (code=exited, status=1/FAILURE)
4月 23 08:54:40 ArchLinux dhcpcd[769]: ens35: carrier lost
4月 23 08:54:40 ArchLinux network[713]: Failed to bring the network up for profile 'school'
4月 23 08:54:40 ArchLinux systemd[1]: netctl@school.service: Main process exited, code=exited, status=1/FAILURE
4月 23 08:54:40 ArchLinux dhcpcd[769]: script_runreason: /usr/lib/dhcpcd/dhcpcd-run-hooks: Terminated
4月 23 08:54:40 ArchLinux dhcpcd[769]: ens35: deleting route to 10.108.100.0/22
4月 23 08:54:40 ArchLinux dhcpcd[769]: ens35: deleting default route via 10.108.100.1
4月 23 08:54:40 ArchLinux dhcpcd[769]: received SIGTERM, stopping
4月 23 08:54:40 ArchLinux dhcpcd[769]: ens35: removing interface
4月 23 08:54:40 ArchLinux dhcpcd[769]: dhcpcd exited
4月 23 08:54:40 ArchLinux systemd[1]: netctl@school.service: Failed with result 'exit-code'.
2) If the profile removes "IP6=dhcp" from it, then netctl profile can start successefully, but it can not get IPv6 global address.
[user@ArchLinux netctl]$ sudo systemctl status netctl@school
● netctl@school.service - A basic dhcp ethernet connection
Loaded: loaded (/etc/systemd/system/netctl@school.service; enabled; vendor preset: disabled)
Active: active (exited) since Mon 2018-04-23 09:26:59 CST; 18s ago
Docs: man:netctl.profile(5)
Process: 1001 ExecStop=/usr/lib/netctl/network stop school (code=exited, status=0/SUCCESS)
Process: 1020 ExecStart=/usr/lib/netctl/network start school (code=exited, status=0/SUCCESS)
Main PID: 1020 (code=exited, status=0/SUCCESS)
Status: "online"
Tasks: 1 (limit: 1166)
Memory: 668.0K
CGroup: /system.slice/system-netctl.slice/netctl@school.service
└─1043 dhcpcd -4 -q -t 30 -L ens35
4月 23 09:26:59 ArchLinux dhcpcd[1027]: DUID 00:01:00:01:22:4a:52:54:00:0c:29:93:1c:74
4月 23 09:26:59 ArchLinux dhcpcd[1027]: ens35: IAID 29:93:1c:74
4月 23 09:27:00 ArchLinux dhcpcd[1027]: ens35: rebinding lease of 10.108.100.99
4月 23 09:27:00 ArchLinux dhcpcd[1027]: ens35: probing address 10.108.100.99/22
4月 23 09:27:04 ArchLinux dhcpcd[1027]: ens35: leased 10.108.100.99 for 5028 seconds
4月 23 09:27:04 ArchLinux dhcpcd[1027]: ens35: adding route to 10.108.100.0/22
4月 23 09:27:04 ArchLinux dhcpcd[1027]: ens35: adding default route via 10.108.100.1
4月 23 09:27:04 ArchLinux dhcpcd[1027]: forked to background, child pid 1043
4月 23 09:27:04 ArchLinux dhcpcd[1043]: ens35: deleted default route via 10.108.100.1
4月 23 09:27:04 ArchLinux network[1020]: Started network profile 'school'
3) the profile for NIC cards is :
# NIC card for ens32
Description='A basic dhcp ethernet connection'
Interface=ens32
Connection=ethernet
IP=static
Address=('192.168.0.60/24' '192.168.60.60/24')
DNS=('192.168.0.1')
#DHCPClient=dhcpcd
#DHCPReleaseOnStop=no
# for DHCPv6
#IP6=dhcp
#DHCP6Client=dhclient
## for IPv6 autoconfiguration
#IP6=stateless
=======================
# NIC card of ens35
Description='A basic dhcp ethernet connection'
Interface=ens35
Connection=ethernet
IP=dhcp
#DHCPClient=dhcpcd
#DHCPReleaseOnStop=no
# for DHCPv6
#IP6=dhcp
#DHCP6Client=dhclient
#DHCP6Client=dhcpcd
# for IPv6 autoconfiguration
#IP6=stateless
#1: I use 'IP6=stateless', then no IPv6 address is generated, which it should
#2: I use 'IP6=dhcp' and 'DHCP6Client=dhclient', also no IPv6 address is obtained from DHCPv6, which it should
#3: I use 'IP6=dhcp' and 'DHCP6Client=dhcpcd', a IPv6 address is successfully obtained and reachable, but it expires after two hours without renew
The only workaround is to use static IPv6 address.
My package versions:
netctl 1.16-1
dhclient 4.4.1-4
dhcpcd 7.0.1-1
linux 4.16.4-1
Maybe dhcpcd has changed and now has a bug in supporting separate instances for separate protocols. However, this does not explain why things are also broken with dhclient. Do things work properly with IPv4 disabled ('IP=no')?
running dhcpcd, either for IPv4 or IPv6, would disable IPv6 auto configuration, forever.
dhcpcd would:
1. set `net.ipv6.conf.interface.accept_ra=0`
2. set `net.ipv6.conf.interface.autoconf=0`
3. disable link local address auto configuration (dhcpcd: if-linux.c#L1644).
The `accept_ra` setting would be reverted to 1 by netctl if "IP6=stateless" is set, but the latter
two settings would never be reverted, either by netctl or dhclient, until reboot.
However,
- dhclient requires a link local IPv6 address to perform DHCPv6.
- Stateless configuration ("IP6=stateless") requires `autoconf` setting to be 1.
To summarize, if you have ever used dhcpcd for either IPv4 or IPv6, then stateless IPv6 configuration
and DHCPv6 by dhclient would never work. The only choice is to stick with dhcpcd for DHCPv6.
However, in my case, dhcpcd cannot renew the DHCPv6 lease after it expires (I believe this is netctl related,
but not so relavent to this issue though), so dhcpcd is not an option for me.
Another choice is to never use dhcpcd. But it seems that netctl's default option is to use dhcpcd, so you have
to remember to add DHCPClient=dhclient and DHCP6Client=dhclient to all netctl profiles.
(Uninstall dhcpcd would not make netctl fallback to dhclient)
EDIT:
In netctl, the default DHCPClient is dhcpcd and the default DHCP6Client is dhclient, which seems reasonable.
So the root issue here is that dhcpcd for IPv4 only should not touch any IPv6 settings.
EDIT2:
You can use netctl hooks to set default dhcp client. See https://wiki.archlinux.org/index.php/netctl#Set_default_DHCP_client