0%

1
2
3
4
mkdir wgcf
cd wgcf
wget -O wgcf https://github.com/ViRb3/wgcf/releases/download/v2.2.2/wgcf_2.2.2_linux_amd64
chmod +x wgcf

注册用户并生成配置文件:

1
2
./wgcf register
./wgcf generate

安装wireguard客户端。

centos7可以使用以下命令安装:

1
2
3
sudo yum install epel-release elrepo-release
sudo yum install yum-plugin-elrepo
sudo yum install kmod-wireguard wireguard-tools

将配置文件中的 engage.cloudflareclient.com 替换为 162.159.192.1,并删除 AllowedIPs = 0.0.0.0/0

1
sudo cp wgcf-profile.conf /etc/wireguard/wgcf.conf
1
2
3
4
5
6
7
#开启隧道
sudo wg-quick up wgcf
#关闭隧道
sudo wg-quick down wgcf
# 开机自启
systemctl enable wg-quick@wgcf
systemctl start wg-quick@wgcf

修改xray的ipv6优先
编辑config.json
替换整个 “outbounds”命令

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
 "outbounds": [
{
"tag":"IP4_out",
"protocol": "freedom",
"settings": {}
},
{
"tag":"IP6_out",
"protocol": "freedom",
"settings": {
"domainStrategy": "UseIPv6" // 指定使用 IPv6
}
}
],
"routing": {
"rules": [
{
"type": "field",
"outboundTag": "IP6_out",
"domain": ["geosite:netflix"] // netflix 走 IPv6
},
{
"type": "field",
"outboundTag": "IP4_out",
"network": "udp,tcp"// 其余走 IPv4
}
]
}
}

justtest

1
2
3
4
5
6
7
8
9
10
apt-get update
apt-get upgrade
cp -r /etc/apt/sources.list /etc/apt/sources.list.old
sed -i 's/stretch/buster/g' /etc/apt/sources.list
apt-get update
apt-get upgrade
apt-get dist-upgrade
apt autoremove
apt clean
reboot

1
2
3
4
5
6
7
8
9
10
apt-get update
apt-get upgrade
cp -r /etc/apt/sources.list /etc/apt/sources.list.old
sed -i 's/jessie/stretch/g' /etc/apt/sources.list
apt-get update
apt-get upgrade
apt-get dist-upgrade
apt autoremove
apt clean
reboot

1.1安装nginx Debian 8 Jessie如何安装Nginx1.9.5

1
apt install nginx

1.2配置

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
cat > /etc/nginx/nginx.conf <<-EOF
user root;
worker_processes 1;
#error_log /etc/nginx/error.log warn;
#pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '\$remote_addr - \$remote_user [\$time_local] "\$request" '
'\$status \$body_bytes_sent "\$http_referer" '
'"\$http_user_agent" "\$http_x_forwarded_for"';
#access_log /etc/nginx/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 120;
client_max_body_size 20m;
#gzip on;
include /etc/nginx/conf.d/*.conf;
}
EOF

$your_domain (域名)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
cat > /etc/nginx/conf.d/default.conf<<-EOF
server {
listen 127.0.0.1:37212;
server_name $your_domain;
root /usr/share/nginx/html;
index index.php index.html index.htm;
}
server {
listen 127.0.0.1:37213 http2;
server_name $your_domain;
root /usr/share/nginx/html;
index index.php index.html index.htm;
}

server {
listen 0.0.0.0:80;
server_name $your_domain;
root /usr/share/nginx/html/;
index index.php index.html;
#rewrite ^(.*)$ https://\$host\$1 permanent;
}
EOF

1.3启动

1
2
systemctl enable nginx.service
systemctl restart nginx.service

为域名申请证书,$your_domain(域名)

1
2
curl https://get.acme.sh | sh
~/.acme.sh/acme.sh --issue -d $your_domain --webroot /usr/share/nginx/html/

安装官方Xray服务
以下一键安装程序来源于官方

1
2
mkdir /usr/local/etc/xray/
mkdir /usr/local/etc/xray/cert
1
bash -c "$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)" @ install -u root

UUID 随机生成代码

1
cat /proc/sys/kernel/random/uuid 

xray配置文件, $uuid(随机UUID),$your_domain(域名)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
cat > /usr/local/etc/xray/config.json<<-EOF
{
"log": {
"loglevel": "warning"
},
"inbounds": [
{
"listen": "0.0.0.0",
"port": 443,
"protocol": "vless",
"settings": {
"clients": [
{
"id": "$uuid",
"level": 0,
"email": "a@b.com",
"flow":"xtls-rprx-direct"
}
],
"decryption": "none",
"fallbacks": [
{
"dest": 37212
},
{
"alpn": "h2",
"dest": 37213
}
]
},
"streamSettings": {
"network": "tcp",
"security": "xtls",
"xtlsSettings": {
"serverName": "$your_domain",
"alpn": [
"h2",
"http/1.1"
],
"certificates": [
{
"certificateFile": "/usr/local/etc/xray/cert/fullchain.cer",
"keyFile": "/usr/local/etc/xray/cert/private.key"
}
]
}
}
}
],
"outbounds": [
{
"protocol": "freedom",
"settings": { }
}
]
}
EOF

伪装站点

1
2
3
cd /usr/share/nginx/html/ && rm -f ./*
wget https://github.com/atrandys/trojan/raw/master/fakesite.zip
unzip -o fakesite.zip

xray 自启

1
systemctl enable xray.service

$your_domain(域名)

1
2
3
4
~/.acme.sh/acme.sh  --installcert  -d  $your_domain   \
--key-file /usr/local/etc/xray/cert/private.key \
--fullchain-file /usr/local/etc/xray/cert/fullchain.cer \
--reloadcmd "chmod -R 777 /usr/local/etc/xray/cert && systemctl restart xray.service"

100MB

1
dd if=/dev/zero of=100mb.bin bs=100M count=1

1000MB

1
dd if=/dev/zero of=1000mb.bin bs=100M count=10

安装elrepo,升级内核

1
2
yum install https://www.elrepo.org/elrepo-release-7.el7.elrepo.noarch.rpm
yum --enablerepo=elrepo-kernel install kernel-ml -y

查看启动顺序

1
egrep ^menuentry /etc/grub2.cfg | cut -f 2 -d \'

设置启动顺序并重启

1
2
grub2-set-default 0
reboot

使用

1
2
3
4
git clone https://github.com/xiya233/bbr2.git  
cd bbr2
chmod +x bbr2.sh
./bbr2.sh

echo 1 > /sys/module/tcp_bbr2/parameters/ecn_enable

1
wget --no-check-certificate -qO 'BBR.sh' 'https://raw.githubusercontent.com/fyfh/BBR_POWERED/master/BBR.sh' && chmod a+x BBR.sh && bash BBR.sh -f
1
wget --no-check-certificate -qO 'BBR_POWERED.sh' 'https://raw.githubusercontent.com/fyfh/BBR_POWERED/master/BBR_POWERED.sh' && chmod a+x BBR_POWERED.sh && bash BBR_POWERED.sh -f