The UK Home Automation Archive

Archive Home
Group Home
Search Archive


Advanced Search

The UKHA-ARCHIVE IS CEASING OPERATIONS 31 DEC 2024


[Message Prev][Message Next][Thread Prev][Thread Next][Message Index][Thread Index]

Re: Recording Internet traffic



I use iptables at home for exactly this purpose. Sharing my setup for the
benefit of the list.

If you're running a *nix box which you can route things through or have a
more advanced router that you can get a bash shell onto, just create
yourself an TRAFFIC_IN and TRAFFIC_OUT iptables chain and you can find out
how much traffic has gone through the gateway.

You get the benefit of all the fine grain controls of iptables if you want
to do something clever or exclude certain traffic or hosts on the network.
I've found that iptables is pretty quick too and doesn't really add to much
strain to my system.

This is how I have my really simple set up:

# Create the two chains
iptables -N TRAFFIC_IN
iptables -N TRAFFIC_OUT
# Add all FORWARD traffic through each chain for monitoring. Replace eth0
with the network interface used if different.
iptables -I FORWARD -i eth0 -j TRAFFIC_IN
iptables -I FORWARD -o eth0 -j TRAFFIC_OUT

# To read off the traffic use the following
iptables -L -v

# to zero counters use
iptables -z TRAFFIC_IN
iptables -z TRAFFIC_OUT


You can get more fancy if you want and script it to pull out counts using
awk or grep and email using crontab etc.

If you do use this don't forget to write your iptables rules to file
otherwise you'll lose them on reboot. This can either be done with
something like iptables-save and iptables-restore but depends on distro I
think....

Hope this helps,

Oli


On 31 Oct 2011, at 12:34, Phil Harris wrote:

> If you're on cable then put an old 10/100 *HUB* between your router
and your cablemodem then hook a PC up to it running wireshark to log all
your traffic between the router and 'Internet'?
>
> If you're on ADSL and have a combined router / modem then you need to
get a little more creative but it can still be done.
>
> Phil
>
> Sent from another bloody fruit-based portable device...
>
> On 19 Oct 2011, at 20:06, "darren_karp2001"
<darren.karp@xxxxxxx> wrote:
>
> > Hi all,
> >
> > Does anyone know if there is a way of recording everything that
is sent & received on our Internet at home?
> >
> > Thanks
> > D.
> >
> >
> >
> > ------------------------------------
> >
> >
> > Yahoo! Groups Links
> >
> >
> >
>



[Non-text portions of this message have been removed]



------------------------------------

<*> Join the Automated Home Forums
http://www.automatedhome.co.uk/vbulletin/


UKHA_D Main Index | UKHA_D Thread Index | UKHA_D Home | Archives Home

Comments to the Webmaster are always welcomed, please use this contact form . Note that as this site is a mailing list archive, the Webmaster has no control over the contents of the messages. Comments about message content should be directed to the relevant mailing list.