https://github.com/snooda/net-speeder
安装步骤:
1:下载源码并解压
wget https://github.com/snooda/net-speeder/archive/master.zip
unzip master.zip
2:准备编译环境
debian/ubuntu:
#安装libnet-dev:apt-get install libnet1-dev -y
#安装libpcap-dev:
apt-get install libpcap0.8-dev -y
centos:
#下载epel:https://fedoraproject.org/wiki/EPEL/zh-cn 例:CentOS6 64位:
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm#(如果是centos5,则在epel/5/下)
#安装epel:
rpm -ivh epel-release-6-8.noarch.rpm
#然后即可使用yum安装:
yum install libnet libpcap libnet-devel libpcap-devel -y
编译:
Linux Cooked interface使用编译(venetX,OpenVZ):
sh build.sh -DCOOKED
普通网卡使用编译(Xen,KVM,物理机):
sh build.sh
使用方法(需要root权限启动):
#参数:./net_speeder 网卡名 加速规则(bpf规则)
一般kvm eth0 openvz venet0
ifconfig 查看网卡
#ovz用法(加速所有ip协议数据):
./net_speeder venet0 "ip"
全局化
mv net_speeder /usr/local/bin/
手动启动
nohup net_speeder venet0 "ip" >/dev/null 2>&1 &
nohup net_speeder eth0 "ip" >/dev/null 2>&1 &
开机启动
echo 'nohup net_speeder venet0 "ip" >/dev/null 2>&1 &' >> /etc/rc.local echo 'nohup net_speeder eth0 "ip" >/dev/null 2>&1 &' >> /etc/rc.local