[clug] Obsessing over IPv6 - watching home usage

Paul Wayper paulway at mabula.net
Sun May 8 01:04:49 MDT 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 05/08/2011 11:28 AM, Craig Small wrote:
> On Sun, May 08, 2011 at 10:07:37AM +1000, Paul Wayper wrote:
>> I'm using the Internode tunnel terminated on my home server, so the tunnel
>> endpoint is a Linux machine that I can use netflow or similar on.  I don't
>> really need to know exactly what the traffic is, I'm just curious to see the
>> percentage of traffic - packets and bytes - that's IPv6 versus IPv4.  Do any
>> of the networking experts on the list know of an easy way to do this?
> It depends on how you have setup the network and IPv6.  Internode lets
> you use IPv6 either directly through the PPP connection or to their
> tunnel broker. For me, I have to use the tunnel broker so I have the
> client on one device and the PPPoE/A termination on another.

The same.

> If the Linux computer is the termination point for PPPoE/A then it gets
> tricky, because the interface stats show all packets. Packet/Datagram
> count is pretty simple but byte count is harder.

Actually, the tricky thing is that my main server is not the router for all
the IPv4 traffic, so I wouldn't be able to get a comparison.  I'll have to
settle just for knowing how many packets and bytes are going in and out by IPv6.

Still, people reminded me about the tunnel device on the server, so after a
brief bout of forehead-smacking:

> Actually, probably the quickest and nastiest way would be two lines in
> iptables and ip6tables that count the bytes going into and out of the
> PPPoE/A tunnel.

Or just:

ifconfig tun | perl -ne 'while (m{([RT]X (packets|bytes)):(\d+)}g) { $a{$1} =
$3; } END { foreach my $k (sort keys %a) { print "$k => $a{$k}\n"; } }'

Perl is a bit heavyweight here, but what the hell it was close to hand :-)

Have fun,

Paul
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAk3GQJAACgkQu7W0U8VsXYJEUwCfV61cPbG6nRb+v9u/d17h+p02
5fgAoLwxwv2cElzDtSj7I16JSTVUNgUp
=VT4B
-----END PGP SIGNATURE-----


More information about the linux mailing list