Many interfaces are available related to networking. Most snaps need only specify network
to connect to the network and network-bind
to allow running a network service (eg, web server).
In addition to network
and network-bind
, there are a number of other interfaces related to network management, status and connectivity:
network-control
This interface allows use of low-level networking tools (eg, ip
, route
, β¦), configuration files (eg, /etc/iproute2/*
, /etc/resolvconf/*
, β¦), kernel tunables related to networking (eg, /proc/sys/net/...
), network devices (eg, /dev/tun*
, β¦) and management of network namespaces via ip netns.
network-manager
For consumer snaps (plugs), this interface allows access to the NetworkManager DBus API which can be used to query network status or configure networking on the system.
The interface also allows a slot implementation to provide the NetworkManager DBus APIs and have consumer snaps connect to it.
network-observe
This interface provides read-only access for low-level configuration, kernel tunables and statistics.
network-setup-control
This interface provides read/write access to netplan and ifupdown configuration. netplan and/or ifupdown is used to configure various aspects of networking for the system during boot and network restart.
network-setup-observe
This interface provides read access to netplan and ifupdown configuration.
network-status
This interface provides access to the connectivity
DBus service which can be used to query the global network status (βis the system on the network at all?β) or if the system is on a metered connection.
References
- https://github.com/snapcore/snapd/wiki/Interfaces
- https://github.com/snapcore/snapd/blob/master/interfaces/builtin/network_control.go
- https://github.com/snapcore/snapd/blob/master/interfaces/builtin/network_manager.go
- https://github.com/snapcore/snapd/blob/master/interfaces/builtin/network_observe.go
- https://github.com/snapcore/snapd/blob/master/interfaces/builtin/network_setup_control.go
- https://github.com/snapcore/snapd/blob/master/interfaces/builtin/network_setup_observe.go
- https://github.com/snapcore/snapd/blob/master/interfaces/builtin/network_status.go