在日常维护中, 网管人员最头痛的是内部网经常有人在大量传送文件而导致本来可怜的带宽变得更加狼狈.如果在网关上装上‘bandwidthd‘ ,就可以追踪的是各个的IP 的流量,而且可以用图象曲线显示各个ip的相应不同协议显示,还能分时段查看。
1.环境:
# lsb_release -a
LSB Version: :core-4.0-ia32:core-4.0-noarch:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-ia32:printing-4.0-noarch
Distributor ID: CentOS
Description: CentOS release 5.8 (Final)
Release: 5.8
Codename: Final
2.下载bandwidthd地址:
http://ncu.dl.sourceforge.net/project/bandwidthd/bandwidthd/bandwidthd%202.0.1/bandwidthd-2.0.1.tgz
3.安装bandwidthd
# tar xzvf bandwidthd-2.0.1.gz
# cd bandwidthd-2.0.1
# ./configure --prefix=/usr/local/bandwidthd
# make
# make install
4.配置bandwidthd
# cat /usr/local/bandwidthd/bandwidthd/etc/bandwidthd.conf | grep -v ‘^#‘
subnet 192.168.1.0/24
dev "eth0"
graph_cutoff 1024
output_cdf false
recover_cdf false
filter "ip"
graph true
5.安装部署WEB服务器(apache)
5.1 查看APACHE的目录
# cat /usr/local/apache2/conf/httpd.conf | grep "DocumentRoot"
DocumentRoot "/data/www"
5.2 配置bandwidthd软链接
ln -s /usr/local/bandwidthd/bandwidthd/htdocs /data/www/bandwidthd
6. 启动服务
service httpd start
/usr/local/bandwidthd/bandwidthd/bandwidthd
7.防火墙配置
iptables 开启 80 端口;
8.访问bandwidthd
打开浏览器:
http://192.168.1.1/bandwidthd/index.html
Linux 安装流量监控软件bandwidthd,布布扣,bubuko.com