> The requirement here is, I need to know when ens1 goes up or down, so > that I can make changes to the bridge interface. The `ifmonitor` script > will monitor the link status of ens1, and then take appropriate actions, > such as restarting a DHCP client, adding or removing routes that have > been programmed via the lan0 bridge to egress on ens1, adding or > removing IP addresses from the configuration, etc.
Knowing the status of the physical link so that you can take appropriate action on the bridge/bond makes sense. But it seems to me that should be handled intrinsically by networkd, not something you could or should configure with scripts. Opening a task on systemd for us to verify the behavior here. When all the physical links in a bridge/bond drop, does networkd treat that as a down / subsequent up event? When you say "egress on ens1", what do you mean? Your network config doesn't show any such routes. Why would these routes be managed externally to networkd? > In the ifupdown world, the other horrible hack I've sometimes found > necessary (although the reason why is eluding me at the moment) is when > I want an interface to be 'manual', yet behave like a 'static' > definition, in that it should configure itself automatically when it > comes online. So I might have something like: In ifupdown, I would expect to handle this as a static network without 'auto'. For netplan / networkd, this looks like it needs some further work to support, already captured in bug #1664844. ** Also affects: systemd (Ubuntu) Importance: Undecided Status: New ** Changed in: systemd (Ubuntu) Importance: Undecided => High ** Changed in: systemd (Ubuntu) Status: New => Triaged ** Changed in: systemd (Ubuntu) Milestone: None => ubuntu-17.05 ** Changed in: systemd (Ubuntu) Assignee: (unassigned) => Mathieu Trudel-Lapierre (cyphermox) -- You received this bug notification because you are a member of Ubuntu Touch seeded packages, which is subscribed to systemd in Ubuntu. https://bugs.launchpad.net/bugs/1664818 Title: Not possible to render pre-up, pre-down, post-up, or post-down snippets Status in netplan: New Status in systemd package in Ubuntu: Triaged Bug description: Many configurations require scripts to run before or after an interface comes up or down. Example: I had a situation where I needed to render a post-up script to monitor an interface with ifupdown (and with the interface set to manual mode, because if the link was down I didn't want to require DHCP to run before the system continued booting). This is similar to what NetworkManager does in order to launch (or kill) a DHCP client. Other use cases involve setting up custom routes (such as when complex logic involving metrics or source routing is required) or anything else the designers of the netplan rendering engine didn't think of, such as invoking workarounds or special settings required for a particular NIC or environment, iptables rules that should be added or removed, etc. A follow-on issue is, it should be possible to ask that custom scripts run if the *link* is detected to come up or down. But I'll be happy if netplan first can simply replicate the custom-script-invoking behavior of ifupdown. To manage notifications about this bug go to: https://bugs.launchpad.net/netplan/+bug/1664818/+subscriptions -- Mailing list: https://launchpad.net/~touch-packages Post to : touch-packages@lists.launchpad.net Unsubscribe : https://launchpad.net/~touch-packages More help : https://help.launchpad.net/ListHelp