Introduction
Nmpolicy is an expressions driven declarative API for dynamic network configuration.
Nmpolicy contains two sections:
capture: Rule to filter desire statedesiredordesiredState: Use capture data to generate new state.
Using nmpolicy allows user to generate desired state base on current network state.
Example YAML for changing gateway interface MTU to 1280.
capture:
gw: routes.running.destination=="0.0.0.0/0"
gw-iface: interfaces.name==capture.gw.routes.running.0.next-hop-interface
desired:
interfaces:
- name: ""
type: ethernet
state: up
mtu: 1280
You may applying this YAML directly through nmstatectl apply or
use nmstatectl policy to generate desired state without apply.
Documentation
- Syntax
- Example: Linux bridge on top of default gw NIC with DHCP
- Example: Linux bridge on top of default gw NIC without DHCP
- Example: OVS SLB bond between primary and secondary nics
- Example: Set all linux bridges down
- Example: Convert DHCP aware interface to static addressing
- Example: Enable LLDP on all active interfaces
- Example: Linux Bridge using ports referred by description