Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

edit README #61

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 58 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,45 +17,76 @@ A program to speed up single thread download upon long delay and unstable networ
另外,内部dup包并非是偷懒未判断。。。是为了更快触发快速重传的。
注2:net-speeder不依赖ttl的大小,ttl的大小跟流量无比例关系。不存在windows的ttl大,发包就多的情况。

# 使用方法
注意:需要root权限启动

安装步骤:

1:下载源码并解压
#参数:./net_speeder 网卡名 加速规则(bpf规则)
#ovz用法(加速所有ip协议数据):
./net_speeder venet0 "ip"
#普通网卡用法
./net_speeder eth0 "ip"

wget https://github.com/snooda/net-speeder/archive/master.zip
unzip master.zip
# 安装步骤

2:准备编译环境
1:准备编译环境

debian/ubuntu:

#安装libnet-dev:
apt-get install libnet1-dev
#安装libpcap-dev:
apt-get install libpcap0.8-dev

sudo apt-get install libnet1-dev libpcap0.8-dev git gcc

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

编译:

# yum
sudo yum install libnet libpcap libnet-devel libpcap-devel git gcc
# dnf
sudo dnf install libnet libpcap libnet-devel libpcap-devel git gcc

2:克隆源码

# 定位至你的安装目录
cd ~
git clone https://github.com/snooda/net-speeder.git

3:编译

cd net-speeder

Linux Cooked interface使用编译(venetX,OpenVZ):

sh build.sh -DCOOKED

普通网卡使用编译(Xen,KVM,物理机):

sh build.sh

使用方法(需要root权限启动):

#参数:./net_speeder 网卡名 加速规则(bpf规则)
#ovz用法(加速所有ip协议数据):
./net_speeder venet0 "ip"

4:配置 systemd

键入 `vi /usr/lib/systemd/system/net-speeder.service` 指令进行编辑

[Unit]
Description=net-speeder
After=network.target
Wants=network.target

[Service]
Type=simple
PIDFile=/var/run/net_speeder.pid
# 有需要请编辑这里
ExecStart=/root/net-speeder/net_speeder venet0 "ip"

[Install]
WantedBy=multi-user.target

然后执行以下指令:

systemctl enable net-speeder
systemctl start net-speeder


# 更新步骤
可写入脚本并设定 crontab 以自动完成

cd ~/net-speeder
git pull
# 或 sh build.sh
sh build.sh -DCOOKED