2023-09-04 15:59:58 +08:00
|
|
|
|
# **说明**
|
2023-09-04 16:17:28 +08:00
|
|
|
|
- **脚本支持IPV6单栈机。**
|
|
|
|
|
- **脚本支持 CentOS 8+、Debian 10+、Ubuntu 20+ 操作系统。**
|
|
|
|
|
- **脚本支持 warp 解锁 ChatGPT、Netflix、Disney+。**
|
|
|
|
|
- **脚本支持多协议共存。**
|
2023-07-29 17:19:25 +08:00
|
|
|
|
|
2023-09-04 15:59:58 +08:00
|
|
|
|
# **安装**
|
|
|
|
|
- **Debian&&Ubuntu使用以下命令安装依赖**
|
2023-07-29 17:19:25 +08:00
|
|
|
|
```
|
2023-08-29 08:47:02 +08:00
|
|
|
|
apt update && apt -y install curl wget tar socat jq git openssl uuid-runtime build-essential zlib1g-dev libssl-dev libevent-dev dnsutils
|
2023-07-29 17:19:25 +08:00
|
|
|
|
```
|
2023-09-04 15:59:58 +08:00
|
|
|
|
- **CentOS使用以下命令安装依赖**
|
2023-07-29 17:19:25 +08:00
|
|
|
|
```
|
2023-08-29 08:47:02 +08:00
|
|
|
|
yum update && yum -y install curl wget tar socat jq git openssl util-linux gcc-c++ zlib-devel openssl-devel libevent-devel bind-utils
|
2023-07-29 17:19:25 +08:00
|
|
|
|
```
|
2023-09-04 15:59:58 +08:00
|
|
|
|
- **使用以下命令运行脚本**
|
2023-07-29 17:19:25 +08:00
|
|
|
|
```
|
2023-07-29 17:33:30 +08:00
|
|
|
|
bash <(curl -L https://raw.githubusercontent.com/TinrLin/script_installation/main/Install.sh)
|
2023-07-29 17:19:25 +08:00
|
|
|
|
```
|
2023-09-04 15:59:58 +08:00
|
|
|
|
# **Hysteria端口跳跃**
|
|
|
|
|
```
|
|
|
|
|
# Debian&&Ubuntu
|
2023-09-04 16:08:48 +08:00
|
|
|
|
|
|
|
|
|
## 安装iptables-persistent
|
2023-09-04 15:59:58 +08:00
|
|
|
|
apt install iptables-persistent
|
2023-09-04 16:08:48 +08:00
|
|
|
|
|
2023-09-04 16:29:11 +08:00
|
|
|
|
## 启用iptables服务
|
|
|
|
|
systemctl enable iptables
|
2023-09-04 16:08:48 +08:00
|
|
|
|
|
2023-09-04 16:29:11 +08:00
|
|
|
|
## 启动iptables服务
|
|
|
|
|
systemctl start iptables
|
|
|
|
|
|
|
|
|
|
## 清空默认规则
|
2023-09-04 15:59:58 +08:00
|
|
|
|
iptables -F
|
2023-09-04 16:08:48 +08:00
|
|
|
|
|
2023-09-04 16:29:11 +08:00
|
|
|
|
## 清空自定义规则
|
2023-09-04 15:59:58 +08:00
|
|
|
|
iptables -X
|
2023-09-04 16:08:48 +08:00
|
|
|
|
|
|
|
|
|
## 允许本地访问
|
2023-09-04 15:59:58 +08:00
|
|
|
|
iptables -A INPUT -i lo -j ACCEPT
|
2023-09-04 16:08:48 +08:00
|
|
|
|
|
2023-09-04 16:29:11 +08:00
|
|
|
|
## 开放SSH端口(假设SSH端口为22)
|
2023-09-04 15:59:58 +08:00
|
|
|
|
iptables -A INPUT -p tcp --dport 22 -j ACCEPT
|
2023-09-04 16:08:48 +08:00
|
|
|
|
|
2023-09-04 16:29:11 +08:00
|
|
|
|
## 开放HTTP端口
|
2023-09-04 15:59:58 +08:00
|
|
|
|
iptables -A INPUT -p tcp --dport 80 -j ACCEPT
|
2023-09-04 16:08:48 +08:00
|
|
|
|
|
2023-09-04 16:29:11 +08:00
|
|
|
|
## 开放UDP端口(10010替换为节点的监听端口)
|
2023-09-04 15:59:58 +08:00
|
|
|
|
iptables -A INPUT -p udp --dport 10010 -j ACCEPT
|
2023-09-04 16:08:48 +08:00
|
|
|
|
|
2023-09-04 16:29:11 +08:00
|
|
|
|
## 开放UDP端口范围(假设UDP端口范围为20000-40000)
|
2023-09-04 15:59:58 +08:00
|
|
|
|
iptables -A INPUT -p udp --dport 20000:40000 -j ACCEPT
|
2023-09-04 16:08:48 +08:00
|
|
|
|
|
|
|
|
|
## 允许接受本机请求之后的返回数据
|
2023-09-04 15:59:58 +08:00
|
|
|
|
iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
|
2023-09-04 16:08:48 +08:00
|
|
|
|
|
|
|
|
|
## 其他入站一律禁止
|
2023-09-04 15:59:58 +08:00
|
|
|
|
iptables -P INPUT DROP
|
2023-09-04 16:08:48 +08:00
|
|
|
|
|
|
|
|
|
## 允许所有出站
|
2023-09-04 15:59:58 +08:00
|
|
|
|
iptables -P OUTPUT ACCEPT
|
2023-09-04 16:08:48 +08:00
|
|
|
|
|
|
|
|
|
## 查看开放的端口
|
2023-09-04 15:59:58 +08:00
|
|
|
|
iptables -L
|
2023-09-04 16:08:48 +08:00
|
|
|
|
|
|
|
|
|
## 添加NAT规则,20000:40000替换为你设置端口跳跃的范围,10010替换为你节点的监听端口
|
2023-09-04 15:59:58 +08:00
|
|
|
|
iptables -t nat -A PREROUTING -p udp --dport 20000:40000 -j DNAT --to-destination :10010
|
2023-09-04 16:08:48 +08:00
|
|
|
|
|
|
|
|
|
## 查看NAT规则
|
2023-09-04 15:59:58 +08:00
|
|
|
|
iptables -t nat -nL --line
|
2023-09-04 16:08:48 +08:00
|
|
|
|
|
|
|
|
|
## 保存iptables规则
|
2023-09-04 15:59:58 +08:00
|
|
|
|
netfilter-persistent save
|
|
|
|
|
```
|
2023-09-04 16:29:11 +08:00
|
|
|
|
```
|
|
|
|
|
# CentOS
|
|
|
|
|
## 安装iptables-service
|
|
|
|
|
yum install iptables-services
|
|
|
|
|
|
|
|
|
|
## 启用iptables服务
|
|
|
|
|
systemctl enable iptables
|
|
|
|
|
|
|
|
|
|
## 启动iptables服务
|
|
|
|
|
systemctl start iptables
|
|
|
|
|
|
|
|
|
|
## 清空默认规则
|
|
|
|
|
iptables -F
|
|
|
|
|
|
|
|
|
|
## 清空自定义规则
|
|
|
|
|
iptables -X
|
|
|
|
|
|
|
|
|
|
## 允许本地访问
|
|
|
|
|
iptables -A INPUT -i lo -j ACCEPT
|
|
|
|
|
|
|
|
|
|
## 开放SSH端口(假设SSH端口为22)
|
|
|
|
|
iptables -A INPUT -p tcp --dport 22 -j ACCEPT
|
|
|
|
|
|
|
|
|
|
## 开放HTTP端口
|
|
|
|
|
iptables -A INPUT -p tcp --dport 80 -j ACCEPT
|
|
|
|
|
|
|
|
|
|
## 开放UDP端口(10010替换为节点的监听端口)
|
|
|
|
|
iptables -A INPUT -p udp --dport 10010 -j ACCEPT
|
|
|
|
|
|
|
|
|
|
## 开放UDP端口范围(假设UDP端口范围为20000-40000)
|
|
|
|
|
iptables -A INPUT -p udp --dport 20000:40000 -j ACCEPT
|
|
|
|
|
|
|
|
|
|
## 允许接受本机请求之后的返回数据
|
|
|
|
|
iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
|
|
|
|
|
|
|
|
|
|
## 其他入站一律禁止
|
|
|
|
|
iptables -P INPUT DROP
|
|
|
|
|
|
|
|
|
|
## 允许所有出站
|
|
|
|
|
iptables -P OUTPUT ACCEPT
|
|
|
|
|
|
|
|
|
|
## 查看开放的端口
|
|
|
|
|
iptables -L
|
|
|
|
|
|
|
|
|
|
## 添加NAT规则,20000:40000替换为你设置端口跳跃的范围,10010替换为你节点的监听端口
|
|
|
|
|
iptables -t nat -A PREROUTING -p udp --dport 20000:40000 -j DNAT --to-destination :10010
|
|
|
|
|
|
|
|
|
|
## 查看NAT规则
|
|
|
|
|
iptables -t nat -nL --line
|
|
|
|
|
|
|
|
|
|
## 保存iptables规则
|
|
|
|
|
service iptables save
|
|
|
|
|
```
|
|
|
|
|
|
2023-09-04 15:59:58 +08:00
|
|
|
|
# **脚本支持的节点类型**
|
2023-07-29 17:19:25 +08:00
|
|
|
|
- **TUIC V5**
|
2023-08-25 18:02:22 +08:00
|
|
|
|
- **juicity**
|
2023-08-30 17:23:20 +08:00
|
|
|
|
- **WireGuard**
|
2023-09-04 11:24:51 +08:00
|
|
|
|
- **Hysteria2**
|
2023-07-29 17:19:25 +08:00
|
|
|
|
- **Vless+vision+Reality**
|
|
|
|
|
- **Vless+h2+Reality**
|
|
|
|
|
- **Vless+gRPC+Reality**
|
|
|
|
|
- **Direct tunnel server**
|
2023-08-17 17:55:28 +08:00
|
|
|
|
- **Trojan+tcp+tls+web**
|
|
|
|
|
- **Trojan+ws+tls+(CDN)**
|
2023-07-29 17:19:25 +08:00
|
|
|
|
- **Hysteria**
|
|
|
|
|
- **ShadowTLS V3**
|
|
|
|
|
- **NaiveProxy**
|
|
|
|
|
- **Shadowsocks**
|