TrafficMon - Traffic Monitor for LAN
1. Instructions
This is a traffic monitor for LAN. Run it on the gateway PC and it
can monitor everyone's network traffic in the LAN.
Before running this, please configure "trafficmon.ini" first. The
file should be put at:
* /opt/trafficmon/ for Linux;
* The same directory as TrafficMon.exe for Windows;
There is an example "trafficmon.ini" file in the software folder.
Usage:
trafficmon [-i]
-i list all network adapters
The meanings of the keys in the "trafficmon.ini" file are as follows:
[User]
MAC address=user name
MAC address is in format of XX:XX:XX:XX:XX:XX or
XX-XX-XX-XX-XX-XX, case insensitive;
[Main]
adapter:
Adapter name such as "eth0" in Linux and "\Device\NPF_{...}"
in Windows. Using "-i" switch to view complete adapter list;
dns_is_free:
Whether DNS query traffic is free or not. Set this to 0 will
count DNS traffic and 1 will not;
log_and_reset_on_new_month:
When new month comes, log current traffic record and return it
to zero (useful for monthly payment service);
web_ui_port:
You can visit http://your_gateway_ip:web_ui_port/ to view the
web page of traffic usage (total and per user).
charset:
Character set of this ini file. On Linux it should always be
"utf-8";
[TrafficLimit]
traffic_limit_per_user_in_bytes:
Traffic limit per user (in bytes);
ban_anonymous_user:
Ban anonymous user (user who uses a MAC address not appeared on
[User] section) or not (1/0);
[Message]
message:
Message to be show in the traffic usage page.
[WhiteList]
IP address=subnet mask
Put traffic-free IP addresses and corresponding subnet masks here.
2. System Requirements
Linux:
* You need libpcap (http://www.tcpdump.org/) installed.
Windows:
* You need WinPcap (http://www.winpcap.org/) installed;
* If you haven't installed Microsoft Visual C++ 2008 Redistributable
Package (x86), please use "Release\TrafficMon.exe". Otherwise, use
"Release_DLL\TrafficMon.exe" as it is smaller.
3. Functions
* Monitor everyone's network traffic in LAN;
* Web UI of network traffic usage (total and per user);
* Ban users who exceeded traffic limit;
* Support IP whitelist (traffics to/from these IPs won't be count);
* Option of ban users with unregistered MAC address;
* Option of automatically log and reset traffic record on new month.
4. Web UI
http://your_gateway_ip:web_ui_port/PAGE
If PAGE is:
(empty) :
display the page of traffic usage;
reload :
reload [User], [TrafficLimit] and [Message] sections in
"trafficmon.ini";
flush :
save current traffic record. Generally, you don't need to visit
this page for traffic record will be automatically saved;
clear-time-error :
clear date/time error state. If system date/time went wrong, there
will be a warning in the traffic usage page and the "auto log and
reset traffic record on new month" function will be suspended.
After corrected system date/time, visit this page to clear the
error state and the "auto log and reset" function will be resumed;
5. License (GPL License)
Copyright (C) 2011-2012 CTQY <qiyi.caitian@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.