pyroute2 netlink framework¶
The netlink protocol is probably the simplest way to pass messages from the Linux kernel to the user space and vice versa. This protocol is used in many subsystems such as RTNL (Linux IP settings and routing), WireGuard, ethtool, nftables, connection tracking, nl80211 (WiFi), iSCSI and so on.
The pyroute2 library consists of a common netlink messages coder / decoder and a number of protocol-specific modules. It may be used to work with existing protocols such as RTNL as well as to create your own netlink protocols.
The library has also some limited support of PF_ROUTE protocols on FreeBSD and OpenBSD operating systems.