On Thu, Jul 21 2016, Bob Proulx wrote:
> Note that I am not the maintainer but simply another user.

Hi Bob.  I lurk on debian-user, and thought about posting there rather
than open this bug, either way - you came to the rescue, much
appreciated!  ;-)

> Gerald Turner wrote:
>> I have a Linux router running jessie that has four ethernet ports and
>> a pair of ath9k radios.
>>
>> Three of the ethernet interfaces (eth0, eth1, eth2) are statically
>> configured LAN ports.  The fourth ethernet interface (eth3) is
>> connected to an ISP via cable modem and uses DHCP¹.  The two wlan
>> interfaces are also configured statically and have hostapd running.
>
> It sounds like you and I have very similar environments.  Therefore I
> decided I would share what I am doing here.  Since I am doing things
> completely differently and it is working great for me.  YMMV.

Do you have the need for DHCPv6-PD from your ISP as well?  I'd be
interested in how your setup differs in that regard, offline from this
BTS report.

>> See attached /etc/network/interfaces and syslog files.
>
> One (trivial) comment is that you can simplify your config file by
> using the more compact CIDR /23 netmask syntax rather than the full
> line stating netmask 255.255.254.0 as needed many moons ago.
>
>   auto eth0
>   iface eth0 inet static
>     address 192.168.242.1/23

I like the CIDR notation and must have missed the memo so many moons
ago, thanks!

> Secondly I don't see where you are starting hostapd.  Therefore I
> assume you are starting it through systemd.  In my case I am not using
> systemd but am starting hostapd in an 'up' section of the interfaces
> file.  Here is a representative interfaces section.
>
>   allow-hotplug wlan0
>   iface wlan0 inet static
>           address 192.168.93.1/24
>           hostapd /etc/hostapd/hostapd-wlan0.conf
>           up service isc-dhcp-server restart
>
> This way everything flows correctly in the correct order.  The
> interface is detected and the allow-hotplug invokes the event driven
> flow.  (As opposed to the init drive flow of auto.)  The hostapd is
> started via the hostapd configuration line.  I have multiple radio
> interfaces and therefore multiple configuration files.  (I could
> probably use /etc/hostapd/hostapd-$IFACE.conf using $IFACE but I
> rather like the plain version.)  This is the ifupdown method described
> in the /usr/share/doc/hostapd/README.Debian file.

This is a great impovement, thanks again.  I must have been systemd-
happy when I built this router a few years back, ignored the hostapd
README, and crafted my own unit file.  Occasionally a radio crashes (in
hardware, nothing detected in kernel/userspace), and I have to do this
silly restart dance.  Having the event-based flow reduces some of that.

> The interface being UP the dhcp server is restarted so that it binds
> to the now available interface.  I am not sure that is needed these
> days, likely isn't, but at one time it was needed and not yet having
> had any reason to change the configuration I haven't tested not having
> it there.

I did some testing without hooking "up service isc-dhcp-server restart"
and the DHCP server seems to work fine as wlan interfaces are
ifdown/ifup'd, however the IPv6 side of things are very broken: radvd
segfaults (I should probably open a separate bug);  wide-dhcpv6-client
on eth3 exits without any messages (and systemd thinks it's LSB-based
unit is still running);  I've had these problems prior to the
jessie-backports ifupdown upgrade, and they're outside the scope of this
bug report, I'll deal with them separately.

  Jul 23 11:20:41 headboard radvd[5255]: attempting to reread config file
  Jul 23 11:20:41 headboard dhcpd[3635]: receive_packet failed on wlan1: 
Network is down
  Jul 23 11:20:41 headboard radvd[5255]: no auto-selected prefix on interface 
wlan1, disabling advertisements
  Jul 23 11:20:41 headboard radvd[5256]: Exiting, privsep_read_loop had readn 
return 0 bytes
  Jul 23 11:20:41 headboard kernel: radvd[5255]: segfault at 24 ip 
0000564a02c87e92 sp 00007fff04587420 error 6 in radvd[564a02c83000+13000]
  ...
  Jul 23 11:21:24 headboard dhcpd[3635]: DHCPREQUEST for 192.168.250.43 from 
fc:f8:ae:aa:bb:cc (p4xb3k) via wlan1

> You might consider something like this type of control flow.  Reading
> through your trials and tribulations of chasing through the systemd
> dependencies makes me happy that I did not pursue that path.

If systemd-networkd had an option to disable it's implicit DHCPv6
client, I'd probably still be hacking on getting networkd to work in
this complex arrangement, however I am now realizing ifupdown really is
the only solution, e.g. wide-dhcpv6-client already has the ifupdown
hooks in place to dynamically configure interfaces (just need to figure
out why the daemon exits inappropriately), and I can probably split
radvd.conf into per-interface daemons and have them managed by hooks to
work around it's segfault bug.

-- 
Gerald Turner <gtur...@unzane.com>        Encrypted mail preferred!
OpenPGP: 4096R / CA89 B27A 30FA 66C5 1B80  3858 EC94 2276 FDB8 716D

Attachment: signature.asc
Description: PGP signature

Reply via email to