Reference¶
YAML configuration¶
Netplan configuration files use the
YAML (v1.1) format. All files in
/{lib,etc,run}/netplan/*.yaml are considered and are supposed to use
restrictive file permissions (600/rw-------), i.e. owner (root) read-write
only.
The top-level node in a Netplan configuration file is a network: mapping
that contains version: 2 (the YAML currently being used by curtin, MAAS,
etc. is version 1), and then device definitions grouped by their type, such as
ethernets:, modems:, wifis:, or bridges:. These are the types
that our renderer can understand and are supported by our back ends.
libnetplan API¶
libnetplan is a component of the Netplan project that contains the logic for
data parsing, validation and generation. It is build as a dynamic .so library
that can be used from different binaries (like Netplan generate,
netplan-dbus, the netplan apply/try/get/set/... CLI or using the corresponding
Python bindings or external applications like the NetworkManager, using the
Netplan back end).
- libnetplan API
- Public headers
- parse.h
netplan_parser_new()netplan_parser_reset()netplan_parser_clear()netplan_parser_set_flags()netplan_parser_get_flags()netplan_parser_get_error_count()netplan_parser_load_yaml()netplan_parser_load_yaml_from_fd()netplan_parser_load_yaml_hierarchy()netplan_parser_load_nullable_fields()netplan_parser_load_nullable_overrides()
- parse-nm.h
- state.h
netplan_state_new()netplan_state_reset()netplan_state_clear()netplan_state_import_parser_results()netplan_state_get_netdefs_size()netplan_state_get_netdef()netplan_state_get_backend()netplan_state_write_yaml_file()netplan_state_update_yaml_hierarchy()netplan_state_dump_yaml()netplan_netdef_write_yaml()netplan_state_iterator_init()netplan_state_iterator_next()netplan_state_iterator_has_next()netplan_state_finish_nm_write()netplan_state_finish_ovs_write()netplan_state_finish_sriov_write()
- netdef.h
netplan_netdef_get_output_filename()netplan_netdef_get_filepath()netplan_netdef_get_backend()netplan_netdef_get_type()netplan_netdef_get_id()netplan_netdef_get_bridge_link()netplan_netdef_get_bond_link()netplan_netdef_get_peer_link()netplan_netdef_get_vlan_link()netplan_netdef_get_sriov_link()netplan_netdef_get_vrf_link()netplan_netdef_get_set_name()netplan_netdef_has_match()netplan_netdef_match_interface()netplan_netdef_get_dhcp4()netplan_netdef_get_dhcp6()netplan_netdef_get_link_local_ipv4()netplan_netdef_get_link_local_ipv6()netplan_netdef_get_accept_ra()netplan_netdef_get_macaddress()
- util.h
- types.h
NETPLAN_PUBLICNETPLAN_INTERNALNETPLAN_DEPRECATEDNETPLAN_BUFFER_TOO_SMALLNetplanParserNetplanStateNetplanNetDefinitionNetplanErrorNetplanStateIteratorNetplanDefTypeNETPLAN_DEF_TYPE_NONENETPLAN_DEF_TYPE_ETHERNETNETPLAN_DEF_TYPE_WIFINETPLAN_DEF_TYPE_MODEMNETPLAN_DEF_TYPE_VIRTUALNETPLAN_DEF_TYPE_BRIDGENETPLAN_DEF_TYPE_BONDNETPLAN_DEF_TYPE_VLANNETPLAN_DEF_TYPE_TUNNELNETPLAN_DEF_TYPE_PORTNETPLAN_DEF_TYPE_VRFNETPLAN_DEF_TYPE_NMNETPLAN_DEF_TYPE_DUMMYNETPLAN_DEF_TYPE_VETHNETPLAN_DEF_TYPE_NM_PLACEHOLDER_NETPLAN_DEF_TYPE_MAX_
NetplanBackendNETPLAN_ERROR_DOMAINSNETPLAN_PARSER_ERRORSNETPLAN_VALIDATION_ERRORSNETPLAN_BACKEND_ERRORSNETPLAN_EMITTER_ERRORSNETPLAN_FORMAT_ERRORSNETPLAN_PARSER_FLAGS_NetplanStateIterator
- parse.h
- Public headers
Netplan CLI¶
Netplan manual pages describe the usage of the different command line interface
tools available. Those are also installed on a system running Netplan and can be
accessed, using the man utility.
Netplan D-Bus¶
Netplan provides a daemon that can be run to provide the io.netplan.Netplan
D-Bus API, to control certain aspects of a system’s Netplan configuration
programmatically. See also: D-Bus configuration API.