Use ActivationPolicy to enable/disable network interfaces
The systemd.network "Unmanaged" control, used to cause a network
interface to prevent a NIC from being configured by systemd is too
aggressive. The goal is to control the IFF_UP/IFF_DOWN
state of the NIC.
The systemd-networkd developers, as part of discussions around
"Unmanaged", created an alternate control to perform the required
action. The control is called ActivationPolicy.
Switch from using Unmanaged to ActivationPolicy in order to manage
IFF_UP/IFF_DOWN conditions.
Tested:
The systemd-network.service initial state has no ActivationPolicy
entry. The default state is for ActivationPolicy to be enabled.
Issued a Redfish request:
PATCH :url/redfish/v1/Managers/bmc/EthernetInterfaces/eth1
{
"InterfaceEnabled": false
}
to assign "ActivationPolicy=down", and causing the link to stay down
until another request re-enables it. Confirmed the NIC is IFF_DOWN,
and the systemd.network configuration file contains
ActivationPolicy=down.
Sending another request to set InterfaceEanbled: "true" causes the
entry to be removed from the systemd.network file, and the NIC enters
the IFF_UP state.
Change-Id: I8b5bb4d30a1c7282494526169f65e0eda26e04cf
Signed-off-by: Johnathan Mantey <johnathanx.mantey@intel.com>
2 files changed