Grant Taylor <gtaylor@xxxxxxxxxxxxxxxxxx> wrote: >On 2/10/21 9:46 AM, Grant Taylor wrote: >> Now I just need to put together a simple script to parse >> /proc/net/fib_triestat. I suspect awk, or maybe even sed, will do quite >> nicely. > >sed -n '/Id 13:/,/^$/p' /proc/net/fib_triestat | sed -n '/Prefixes:/p' | >sed 's/ Prefixes //' > >That's a tab before Prefixes and seven (7) spaces afterwards. > >I'd like to have something more graceful. But it's a start. The other tricky bit is that by default the IPv4 main and local routing tables are merged, so the prefix, et al, counts in fib_triestate for main and local will each include all of main plus local. The main and local tables are unmerged when an "ip rule" is added or removed. You can watch this happen by comparing /prob/net/fib_trie before and after adding an ip rule. Once split, the tables are never merged back togther, even if the original rule set is restored. This also covers only IPv4 routes; IPv6 has no equivalent to fib_trie and fib_triestats. -J --- -Jay Vosburgh, jay.vosburgh@xxxxxxxxxxxxx