"ping6: sendto: Network is unreachable" after unplugging and plugging the ethernet cable

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

"ping6: sendto: Network is unreachable" after unplugging and plugging the ethernet cable

Jump to solution
5,868 Views
stefano_cappa_k
Contributor III

Hi,

I'm using an iMX6ULL evk board.

My problem is about ipv6 multicast after unplugging/plugging ethernet cable. But let me explain in details:

I built an image with these packages:

- ntp and ntpupdate

- iproute2

- dhcpcd
- bind

- mdns

- systemd

and other basic tools, that probably aren't relevant

I setup systemd-networkd in this way: /etc/systemd/network/eth0.network:

[Match]
Name=eth0

[Network]
DHCP=no

Automatically my system starts these processes:

- mdns

- bind <------ I don't know if it is really required, I used this to do some experiments

- systemd-networkd (obviously)

- ntpd

Then I start "dhcpcd -i eth0" to have a dhcp server.

Running ifconfig without ethernet cable the result is:


eth0 Link encap:Ethernet HWaddr 9A:06:AA:21:D9:3A
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 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:4 errors:0 dropped:0 overruns:0 frame:0
TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:158 (158.0 B) TX bytes:158 (158.0 B)

If I attach ethernet cable, thanks to dhcpcd I can get a Link Local ipv4 address easily.

If I reboot my system with ethernet cable previously attached to a real modem, but without dhcpcd (and systemd configured without dhcpcd), the result is:

eth0 Link encap:Ethernet HWaddr 52:31:61:9D:36:FA
inet6 addr: fe80::5031:61ff:fe9d:36fa/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:51 errors:0 dropped:0 overruns:0 frame:0
TX packets:20 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:8490 (8.2 KiB) TX bytes:2126 (2.0 KiB)

Running dhcpcd -i eth0 the result is:

root@evk-fslc:~# dhcpcd -i eth0
DUID 00:01:00:01:c7:92:be:43:f6:73:fa:ed:7b:b9
eth0: IAID 61:9d:36:fa
[ 668.714011] Micrel KSZ8081 or KSZ8091 20b4000.ethernet-1:02: attached PHY driver [Micrel KSZ8081 or KSZ8091] (mii_bus:phy_addr=20b4000.ethernet-1:02, irq=POLL)
[ 668.767487] IPv6: ADDRCONF(NETDEV_UP): eth1: link is not ready
eth1: waiting for carrier
eth0: rebinding lease of 192.168.1.139
eth0: NAK: from 192.168.1.1
eth0: soliciting an IPv6 router
eth0: soliciting a DHCP lease
eth0: Router Advertisement from fe80::62e3:27ff:fef1:8833
eth0: soliciting a DHCPv6 lease
eth0: offered 192.168.1.140 from 192.168.1.1
eth0: probing address 192.168.1.140/24
eth0: leased 192.168.1.140 for 86400 seconds
eth0: adding route to 192.168.1.0/24
eth0: adding default route via 192.168.1.1
forked to background, child pid 424

and ifconfig prints:

root@evk-fslc:~# ifconfig
eth0 Link encap:Ethernet HWaddr 52:31:61:9D:36:FA
inet addr:192.168.1.140 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::5031:61ff:fe9d:36fa/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:517 errors:0 dropped:0 overruns:0 frame:0
TX packets:107 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:92869 (90.6 KiB) TX bytes:15241 (14.8 KiB)

eth1 Link encap:Ethernet HWaddr 8E:51:A7:B0:CA:9B
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 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:25 errors:0 dropped:0 overruns:0 frame:0
TX packets:25 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1574 (1.5 KiB) TX bytes:1574 (1.5 KiB)

If I ping ipv6 multicast address the result is:

