Monday 13 February 2017

Re: netplan and post-up/pre-down scripts

Hi Seth,

Sorry for the delayed responses on this thread (this is a side project of mine).

On Thu, Jan 12, 2017 at 7:57 PM, Seth Arnold <seth.arnold@canonical.com> wrote:
Is this a manifestation of the bridge trying to do spanning tree protocol?
Most of the walkthroughs I've read lately about bridged networking include
commands to turn off STP before they start adding ports to the bridge.

My present workaround is a /etc/network/interfaces file whose bridge looks something like this:

iface wan0 inet manual
    metric 5000
    bridge_ports enp1s0
    bridge_stp off
    bridge_waitport 0
    bridge_fd 0
    post-up run-one /root/ifmonitor enp1s0 &
    pre-down kill $(cat /run/ifmonitor.enp1s0) 2> /dev/null || true

So no, this particular issue isn't related to the spanning-tree configuration. (That part was unchanged when I was seeing the 5-minute timeouts.)

The 5-minute timeout was an issue with the interface set to 'auto' and the DHCP configuration present in /e/n/i. I had to replace that with the post-up script which manually monitored the interface and launched (or killed) the DHCP client to get the behavior I wanted (no 5-minute timeout of the WAN interface was disconnected or didn't respond to DHCP).

Regards,
Mike