Skip to content

Commit b6cb20e

Browse files
committed
fix:增加解除屏蔽行为的说明
1 parent 3d4a9cd commit b6cb20e

File tree

2 files changed

+187
-31
lines changed

2 files changed

+187
-31
lines changed

docs/en/guide/block/block_iptables.md

Lines changed: 94 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -82,64 +82,142 @@ sudo iptables-restore < /etc/iptables/rules.v4
8282

8383
### Blocking Mining Behavior
8484

85-
```
85+
```shell
8686
strings=(
8787
"ethermine.com"
88+
"ethermine.org"
8889
"antpool.one"
8990
"antpool.com"
9091
"pool.bar"
9192
"c3pool"
9293
"xmrig.com"
9394
"blackcat.host"
95+
"minexmr.com"
96+
"supportxmr.com"
97+
"monerohash.com"
98+
"hashvault.pro"
99+
"xmrpool.eu"
100+
"minergate.com"
101+
"webminepool.com"
102+
"nanopool.org"
103+
"2miners.com"
104+
"f2pool.com"
105+
"sparkpool.com"
106+
"nicehash.com"
107+
"prohashing.com"
108+
"coinhive.com"
109+
"coinimp.com"
110+
"cryptoloot.pro"
111+
"xmrig"
112+
"xmr-stak"
113+
"cpuminer"
114+
"cgminer"
115+
"ethminer"
116+
"stratum+tcp"
117+
"stratum+ssl"
118+
"stratum+http"
119+
"stratum"
120+
"raw.githubusercontent.com/xmrig"
121+
"github.com/xmrig"
94122
)
95123

124+
iptables -N MINING_BLOCK 2>/dev/null
125+
iptables -C OUTPUT -j MINING_BLOCK 2>/dev/null || iptables -A OUTPUT -j MINING_BLOCK
96126
for str in "${strings[@]}"; do
97-
iptables -A OUTPUT -m string --string "$str" --algo bm -j DROP
127+
iptables -A MINING_BLOCK -m string --string "$str" --algo bm -j DROP
98128
done
99129
```
100130

101131
### Blocking BT behavior
102132

103-
```
133+
```shell
104134
strings=(
105-
"torrent"
106-
".torrent"
107135
"BitTorrent"
108136
"BitTorrent protocol"
109-
"announce.php?passkey="
137+
"BitTorrent protocol\x13"
110138
"magnet:"
139+
".torrent"
140+
"d1:ad2:id20"
141+
"d1:rd2:id20"
142+
"ut_metadata"
143+
"ut_pex"
144+
"lt_metadata"
145+
"lt_donthave"
146+
"qBittorrent"
147+
"Transmission"
148+
"Deluge"
149+
"aria2"
150+
"libtorrent"
151+
"uTorrent"
152+
"BiglyBT"
153+
"Vuze"
111154
"xunlei"
112-
"sandai"
113155
"Thunder"
114156
"XLLiveUD"
115157
)
116158

159+
iptables -N BT_BLOCK 2>/dev/null
160+
iptables -C OUTPUT -j BT_BLOCK 2>/dev/null || iptables -A OUTPUT -j BT_BLOCK
117161
for str in "${strings[@]}"; do
118-
iptables -A OUTPUT -m string --string "$str" --algo bm -j DROP
162+
iptables -A BT_BLOCK -m string --string "$str" --algo bm -j DROP
119163
done
120164
```
121165

122166
### Blocking Speed Test Behavior
123167

124-
```
168+
```shell
125169
strings=(
126-
".speed"
127-
"speed."
128-
".speed."
170+
"speedtest"
129171
"fast.com"
130172
"speedtest.net"
131173
"speedtest.com"
132174
"speedtest.cn"
175+
"ookla.com"
176+
"speedtestcustom.com"
177+
"ovo.speedtestcustom.com"
178+
"speed.cloudflare.com"
133179
"test.ustc.edu.cn"
134180
"10000.gd.cn"
135181
"db.laomoe.com"
136182
"jiyou.cloud"
137-
"ovo.speedtestcustom.com"
138-
"speed.cloudflare.com"
139-
"speedtest"
183+
"mirrors.ustc.edu.cn"
184+
"mirrors.tuna.tsinghua.edu.cn"
185+
"mirrors.aliyun.com"
186+
".speed"
187+
".speed."
188+
"/speedtest"
189+
"/speed-test"
140190
)
141191

