7 3

[alpine-devel] [Alpine 2.4] Network Interface Hotplugging Detection

Der Tiger
Details
Message ID
<509147AC.8030105@arcor.de>
Sender timestamp
1351698348
DKIM signature
missing
Download raw message
It seems Alpine does not detect link up and down events on NICs.

My Alpine system has two NICs (Intel and RealTek) installed, which both
work fine as long as the link stays up. If I disconnect one of the
cables, the link goes down, as can be expected. Once the cable is
reconnected, the link stays down and dhcpcd won't renew the ip address
from an external DHCP server, even if I manually trigger a renew. Alpine
therefore ignores any link state changes.

AFAIK, link up and down events are usually handled by daemons like
ifplugd (http://linux.die.net/man/8/ifplugd), netplugd
(http://linux.die.net/man/8/netplugd) or hotplug
(http://linux.die.net/man/8/hotplug). Unfortunately I cannot find any of
those tools available as installable package for Alpine.

Is there any other way Alpine is supposed to handle link up and down
events (e.g. directly by the kernel)?

Does link event handling on Alpine require a certain configuration
(apart from /etc/network/interfaces) in order to work properly?

If, at this stage, Alpine doesn't handle link up and down events on NICs
at all, I will gladly contribute one of the utilities mentioned above as
installable package. On the other hand, if there is a solution allready
in place, which is just not configured properly on my system, I'd rather
use the solution available than create a redundant package.

Thank you for your input!

Regards, Tiger



---
Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---
Natanael Copa
Details
Message ID
<20121031205406.79aa5da2@ncopa-laptop.res.nor.wtbts.net>
In-Reply-To
<509147AC.8030105@arcor.de> (view parent)
Sender timestamp
1351713246
DKIM signature
missing
Download raw message
On Wed, 31 Oct 2012 16:45:48 +0100
Der Tiger <der.tiger.alpine@arcor.de> wrote:

> It seems Alpine does not detect link up and down events on NICs.

What kernel is it?
> 
> My Alpine system has two NICs (Intel and RealTek) installed, which
> both work fine as long as the link stays up. If I disconnect one of
> the cables, the link goes down, as can be expected. Once the cable is
> reconnected, the link stays down and dhcpcd won't renew the ip address
> from an external DHCP server, even if I manually trigger a renew.

This is most likely a bug in kernel driver.

I know that the r8169 driver got some signifcant changes with 3.4
kernel. I noticed today that I can no longer set link speed with
ethtool on one of my boxes.

Does it happen with intel nic too?

Does it happen with v2.4.5 iso (with 3.3 kernel)

> Alpine therefore ignores any link state changes.
> 
> AFAIK, link up and down events are usually handled by daemons like
> ifplugd (http://linux.die.net/man/8/ifplugd), netplugd
> (http://linux.die.net/man/8/netplugd) or hotplug
> (http://linux.die.net/man/8/hotplug). Unfortunately I cannot find any
> of those tools available as installable package for Alpine.

add dhcpcd to that list.

> Is there any other way Alpine is supposed to handle link up and down
> events (e.g. directly by the kernel)?

No this is a bug.

Do you think you could test the latest edge snapshot iso? or wait for
v2.5_rc1 which should be be released tomorrow.

> Does link event handling on Alpine require a certain configuration
> (apart from /etc/network/interfaces) in order to work properly?

No

> If, at this stage, Alpine doesn't handle link up and down events on
> NICs at all, I will gladly contribute one of the utilities mentioned
> above as installable package. On the other hand, if there is a
> solution allready in place, which is just not configured properly on
> my system, I'd rather use the solution available than create a
> redundant package.

I wouldn't mind to add ifplugd but I don't think I would ever use it.
dhcpcd does the job for me.

> 
> Thank you for your input!
> 
> Regards, Tiger

Thanks for your feedback!

-nc


---
Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---
Der Tiger
Details
Message ID
<509188C2.7080209@arcor.de>
In-Reply-To
<20121031205406.79aa5da2@ncopa-laptop.res.nor.wtbts.net> (view parent)
Sender timestamp
1351715010
DKIM signature
missing
Download raw message
Hi Natanael,

Thanks for your prompt reply!

>> It seems Alpine does not detect link up and down events on NICs.
> What kernel is it?
That's 3.4.13, but I can reproduce the behaviour at least down to 3.3.

> Does it happen with intel nic too?
I'm not sure. I'll have to verify that ASAP.

> Does it happen with v2.4.5 iso (with 3.3 kernel)
Yepp, it does.

>> AFAIK, link up and down events are usually handled by daemons like
>> ifplugd, netplugd or hotplug
> add dhcpcd to that list.
Didn't know that. That's, of course, a lead to follow. I'm going to
check the dhcpcd configuration, tomorrow.

> Do you think you could test the latest edge snapshot iso? or wait for
> v2.5_rc1 which should be be released tomorrow.
I prefer to wait for tomorrow's 2.5 rc1 and come back to you with more
info as soon as I've tested the new release candidate.

> I wouldn't mind to add ifplugd but I don't think I would ever use it.
> dhcpcd does the job for me.
Wouldn't do any good to add ifplugd, since dhcpcd does the link
handling, anyway. I just have to "motivate" dhcpcd to call ifup or
ifdown whenever the link status changes. Should be a configuration
problem, if it's not a kernel bug.

Regards, Tiger


---
Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---

Re: [alpine-devel] [Alpine 2.4] Network Interface Hotplugging Detection

Timo Teräs
Details
Message ID
<1351715904.10131.2.camel@Nokia-N900>
In-Reply-To
<509188C2.7080209@arcor.de> (view parent)
Sender timestamp
1351715904
DKIM signature
missing
Download raw message
Hi,

> > > It seems Alpine does not detect link up and down events on NICs.
> > What kernel is it?
> That's 3.4.13, but I can reproduce the behaviour at least down to 3.3.

Kernel detects it for me. But often dhcpd exits if it does not get lease within some time.

> > > AFAIK, link up and down events are usually handled by daemons like
> > > ifplugd, netplugd or hotplug
> > add dhcpcd to that list.
> Didn't know that. That's, of course, a lead to follow. I'm going to
> check the dhcpcd configuration, tomorrow.

I just configured my dhcpd to never exit, and it handles the link state changes properly.

But if you want net specific static ip or dhcp params you probably need one of those hotplug things.

-Timo



---
Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---
Natanael Copa
Details
Message ID
<20121101105243.054f0b66@ncopa-desktop.nor.wtbts.net>
In-Reply-To
<1351715904.10131.2.camel@Nokia-N900> (view parent)
Sender timestamp
1351763563
DKIM signature
missing
Download raw message
On Wed, 31 Oct 2012 22:38:24 +0200
Timo Teräs <timo.teras@iki.fi> wrote:

> Hi,
> 
> > > > It seems Alpine does not detect link up and down events on NICs.
> > > What kernel is it?
> > That's 3.4.13, but I can reproduce the behaviour at least down to
> > 3.3.
> 
> Kernel detects it for me. But often dhcpd exits if it does not get
> lease within some time.

I suppose you mean dhcpcd.

> > > > AFAIK, link up and down events are usually handled by daemons
> > > > like ifplugd, netplugd or hotplug
> > > add dhcpcd to that list.
> > Didn't know that. That's, of course, a lead to follow. I'm going to
> > check the dhcpcd configuration, tomorrow.
> 
> I just configured my dhcpd to never exit, and it handles the link
> state changes properly.
> 
> But if you want net specific static ip or dhcp params you probably
> need one of those hotplug things.

dhcpcd can be configured to set static ip too on link detection.

-nc


---
Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---
Natanael Copa
Details
Message ID
<20121101164021.49481c5f@ncopa-desktop.nor.wtbts.net>
In-Reply-To
<509188C2.7080209@arcor.de> (view parent)
Sender timestamp
1351784421
DKIM signature
missing
Download raw message
On Wed, 31 Oct 2012 21:23:30 +0100
Der Tiger <der.tiger.alpine@arcor.de> wrote:

> Hi Natanael,
> 
> Thanks for your prompt reply!
> 
> >> It seems Alpine does not detect link up and down events on NICs.
> > What kernel is it?
> That's 3.4.13, but I can reproduce the behaviour at least down to 3.3.
> 
> > Does it happen with intel nic too?
> I'm not sure. I'll have to verify that ASAP.
> 
> > Does it happen with v2.4.5 iso (with 3.3 kernel)
> Yepp, it does.
> 
> >> AFAIK, link up and down events are usually handled by daemons like
> >> ifplugd, netplugd or hotplug
> > add dhcpcd to that list.
> Didn't know that. That's, of course, a lead to follow. I'm going to
> check the dhcpcd configuration, tomorrow.

I just remembered. I think you can run dhcpcd in 2 ways.
1) configure the interface as 'dhcp' in /etc/network/interfaces and let
   busybox ifup it.

2) remove all interfaces (maybe except lo) from /etc/network/interfaces
   and then run dhcpcd as standalone. 'rc-service dhcpcd start'
   and 'rc-update add dhcpcd'. dhcpcd will by default give all
   interfaces a dhcp address on link detection. You can configure it to
   ignore given interfaces, and set static ip address on link detect
   in /etc/dhcpcd/dhcpcd.conf


I'm not sure if the link detection is enabled in mode #1 but i know for
sure that mode #2 works.

-nc


---
Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---
Der Tiger
Details
Message ID
<5093F44D.8090103@arcor.de>
In-Reply-To
<20121101164021.49481c5f@ncopa-desktop.nor.wtbts.net> (view parent)
Sender timestamp
1351873613
DKIM signature
missing
Download raw message
ReHi Natanael,

>>>> AFAIK, link up and down events are usually handled by daemons like
>>>> ifplugd, netplugd or hotplug
>>> add dhcpcd to that list.
>> Didn't know that. That's, of course, a lead to follow. I'm going to
>> check the dhcpcd configuration, tomorrow.
> 
> I just remembered. I think you can run dhcpcd in 2 ways.
> 1) configure the interface as 'dhcp' in /etc/network/interfaces and let
>    busybox ifup it.
> 
> 2) remove all interfaces (maybe except lo) from /etc/network/interfaces
>    and then run dhcpcd as standalone. 'rc-service dhcpcd start'
>    and 'rc-update add dhcpcd'. dhcpcd will by default give all
>    interfaces a dhcp address on link detection. You can configure it to
>    ignore given interfaces, and set static ip address on link detect
>    in /etc/dhcpcd/dhcpcd.conf
> 
> I'm not sure if the link detection is enabled in mode #1 but i know for
> sure that mode #2 works.

I upgraded my system to Alpine 2.5 rc1 (kernel 3.6.4). Hotplugging is
now recognized by the kernel on both NICs, again. I suppose it has been
a kernel bug that caused the interfaces (at least the RealTek NIC) to
stay down after reconnecting the network cable.

I also tried the dhcpcd variant (mode #2 in your description above), but
was unable to assign two static ipv4 addresses as well as static ipv6
addresses to a single interface in /etc/dhcpcd.conf. From what I
gathered roaming the WWW, dhcpcd isn't able to handle neither static
ipv6 addresses, nor multiple ipv4 addresses on the same interface.

Anyway, since the ifup/ifdown (mode #1) is now working fine, I see no
reason to change to dhcpcd, even if dhcpcd would have been my preferred
mode.

Thanks for your help!

Kind Regards, Tiger


---
Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---
Natanael Copa
Details
Message ID
<20121102223319.01a74d0f@ncopa-laptop.res.nor.wtbts.net>
In-Reply-To
<5093F44D.8090103@arcor.de> (view parent)
Sender timestamp
1351891999
DKIM signature
missing
Download raw message
On Fri, 02 Nov 2012 17:26:53 +0100
Der Tiger <der.tiger.alpine@arcor.de> wrote:
> > 2) remove all interfaces (maybe except lo)
> > from /etc/network/interfaces and then run dhcpcd as standalone.
> > 'rc-service dhcpcd start' and 'rc-update add dhcpcd'. dhcpcd will
> > by default give all interfaces a dhcp address on link detection.
> > You can configure it to ignore given interfaces, and set static ip

...
 
> I also tried the dhcpcd variant (mode #2 in your description above),
> but was unable to assign two static ipv4 addresses as well as static
> ipv6 addresses to a single interface in /etc/dhcpcd.conf. From what I
> gathered roaming the WWW, dhcpcd isn't able to handle neither static
> ipv6 addresses, nor multiple ipv4 addresses on the same interface.

I wouldn't have known it unless Roy himself had told me, and pointing
out that its mentioned in the manpage. (something we should add to our
wiki so googles indexer finds it?).

From the man page:

     static value
             Configures a static value.  If you set ip_address then
     dhcpcd will not attempt to obtain a lease and just use the value
     for the address with an infinite lease time.

             Here is an example which configures a static address,
             routes and dns.
                   interface eth0
                   static ip_address=192.168.0.10/24
                   static routers=192.168.0.1
                   static domain_name_servers=192.168.0.1


Looks like it also has some support for ipv6. I dont know about static.

-nc


---
Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---