forked from jacyl4/chnroute
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ros-dpbr.sh
executable file
·121 lines (92 loc) · 2.56 KB
/
ros-dpbr.sh
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
#!/bin/sh
mkdir -p ./pbr
cd ./pbr
#电信
wget --no-check-certificate -c -O ct.txt https://ispip.clang.cn/chinatelecom_cidr.txt
#联通
wget --no-check-certificate -c -O cu.txt https://ispip.clang.cn/unicom_cnc_cidr.txt
#移动
wget --no-check-certificate -c -O cm.txt https://ispip.clang.cn/cmcc_cidr.txt
#铁通
wget --no-check-certificate -c -O crtc.txt https://ispip.clang.cn/crtc_cidr.txt
#教育网
wget --no-check-certificate -c -O cernet.txt https://ispip.clang.cn/cernet_cidr.txt
#长城宽带/鹏博士
wget --no-check-certificate -c -O gwbn.txt https://ispip.clang.cn/gwbn_cidr.txt
#其他
wget --no-check-certificate -c -O other.txt https://ispip.clang.cn/othernet_cidr.txt
{
echo "/ip route rule"
for net in $(cat ct.txt) ; do
echo "add dst-address=$net action=lookup table=CT"
done
for net in $(cat cu.txt) ; do
echo "add dst-address=$net action=lookup table=CT"
done
for net in $(cat cm.txt) ; do
echo "add dst-address=$net action=lookup table=CMCC"
done
for net in $(cat crtc.txt) ; do
echo "add dst-address=$net action=lookup table=CMCC"
done
for net in $(cat cernet.txt) ; do
echo "add dst-address=$net action=lookup table=CT"
done
for net in $(cat gwbn.txt) ; do
echo "add dst-address=$net action=lookup table=CT"
done
for net in $(cat other.txt) ; do
echo "add dst-address=$net action=lookup table=CT"
done
} > ../ros-pbr-CT-CMCC.rsc
{
echo "/ip firewall address-list"
for net in $(cat ct.txt) ; do
echo "add list=dpbr-CT address=$net"
done
for net in $(cat cu.txt) ; do
echo "add list=dpbr-CT address=$net"
done
for net in $(cat cm.txt) ; do
echo "add list=dpbr-CMCC address=$net"
done
for net in $(cat crtc.txt) ; do
echo "add list=dpbr-CMCC address=$net"
done
for net in $(cat cernet.txt) ; do
echo "add list=dpbr-CT address=$net"
done
for net in $(cat gwbn.txt) ; do
echo "add list=dpbr-CT address=$net"
done
for net in $(cat other.txt) ; do
echo "add list=dpbr-CT address=$net"
done
} > ../ros-dpbr-CT-CMCC.rsc
######电信联通
{
echo "/ip firewall address-list"
for net in $(cat ct.txt) ; do
echo "add list=dpbr-CT address=$net"
done
for net in $(cat cu.txt) ; do
echo "add list=dpbr-CU address=$net"
done
for net in $(cat cm.txt) ; do
echo "add list=dpbr-CT address=$net"
done
for net in $(cat crtc.txt) ; do
echo "add list=dpbr-CT address=$net"
done
for net in $(cat cernet.txt) ; do
echo "add list=dpbr-CT address=$net"
done
for net in $(cat gwbn.txt) ; do
echo "add list=dpbr-CT address=$net"
done
for net in $(cat other.txt) ; do
echo "add list=dpbr-CT address=$net"
done
} > ../ros-dpbr-CT-CU.rsc
cd ..
rm -rf ./pbr