192+
iptables -N SPEED_BLOCK 2>/dev/null
193+
iptables -C OUTPUT -j SPEED_BLOCK 2>/dev/null || iptables -A OUTPUT -j SPEED_BLOCK
142194
for str in "${strings[@]}"; do
143-
iptables -A OUTPUT -m string --string "$str" --algo bm -j DROP
195+
iptables -A SPEED_BLOCK -m string --string "$str" --algo bm -j DROP
144196
done
197+
```
198+
199+
### Unblocking actions
200+
201+
Remove mining restrictions
202+
203+
```shell
204+
iptables -D OUTPUT -j MINING_BLOCK
205+
iptables -F MINING_BLOCK
206+
iptables -X MINING_BLOCK
207+
```
208+
209+
Remove BT restrictions
210+
211+
```shell
212+
iptables -D OUTPUT -j BT_BLOCK
213+
iptables -F BT_BLOCK
214+
iptables -X BT_BLOCK
215+
```
216+
217+
Remove speed restrictions
218+
219+
```shell
220+
iptables -D OUTPUT -j SPEED_BLOCK
221+
iptables -F SPEED_BLOCK
222+
iptables -X SPEED_BLOCK
145223
```

docs/guide/block/block_iptables.md

Lines changed: 93 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -83,61 +83,139 @@ sudo iptables-restore < /etc/iptables/rules.v4
8383
```
8484
strings=(
8585
"ethermine.com"
86+
"ethermine.org"
8687
"antpool.one"
8788
"antpool.com"
8889
"pool.bar"
8990
"c3pool"
9091
"xmrig.com"
9192
"blackcat.host"
93+
"minexmr.com"
94+
"supportxmr.com"
95+
"monerohash.com"
96+
"hashvault.pro"
97+
"xmrpool.eu"
98+
"minergate.com"
99+
"webminepool.com"
100+
"nanopool.org"
101+
"2miners.com"
102+
"f2pool.com"
103+
"sparkpool.com"
104+
"nicehash.com"
105+
"prohashing.com"
106+
"coinhive.com"
107+
"coinimp.com"
108+
"cryptoloot.pro"
109+
"xmrig"
110+
"xmr-stak"
111+
"cpuminer"
112+
"cgminer"
113+
"ethminer"
114+
"stratum+tcp"
115+
"stratum+ssl"
116+
"stratum+http"
117+
"stratum"
118+
"raw.githubusercontent.com/xmrig"
119+
"github.com/xmrig"
92120
)
93121
122+
iptables -N MINING_BLOCK 2>/dev/null
123+
iptables -C OUTPUT -j MINING_BLOCK 2>/dev/null || iptables -A OUTPUT -j MINING_BLOCK
94124
for str in "${strings[@]}"; do
95-
iptables -A OUTPUT -m string --string "$str" --algo bm -j DROP
125+
iptables -A MINING_BLOCK -m string --string "$str" --algo bm -j DROP
96126
done
97127
```
98128

99129
### 屏蔽BT行为
100130

101-
```
131+
```shell
102132
strings=(
103-
"torrent"
104-
".torrent"
105133
"BitTorrent"
106134
"BitTorrent protocol"
107-
"announce.php?passkey="
135+
"BitTorrent protocol\x13"
108136
"magnet:"
137+
".torrent"
138+
"d1:ad2:id20"
139+
"d1:rd2:id20"
140+
"ut_metadata"
141+
"ut_pex"
142+
"lt_metadata"
143+
"lt_donthave"
144+
"qBittorrent"
145+
"Transmission"
146+
"Deluge"
147+
"aria2"
148+
"libtorrent"
149+
"uTorrent"
150+
"BiglyBT"
151+
"Vuze"
109152
"xunlei"
110-
"sandai"
111153
"Thunder"
112154
"XLLiveUD"
113155
)
114156

157+
iptables -N BT_BLOCK 2>/dev/null
158+
iptables -C OUTPUT -j BT_BLOCK 2>/dev/null || iptables -A OUTPUT -j BT_BLOCK
115159
for str in "${strings[@]}"; do
116-
iptables -A OUTPUT -m string --string "$str" --algo bm -j DROP
160+
iptables -A BT_BLOCK -m string --string "$str" --algo bm -j DROP
117161
done
118162
```
119163

120164
### 屏蔽测速行为
121165

122-
```
166+
```shell
123167
strings=(
124-
".speed"
125-
"speed."
126-
".speed."
168+
"speedtest"
127169
"fast.com"
128170
"speedtest.net"
129171
"speedtest.com"
130172
"speedtest.cn"
173+
"ookla.com"
174+
"speedtestcustom.com"
175+
"ovo.speedtestcustom.com"
176+
"speed.cloudflare.com"
131177
"test.ustc.edu.cn"
132178
"10000.gd.cn"
133179
"db.laomoe.com"
134180
"jiyou.cloud"
135-
"ovo.speedtestcustom.com"
136-
"speed.cloudflare.com"
137-
"speedtest"
181+
"mirrors.ustc.edu.cn"
182+
"mirrors.tuna.tsinghua.edu.cn"
183+
"mirrors.aliyun.com"
184+
".speed"
185+
".speed."
186+
"/speedtest"
187+
"/speed-test"
138188
)
139189

190+
iptables -N SPEED_BLOCK 2>/dev/null
191+
iptables -C OUTPUT -j SPEED_BLOCK 2>/dev/null || iptables -A OUTPUT -j SPEED_BLOCK
140192
for str in "${strings[@]}"; do
141-
iptables -A OUTPUT -m string --string "$str" --algo bm -j DROP
193+
iptables -A SPEED_BLOCK -m string --string "$str" --algo bm -j DROP
142194
done
195+
```
196+
197+
### 解除屏蔽行为
198+
199+
解除挖矿限制
200+
201+
```shell
202+
iptables -D OUTPUT -j MINING_BLOCK
203+
iptables -F MINING_BLOCK
204+
iptables -X MINING_BLOCK
205+
```
206+
207+
解除BT限制
208+
209+
```shell
210+
iptables -D OUTPUT -j BT_BLOCK
211+
iptables -F BT_BLOCK
212+
iptables -X BT_BLOCK
213+
```
214+
215+
解除测速限制
216+
217+
```shell
218+
iptables -D OUTPUT -j SPEED_BLOCK
219+
iptables -F SPEED_BLOCK
220+
iptables -X SPEED_BLOCK
143221
```

0 commit comments

Comments
 (0)