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_PUBLIC
NETPLAN_INTERNAL
NETPLAN_DEPRECATED
NETPLAN_BUFFER_TOO_SMALL
NetplanParser
NetplanState
NetplanNetDefinition
NetplanError
NetplanStateIterator
NetplanDefType
NETPLAN_DEF_TYPE_NONE
NETPLAN_DEF_TYPE_ETHERNET
NETPLAN_DEF_TYPE_WIFI
NETPLAN_DEF_TYPE_MODEM
NETPLAN_DEF_TYPE_VIRTUAL
NETPLAN_DEF_TYPE_BRIDGE
NETPLAN_DEF_TYPE_BOND
NETPLAN_DEF_TYPE_VLAN
NETPLAN_DEF_TYPE_TUNNEL
NETPLAN_DEF_TYPE_PORT
NETPLAN_DEF_TYPE_VRF
NETPLAN_DEF_TYPE_NM
NETPLAN_DEF_TYPE_DUMMY
NETPLAN_DEF_TYPE_VETH
NETPLAN_DEF_TYPE_NM_PLACEHOLDER_
NETPLAN_DEF_TYPE_MAX_
NetplanBackend
NETPLAN_ERROR_DOMAINS
NETPLAN_PARSER_ERRORS
NETPLAN_VALIDATION_ERRORS
NETPLAN_BACKEND_ERRORS
NETPLAN_EMITTER_ERRORS
NETPLAN_FORMAT_ERRORS
NETPLAN_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.