root@evk-fslc:~# ping6 ff02::fb
PING ff02::fb (ff02::fb): 56 data bytes
64 bytes from fe80::5031:61ff:fe9d:36fa: seq=0 ttl=64 time=2.484 ms
64 bytes from fe80::18a3:89b7:d6d1:49: seq=0 ttl=64 time=53.415 ms (DUP!)
64 bytes from fe80::3e28:6dff:feed:5b97: seq=0 ttl=64 time=129.909 ms (DUP!)
64 bytes from fe80::5031:61ff:fe9d:36fa: seq=1 ttl=64 time=0.786 ms
64 bytes from fe80::18a3:89b7:d6d1:49: seq=1 ttl=64 time=58.024 ms (DUP!)
64 bytes from fe80::3e28:6dff:feed:5b97: seq=1 ttl=64 time=133.957 ms (DUP!)

--- ff02::fb ping statistics ---
2 packets transmitted, 2 packets received, 4 duplicates, 0% packet loss
round-trip min/avg/max = 0.786/63.095/133.957 ms

So everything is ok, but when I unplug and plug ethernet cable, the result becomes:

root@evk-fslc:~# [ 1097.855919] fec 20b4000.ethernet eth0: Link is Down

root@evk-fslc:~# [ 1104.097304] fec 20b4000.ethernet eth0: Link is Up - 100Mbps/Full - flow control rx/tx

root@evk-fslc:~# ping6 ff02::fb
PING ff02::fb (ff02::fb): 56 data bytes
ping6: sendto: Network is unreachable

Now I'm not able to run ping6 ff02::fb anymore also restarting systemd-networkd, dhcpcd and so on.

I don't understand the reason. :smileycry:

Andy Duan suggested to check if my kernel has CONFIG_IP_MULTICAST and /proc/sys/net/ipv6/conf/eth0/disable_ipv6 is 0 (also after the problem).

About CONFIG_IP_MULTICAST, both if enabled or not the behaviour is the same.

Instead, /proc/sys/net/ipv6/conf/eth0/disable_ipv6 is always 0, before and after cable unplugging/plugging.

This problem happens in all these configurations:

- yocto sumo (kernel IMX 4.9.88 and u-boot IMX 2017.03)

- yocto sumo (kernel 4.17 FSLC and u-boot 2018.07 FSLC + u-boot-fslc-fw-utils)

- yocto thud (kernel IMX 4.9.123 and u-boot IMX 2017.03 + u-boot-fw-utils-imx)

- and probably also with thud fslc

I talked about this topic also here, but I don't know if they are related:

- NXP: i.MX Linux FEC Driver Drops IPV6 Multicasts &amp; Promiscuous Setting 

- LINUX NETDEV: iMX6 FEC driver Linux-fslc 4.17 - IPV6 Multicast not working when unplugging/plugging ethernet cable... 

- Yocto mailing list: [yocto] iMX6 FEC driver Linux-fslc 4.17 - IPV6 Multicast not working when unplugging/plugging ethern... 

- meta-freescale mailing list: [meta-freescale] iMX6 FEC driver Linux-fslc 4.17 - IPV6 Multicast not working when unplugging/pluggi... 

The real problem is that I don't know where to search. Is it either a driver problem, or a kernel config problem or something about yocto? I "spammed" in every possible mailing list :smileyhappy:, but I'm completely blocked.

Thank u.

Labels (4)
1 Solution
4,757 Views
stefano_cappa_k
Contributor III

I fixed this issue building the kernel with both CONFIG_IP_MULTICAST, IPV6_MULTIPLE_TABLES and IPV6_SUBTREES enabled in menuconfig.

View solution in original post

0 Kudos
2 Replies
4,758 Views
stefano_cappa_k
Contributor III

I fixed this issue building the kernel with both CONFIG_IP_MULTICAST, IPV6_MULTIPLE_TABLES and IPV6_SUBTREES enabled in menuconfig.

0 Kudos
4,757 Views
igorpadykov
NXP Employee
NXP Employee

Hi Stefano

one can also try with nxp latest L4.14.78 release from source.codeaurora.org repository

Linux L4.14.78_1.0.0 Documentation

https://www.nxp.com/webapp/Download?colCode=L4.14.78_1.0.0_LINUX_DOCS&appType=license&location=null 

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------