cubieplayer / Cubian

Debian for Cubieboard
http://cubian.org
271 stars 49 forks source link

Connectivity lost after ethernet link has gone down/up #465

Open pe1chl opened 8 years ago

pe1chl commented 8 years ago

On a Cubieboard2 we observe the issue that connectivity on ethernet does not come back when the ethernetlink is disconnected and again re-connected. When the interface is set up with DHCP the system becomes completely unreachable, when it is set up with a static address the address and local subnet remains but the default route is deleted so connectivity to/from internet is lost.

It is unclear to me what really happens, other Debian derived distributions including Raspberry Pi handle this without problem. The link down/up event is logged in /var/log/messages like this:

Jul 31 00:24:35 boom kernel: [42509.319623] sunxi_emac sunxi_emac.0: eth0: link down
Jul 31 00:24:35 boom kernel: [42509.324776] ADDRCONF(NETDEV_UP): eth0: link is not ready
Jul 31 00:25:17 boom kernel: [42551.322212] sunxi_emac sunxi_emac.0: eth0: link up, 100Mbps, full-duplex, lpa 0x45E1
Jul 31 00:25:17 boom kernel: [42551.327629] ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready

When looking in a shell, the normal line in "ip route list" of

default via 192.168.1.1 dev eth0

disappears. Is there something triggered because of the "link down" that does not recover after "link up"? (the removing and adding of the routes, I mean)

estevesd commented 8 years ago

I managed to solve this issue by putting auto eth0 iface eth0 inet dhcp in /etc/network/interfaces and by using ifplugd with settings forcing it to use eth0 in /etc/default/ifplugd

pe1chl commented 8 years ago

Ok I already had that in /etc/network/interfaces (and alternately tried "iface eth0 inet static"), and in /etc/default/ifplugd there is the (supposedly default):

INTERFACES="all"
HOTPLUG_INTERFACES="all"
ARGS="-q -f -u0 -d10 -w -I"
SUSPEND_ACTION="stop"

Did you change anything there?

estevesd commented 8 years ago

yes i changed since there's no other interfaces INTERFACES="eth0" HOTPLUG_INTERFACES="eth0" ARGS="-q -f -u0 -d0 -w -I" SUSPEND_ACTION="stop"

also consider the -u and -d options, they specify a delay in seconds to reconfigure the interface on up and down http://linux.die.net/man/8/ifplugd for other options. for example -q -f and -I are normally off by default however it works for me with the above settings

pe1chl commented 8 years ago

Ok I will test... will take some time, need to be near the board.

pe1chl commented 8 years ago

It looks like it does not fix the issue for me. I also tried some delay after "up" using -u2 and then the interface fails to get an address even after reboot. It looks there is some race condition that may be fixed for some people by tweaking that file but it is not a reliable solution.

pe1chl commented 8 years ago

It looks like a better option is to just remove the entire ifplugd package. It appears to serve no useful purpose, it was written by a wellknown daemon artist who keeps adding functionality to the system that I do not like... To be tested soon!