IP-MONITOR(8)

๐Ÿ“ฆ
version 7.3.0 ยท 3 versions
, in alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, centos-stream 10, centos-stream 9, debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, ubuntu questing, ubuntu resolute, ubuntu stonking

โœจ IP-MONITOR(8) โœจ ๐Ÿ’– NAME

okay so the manual name here is ip-monitor, also known as rtmon, and it's all about ๐Ÿฆ‹ state monitoring ๐Ÿฆ‹. bestie, this is the tool that watches devices, addresses and routes changing in real time ๐Ÿ‘€


๐Ÿ’… SYNOPSIS ๐Ÿ’…

ip monitor [ all | OBJECT-LIST ] [ file FILENAME ] [ label ] [ all-nsid
        ] [ dev DEVICE ]

๐ŸŽ€ OPTIONS ๐ŸŽ€

  • -t, -timestamp โ€” okay this one is giving timestamps ๐Ÿ•ฐ๏ธ It prints a timestamp before the event message, on its own separate line, in this format:
Timestamp: <Day> <Month> <DD> <hh:mm:ss> <YYYY> <usecs> usec
<EVENT>
  • -ts, -tshort โ€” the short-and-sweet version โœจ This prints a short timestamp on the same line as the event message, like this:
[<YYYY>-<MM>-<DD>T<hh:mm:ss>.<ms>] <EVENT>

๐ŸŒธ DESCRIPTION ๐ŸŒธ

okay so the ip utility can monitor the state of devices, addresses and routes continuously ๐Ÿซถ this option is lowkey a different vibe from the rest of the commands. the monitor command has to come first on the command line, and then the object list follows:

ip monitor [ all | OBJECT-LIST ] [ file FILENAME ] [ label ] [ all-nsid
] [ dev DEVICE ]

OBJECT-LIST is the list of object types you want to keep an eye on ๐Ÿ‘€ it can contain link, address, route, mroute, maddress, acaddress, prefix, neigh, netconf, rule, stats, nsid and nexthop. if you don't give a file argument, ip opens RTNETLINK, listens to it, and dumps state changes in the format we talked about earlier ๐Ÿ’œ

if the label option is set, a prefix shows up before each message to tell you the family of the message ๐Ÿท๏ธ for example:

  [NEIGH]10.16.0.112 dev eth0 lladdr 00:04:23:df:2f:d0 REACHABLE
  [LINK]3: eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state
  DOWN group default
      link/ether 52:54:00:12:34:57 brd ff:ff:ff:ff:ff:ff

if the all-nsid option is set, the program listens to every network namespace that has an nsid assigned into the network namespace where the program is running ๐ŸŒˆ a prefix shows which network namespace the message came from. example:

  [nsid 0]10.16.0.112 dev eth0 lladdr 00:04:23:df:2f:d0 REACHABLE

if the file option is given, the program does not listen on RTNETLINK ๐Ÿ™…โ€โ™€๏ธ instead it opens the given file and dumps its contents. the file should contain RTNETLINK messages saved in binary format ๐Ÿงš you can make one with the rtmon utility, which has a command line syntax similar to ip monitor. ideally, rtmon should be started before the first network configuration command is issued. f.e. if you insert:

        rtmon file /var/log/rtmon.log

in a startup script, you'll be able to view the full history later ๐Ÿ“œ

that said, it's totally possible to start rtmon at any time ๐Ÿ™Œ it prepends the history with the state snapshot dumped at the moment it starts.

if the dev option is given, the program only prints events related to that device ๐ŸŽฏ


๐Ÿฆ‹ SEE ALSO ๐Ÿฆ‹

ip(8)


๐Ÿ‘‘ AUTHOR ๐Ÿ‘‘

Original Manpage by Michail Litvak <mci@owl.openwall.com> Manpage revised by Nicolas Dichtel <nicolas.dichtel@6wind.com>


bestie that's the whole tea โ˜•๐Ÿ’– iproute2, last updated 13 Dec 2012, IP-MONITOR(8) forever and ever ๐Ÿ’…โœจ