From: Jay Vosburgh <jay.vosburgh@canonical.com>
To: lartc@vger.kernel.org
Subject: Re: Route count
Date: Wed, 10 Feb 2021 19:11:58 +0000 [thread overview]
Message-ID: <22518.1612984318@famine> (raw)
In-Reply-To: <99dad522-5d1b-0d22-e215-9ee25e079ba3@spamtrap.tnetconsulting.net>
Grant Taylor <gtaylor@tnetconsulting.net> 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@canonical.com
prev parent reply other threads:[~2021-02-10 19:11 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-08 17:10 Route count Grant Taylor
2021-02-10 8:11 ` Anton Danilov
2021-02-10 16:46 ` Grant Taylor
2021-02-10 16:53 ` Grant Taylor
2021-02-10 19:11 ` Jay Vosburgh [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=22518.1612984318@famine \
--to=jay.vosburgh@canonical.com \
--cc=lartc@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox