1.sing-box配置完整配置文件普通socks5模式

ip防火墙ip配置命令

1
echo 1 > /proc/sys/net/ipv4/ip_forward
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
{
"log": {
"disabled": false,
"level": "info",
"output": "/var/log/box.log",
"timestamp": true
},
"dns": {
"servers": [
{
"tag": "alidns",
"address": "udp://8.8.4.4",
"address_strategy": "prefer_ipv4",
"strategy": "ipv4_only",
"detour": "direct"
},
{
"tag": "cf",
"address": "udp://8.8.8.8",
"strategy": "ipv4_only",
"detour": "direct"
},
{
"tag": "block",
"address": "rcode://success"
}
],
"rules": [
{
"geosite": ["cn"],
"domain_suffix": [".cn"],
"server": "alidns",
"disable_cache": false
},
{
"geosite": ["category-ads-all"],
"server": "block",
"disable_cache": true
}
],
"final": "cf",
"disable_cache": false,
"disable_expire": false
},
"inbounds": [
{
"type": "socks",
"tag": "proxy",
"listen": "::",
"listen_port": 9999,
"tcp_fast_open": true,
"udp_fragment": true,
"sniff": true
}
],
"outbounds": [
{
"type": "hysteria2",
"tag": "proxy",
"server": "",//这里输入你的域名
"server_port": 25565,
"up_mbps": 50,
"down_mbps": 50,
"password": "XXX",
"tls": {
"enabled": true,
"server_name": "www.bing.com",
"insecure": true,
"alpn": ["h3"]
},
"brutal_debug": false
},
{
"type": "direct",
"tag": "direct"
},
{
"type": "block",
"tag": "block"
},
{
"type": "dns",
"tag": "dns-out"
}
],
"route": {
"geoip": {
"path": "geoip.db",
"download_url": "https://github.com/SagerNet/sing-geoip/releases/latest/download/geoip.db",
"download_detour": "direct"
},
"geosite": {
"path": "geosite.db",
"download_url": "https://github.com/SagerNet/sing-geosite/releases/latest/download/geosite.db",
"download_detour": "direct"
},
"rules": [
{
"protocol": "dns",
"outbound": "dns-out"
},
{
"geosite": ["cn", "private"],
"geoip": ["cn", "private"],
"domain_suffix": [".cn"],
"outbound": "direct"
},
{
"geosite": ["category-ads-all"],
"outbound": "block"
}
],
"auto_detect_interface": true,
"final": "proxy"
},
"experimental": {}
}

第二个是TUN模式的使用方法

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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
{
"log": {
"disabled": false,
"level": "info",
"output": "/var/log/box.log",
"timestamp": true
},
"dns": {
"servers": [
{
"tag": "alidns",
"address": "https://223.5.5.5/dns-query",
"address_strategy": "prefer_ipv4",
"strategy": "ipv4_only",
"detour": "direct"
},
{
"tag": "cf",
"address": "https://1.1.1.1/dns-query",
"strategy": "ipv4_only",
"detour": "direct"
},
{
"tag": "block",
"address": "rcode://success"
}
],
"rules": [
{
"geosite": ["cn"],
"domain_suffix": [".cn"],
"server": "alidns",
"disable_cache": false
},
{
"geosite": ["category-ads-all"],
"server": "block",
"disable_cache": true
}
],
"final": "cf",
"disable_cache": false,
"disable_expire": false
},
"inbounds": [
{
"tag": "tun-in",
"type": "tun",
"inet4_address": "172.19.0.1/30",
"auto_route": true,
"strict_route": true,
"stack": "system",
"mtu": 9000,
"sniff": true,
"sniff_override_destination": true,
"sniff_timeout": "300ms",
"domain_strategy": "prefer_ipv4"
}
],
"outbounds": [
{
"type": "hysteria2",
"tag": "proxy",
"server": "",//这里输入你的域名
"server_port": 25565,
"up_mbps": 50,
"down_mbps": 50,
"password": "",
"tls": {
"enabled": true,
"server_name": "www.bing.com",
"insecure": true,
"alpn": ["h3"]
},
"brutal_debug": false
},
{
"type": "direct",
"tag": "direct"
},
{
"type": "block",
"tag": "block"
},
{
"type": "dns",
"tag": "dns-out"
}
],
"route": {
"geoip": {
"path": "geoip.db",
"download_url": "https://github.com/SagerNet/sing-geoip/releases/latest/download/geoip.db",
"download_detour": "direct"
},
"geosite": {
"path": "geosite.db",
"download_url": "https://github.com/SagerNet/sing-geosite/releases/latest/download/geosite.db",
"download_detour": "direct"
},
"rules": [
{
"protocol": "dns",
"outbound": "dns-out"
},
{
"geosite": ["cn", "private"],
"geoip": ["cn", "private"],
"domain_suffix": [".cn"],
"outbound": "direct"
},
{
"geosite": ["category-ads-all"],
"outbound": "block"
}
],
"auto_detect_interface": true,
"final": "proxy"
},
"experimental": {}
}