Not possible to render pre-up, pre-down, post-up, or post-down snippets
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Netplan |
Fix Committed
|
Wishlist
|
Unassigned | ||
systemd (Ubuntu) |
Won't Fix
|
High
|
Unassigned |
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-
description: | updated |
Changed in netplan: | |
importance: | Undecided → Wishlist |
I'm trying to understand the example you've given here. Are you saying that you want a post-up script on one interface that monitors *another* interface to watch for the link to be up? Or that you're wanting to use it to monitor the *present* interface for it to be up?
Both this and the custom routes case sound like workarounds for bugs/limitations in ifupdown. We should not design netplan for working around bugs in netplan/networkd when we are committed to supporting and bugfixing netplan/networkd.
I believe that neither of the examples given are needed in the netplan world.
Also, networkd as the underlying renderer has no support for script hooks per upstream design, so this isn't fixable in netplan.