Linux netlink
A program asks the kernel about the network
Suppose a network tool needs to find out which addresses the computer has, or to ask Linux to change a route, the directions that tell network traffic where to go. The tool needs a local way to exchange structured requests and replies with the kernel, the core part of Linux that manages devices and enforces system rules. Netlink is that communication system. Its messages stay on the same machine; it is not a network protocol for contacting another computer.
Linux programs use sockets, communication endpoints, in the AF_NETLINK address family. Each Netlink family defines message types and the data those messages carry. NETLINK_ROUTE, often called rtnetlink, handles network links, addresses, routes, neighbors, and related settings. The ip utility uses it to inspect and change this information. Generic Netlink provides a framework for other kernel subsystems. Messages have headers and family-specific attributes, so they are structured data rather than text lines.
Watch network changes as they happen
Run ip monitor link address route in one terminal to listen for notifications about links, addresses, and routes:
ip monitor link address route
This command prints events it receives; it does not make changes. In another terminal, use ip link show, ip address show, and ip route show to take a snapshot of the current settings. Starting the monitor before reproducing a problem lets you compare later events with that snapshot. It cannot show a change that occurred before it started listening.
Ordinary accounts can often read network state. Changing protected settings commonly requires root or CAP_NET_ADMIN, though the needed authority depends on the family and operation. A permission error does not mean Netlink is unavailable; the request may need more privileges.
Resync if an event goes missing
Treat the event stream as a live view, not a permanent log. Netlink delivery is not reliable: if too many messages arrive and the receiving socket's buffer fills, the kernel can drop a message. The program may get ENOBUFS and should ask for current state again to resynchronize. A long-running ip monitor only reflects events delivered after it started, so take a fresh snapshot when the present configuration matters.
For routine inspection, use a tool that understands the relevant Netlink family. If debugging a program that constructs requests itself, consult the family documentation for message types, attributes, acknowledgements, and multicast groups. strace can show sendmsg and recvmsg calls; ip monitor displays common route events in readable form.




