区分极狐极光配置

This commit is contained in:
2025-09-28 18:05:21 +08:00
parent f8cad4e61f
commit 37f77cd7d0
5 changed files with 663 additions and 333 deletions

View File

@@ -1,3 +1,19 @@
## 使用说明
一、上传 ros 镜像,位置在 `templates` 目录下
二、为 ros 配置公网 IP 与网关,并重置 mac 地址
```
/ip/address/set 0 address=公网地址/掩码
/ip/route/set 0 gateway=网关地址
/interface/ethernet/reset-mac-address wan
```
三、将需要部署的 ros 配置条目从 `config.bak.csv` 中复制到 `config.csv`
四、执行 `main.py`
## 部署流程 ## 部署流程
**参数** **参数**

221
config.jg.bak.csv Normal file
View File

@@ -0,0 +1,221 @@
index,name,code,gateway,public,mask,private,domain,cert
1,宣城,ahxc215,43.226.59.1,43.226.59.10,24,192.168.199.1,ahxc,server.crt
2,宿州,ahsz216,43.226.59.1,43.226.59.11,24,192.168.199.2,ahsz,server.crt
3,阜阳,ahfy225,43.226.59.1,43.226.59.12,24,192.168.199.3,ahfy,server.crt
4,合肥,ahhf224,43.226.59.1,43.226.59.13,24,192.168.199.4,ahhf,server.crt
5,淮南,ahhn222,43.226.59.1,43.226.59.14,24,192.168.199.5,ahhn,server.crt
6,铜陵,ahtl218,43.226.59.1,43.226.59.15,24,192.168.199.6,ahtl,server.crt
7,马鞍山,ahmas219,43.226.59.1,43.226.59.16,24,192.168.199.7,ahmas,server.crt
8,黄山,ahhs221,43.226.59.1,43.226.59.17,24,192.168.199.8,ahhs,server.crt
9,亳州,ahbz228,43.226.59.1,43.226.59.18,24,192.168.199.9,ahbz,server.crt
10,安庆,ahaq230,43.226.59.1,43.226.59.19,24,192.168.199.10,ahaq,server.crt
11,淮北,ahhb223,43.226.59.1,43.226.59.20,24,192.168.199.11,ahhb,server.crt
12,滁州,ahcz226,43.226.59.1,43.226.59.21,24,192.168.199.12,ahcz,server.crt
13,芜湖,ahwh217,43.226.59.1,43.226.59.22,24,192.168.199.13,ahwh,server.crt
14,六安,ahla220,43.226.59.1,43.226.59.23,24,192.168.199.14,ahla,server.crt
15,蚌埠,ahbb229,43.226.59.1,43.226.59.24,24,192.168.199.15,ahbb,server.crt
16,池州,ahchz227,43.226.59.1,43.226.59.25,24,192.168.199.16,ahchiz,server.crt
17,营口,lnlyk196,43.226.59.1,43.226.59.26,24,192.168.199.17,lnyk,server.crt
18,鞍山,lnas204,43.226.59.1,43.226.59.27,24,192.168.199.18,lnas,server.crt
19,抚顺,lnfs201,43.226.59.1,43.226.59.28,24,192.168.199.19,lnfs,server.crt
20,沈阳,lnsy198,43.226.59.1,43.226.59.29,24,192.168.199.20,lnsy,server.crt
21,大连,lndl202,43.226.59.1,43.226.59.30,24,192.168.199.21,lndl,server.crt
22,朝阳,lncy203,43.226.59.1,43.226.59.31,24,192.168.199.22,lnzy,server.crt
23,盘锦,lnpj199,43.226.59.1,43.226.59.32,24,192.168.199.23,lnpj,server.crt
24,葫芦岛,lnhld200,43.226.59.1,43.226.59.33,24,192.168.199.24,lnhld,server.crt
25,铁岭,lntl197,43.226.59.1,43.226.59.34,24,192.168.199.25,lntl,server.crt
26,攀枝花,scpzh148,43.226.59.1,43.226.59.35,24,192.168.199.26,scpzh,server.crt
27,自贡,sczg146,43.226.59.1,43.226.59.36,24,192.168.199.27,sczg,jg/36.crt
28,内江,scnj149,43.226.59.1,43.226.59.37,24,192.168.199.28,scnj,server.crt
29,成都,sccd157,43.226.59.1,43.226.59.38,24,192.168.199.29,sccd,server.crt
30,广元,scgy154,43.226.59.1,43.226.59.39,24,192.168.199.30,scgy,server.crt
31,德阳,scdy155,43.226.59.1,43.226.59.40,24,192.168.199.31,scdy,server.crt
32,泸州,sclz152,43.226.59.1,43.226.59.41,24,192.168.199.32,sclz,server.crt
33,乐山,scls153,43.226.59.1,43.226.59.42,24,192.168.199.33,scls,server.crt
34,绵阳,scmy151,43.226.59.1,43.226.59.43,24,192.168.199.34,scmy,server.crt
35,达州,scdz156,43.226.59.1,43.226.59.44,24,192.168.199.35,scdz,server.crt
36,南充,scnc150,43.226.59.1,43.226.59.45,24,192.168.199.36,scnc,server.crt
37,宜宾,scyb147,43.226.59.1,43.226.59.46,24,192.168.199.37,scyb,server.crt
38,保定,hbbd169,43.226.59.1,43.226.59.47,24,192.168.199.38,hbbd,server.crt
39,张家口,hbzjk159,43.226.59.1,43.226.59.48,24,192.168.199.39,hbzjk,server.crt
40,沧州,hbcz168,43.226.59.1,43.226.59.49,24,192.168.199.40,hbcz,server.crt
41,秦皇岛,hbqhd163,43.226.59.1,43.226.59.50,24,192.168.199.41,hbqhd,server.crt
42,邯郸,hbhd166,43.226.59.1,43.226.59.51,24,192.168.199.42,hbhd,server.crt
43,唐山,hbts161,43.226.59.1,43.226.59.52,24,192.168.199.43,hbts,server.crt
44,廊坊,hblf164,43.226.59.1,43.226.59.53,24,192.168.199.44,hblf,server.crt
45,承德,hbcd167,43.226.59.1,43.226.59.54,24,192.168.199.45,hbcd,server.crt
46,石家庄,hbsjz162,43.226.59.1,43.226.59.55,24,192.168.199.46,hbsjz,server.crt
47,衡水,hbhs165,43.226.59.1,43.226.59.56,24,192.168.199.47,hbhshui,server.crt
48,邢台,hbxt160,43.226.59.1,43.226.59.57,24,192.168.199.48,hbxt,server.crt
49,台州,zjtz135,43.226.59.1,43.226.59.58,24,192.168.199.49,zjtz,server.crt
50,嘉兴,zjjx141,43.226.59.1,43.226.59.59,24,192.168.199.50,zjjx,server.crt
51,宁波,zjnb138,43.226.59.1,43.226.59.60,24,192.168.199.51,zjnb,jg/60.crt
52,杭州,zjhz143,43.226.59.1,43.226.59.61,24,192.168.199.52,zjhz,jg/61.crt
53,绍兴,zjsx136,43.226.59.1,43.226.59.62,24,192.168.199.53,zjsx,jg/62.crt
54,丽水,zjls139,43.226.59.1,43.226.59.63,24,192.168.199.54,zjls,jg/63.crt
55,温州,zjwz134,43.226.59.1,43.226.59.64,24,192.168.199.55,zjwz,jg/64.crt
56,湖州,zjhz142,43.226.59.1,43.226.59.65,24,192.168.199.56,zjhuz,jg/65.crt
57,舟山,zjzs133,43.226.59.1,43.226.59.66,24,192.168.199.57,zjzs,jg/66.crt
58,衢州,zjqz137,43.226.59.1,43.226.59.67,24,192.168.199.58,zjqz,jg/67.crt
59,金华,zjjh140,43.226.59.1,43.226.59.68,24,192.168.199.59,zjjh,jg/68.crt
60,海口,hnhk172,43.226.59.1,43.226.59.69,24,192.168.199.60,hnhk,jg/69.crt
61,文昌,hnwc170,43.226.59.1,43.226.59.70,24,192.168.199.61,hnwc,jg/70.crt
62,三亚,hnsy171,43.226.59.1,43.226.59.71,24,192.168.199.62,hnsya,jg/71.crt
63,上海,sh130,43.226.59.1,43.226.59.72,24,192.168.199.63,sh,jg/72.crt
64,昆明,ynkm144,43.226.59.1,43.226.59.73,24,192.168.199.64,ynkm,jg/73.crt
65,呼和浩特,nmghhht192,43.226.59.1,43.226.59.74,24,192.168.199.65,nmghhht,jg/74.crt
66,赤峰,nmgcf194,43.226.59.1,43.226.59.75,24,192.168.199.66,nmgcf,jg/75.crt
67,鄂尔多斯,nmgeeds193,43.226.59.1,43.226.59.76,24,192.168.199.67,nmgeeds,jg/76.crt
68,通辽,nmgtl190,43.226.59.1,43.226.59.77,24,192.168.199.68,nmgtl,jg/77.crt
69,包头,nmgbt195,43.226.59.1,43.226.59.78,24,192.168.199.69,nmgbt,jg/78.crt
70,呼伦贝尔,nmghlbe191,43.226.59.1,43.226.59.79,24,192.168.199.70,nmghlbe,jg/79.crt
71,南昌,jxnc210,43.226.59.1,43.226.59.80,24,192.168.199.71,jxnc,jg/80.crt
72,鹰潭,jxyt205,43.226.59.1,43.226.59.81,24,192.168.199.72,jxyt,jg/81.crt
73,抚州,jxfz215,43.226.59.1,43.226.59.82,24,192.168.199.73,jxfz,jg/82.crt
74,新余,jxxy207,43.226.59.1,43.226.59.83,24,192.168.199.74,jxxy,jg/83.crt
75,景德镇,jxjdz212,43.226.59.1,43.226.59.84,24,192.168.199.75,jxjdz,jg/84.crt
76,萍乡,jxpx209,43.226.59.1,43.226.59.85,24,192.168.199.76,jxpx,jg/85.crt
77,上饶,jxsr208,43.226.59.1,43.226.59.86,24,192.168.199.77,jxsr,jg/86.crt
78,九江,jxjj211,43.226.59.1,43.226.59.87,24,192.168.199.78,jxjj,jg/87.crt
79,吉安,jxja213,43.226.59.1,43.226.59.88,24,192.168.199.79,jxja,jg/88.crt
80,宜春,jxyc206,43.226.59.1,43.226.59.89,24,192.168.199.80,jxyc,jg/89.crt
81,赣州,jxgz214,43.226.59.1,43.226.59.90,24,192.168.199.81,jxgz,jg/90.crt
82,德州,sddz187,43.226.59.1,43.226.59.91,24,192.168.199.82,sddz,jg/91.crt
83,淄博,sdzb173,43.226.59.1,43.226.59.92,24,192.168.199.83,sdzb,jg/92.crt
84,潍坊,sdwf176,43.226.59.1,43.226.59.93,24,192.168.199.84,sdwf,jg/93.crt
85,烟台,sdyt175,43.226.59.1,43.226.59.94,24,192.168.199.85,sdyt,jg/94.crt
86,菏泽,sdhz185,43.226.59.1,43.226.59.95,24,192.168.199.86,sdhz,jg/95.crt
87,威海,sdwh177,43.226.59.1,43.226.59.96,24,192.168.199.87,sdwh,jg/96.crt
88,枣庄,sdzz174,43.226.59.1,43.226.59.97,24,192.168.199.88,sdzz,jg/97.crt
89,泰安,sdta178,43.226.59.1,43.226.59.98,24,192.168.199.89,sdta,jg/98.crt
90,济宁,sdjn183,43.226.59.1,43.226.59.99,24,192.168.199.90,sdjin,jg/99.crt
91,滨州,sdbz188,43.226.59.1,43.226.59.100,24,192.168.199.91,sdbz,jg/100.crt
92,东营,sddy186,43.226.59.1,43.226.59.101,24,192.168.199.92,sddy,jg/101.crt
93,日照,sdrz179,43.226.59.1,43.226.59.102,24,192.168.199.93,sdrz,jg/102.crt
94,青岛,sdqd180,43.226.59.1,43.226.59.103,24,192.168.199.94,sdqd,jg/103.crt
95,临沂,sdly181,43.226.59.1,43.226.59.104,24,192.168.199.95,sdly,jg/104.crt
96,济南,sdjn184,43.226.59.1,43.226.59.105,24,192.168.199.96,sdjn,jg/105.crt
97,聊城,sdlc182,43.226.59.1,43.226.59.106,24,192.168.199.97,sdlc,jg/106.crt
98,商丘,hnsq151,43.226.59.1,43.226.59.107,24,192.168.199.98,hnsq,server.crt
99,安阳,hnay158,43.226.59.1,43.226.59.108,24,192.168.199.99,hnay,server.crt
100,开封,hnkf155,43.226.59.1,43.226.59.109,24,192.168.199.100,hnkf,server.crt
101,新乡,hnxx150,43.226.59.1,43.226.59.110,24,192.168.199.101,hnxx,server.crt
102,洛阳,hnly154,43.226.59.1,43.226.59.111,24,192.168.199.102,hnly,server.crt
103,信阳,hnxy149,43.226.59.1,43.226.59.112,24,192.168.199.103,hnxy,jg/112.crt
104,周口,hnzk146,43.226.59.1,43.226.59.113,24,192.168.199.104,hnzk,jg/113.crt
105,漯河,hnlh153,43.226.59.1,43.226.59.114,24,192.168.199.105,hnlh,server.crt
106,焦作,hnjz156,43.226.59.1,43.226.59.115,24,192.168.199.106,hnjz,server.crt
107,驻马店,hnzmd145,43.226.59.1,43.226.59.116,24,192.168.199.107,hnzmd,server.crt
108,鹤壁,hnhb157,43.226.59.1,43.226.59.117,24,192.168.199.108,hnhb,server.crt
109,郑州,hnzz147,43.226.59.1,43.226.59.118,24,192.168.199.109,hnzz,server.crt
110,南阳,hnny152,43.226.59.1,43.226.59.119,24,192.168.199.110,hnny,jg/119.crt
111,许昌,hnxc148,43.226.59.1,43.226.59.120,24,192.168.199.111,hnxc,server.crt
112,桂林,gxgl182,43.226.59.1,43.226.59.121,24,192.168.199.112,gxgl,jg/121.crt
113,贵港,gxgg183,43.226.59.1,43.226.59.122,24,192.168.199.113,gxgg,jg/122.crt
114,北海,gxbh184,43.226.59.1,43.226.59.123,24,192.168.199.114,gxbh,jg/123.crt
115,南宁,gxnn180,43.226.59.1,43.226.59.124,24,192.168.199.115,gxnn,jg/124.crt
116,柳州,gxlz181,43.226.59.1,43.226.59.125,24,192.168.199.116,gxlz,jg/125.crt
117,钦州,gxqz179,43.226.59.1,43.226.59.126,24,192.168.199.117,gxqz,jg/126.crt
118,玉林,gxyl178,43.226.59.1,43.226.59.127,24,192.168.199.118,gxyl,jg/127.crt
119,银川,nxyc189,43.226.59.1,43.226.59.128,24,192.168.199.119,nxyc,jg/128.crt
120,大同,sxdt172,43.226.59.1,43.226.59.129,24,192.168.199.120,sxdt,jg/129.crt
121,晋城,sxjc171,43.226.59.1,43.226.59.130,24,192.168.199.121,sxjc,jg/130.crt
122,长治,sxcz163,43.226.59.1,43.226.59.131,24,192.168.199.122,sxcz,jg/131.crt
123,阳泉,sxyq165,43.226.59.1,43.226.59.132,24,192.168.199.123,sxyq,jg/132.crt
124,临汾,sxlf170,43.226.59.1,43.226.59.133,24,192.168.199.124,sxlf,jg/133.crt
125,吕梁,sxll169,43.226.59.1,43.226.59.134,24,192.168.199.125,sxll,jg/134.crt
126,太原,sxty167,43.226.59.1,43.226.59.135,24,192.168.199.126,sxty,jg/135.crt
127,忻州,sxxz166,43.226.59.1,43.226.59.136,24,192.168.199.127,sxxz,jg/136.crt
128,朔州,sxsz168,43.226.59.1,43.226.59.137,24,192.168.199.128,sxsz,jg/137.crt
129,运城,sxyc164,43.226.59.1,43.226.59.138,24,192.168.199.129,sxyc,jg/138.crt
130,株洲,hnzz235,43.226.59.1,43.226.59.139,24,192.168.199.130,hnzhuz,jg/139.crt
131,邵阳,hnsy239,43.226.59.1,43.226.59.140,24,192.168.199.131,hnsy,jg/140.crt
132,郴州,hncz241,43.226.59.1,43.226.59.141,24,192.168.199.132,hncz,server.crt
133,长沙,hncs236,43.226.59.1,43.226.59.142,24,192.168.199.133,hncs,jg/142.crt
134,湘潭,hnxt238,43.226.59.1,43.226.59.143,24,192.168.199.134,hnxt,jg/143.crt
135,衡阳,hnhy240,43.226.59.1,43.226.59.144,24,192.168.199.135,hnhy,jg/144.crt
136,岳阳,hnyy237,43.226.59.1,43.226.59.145,24,192.168.199.136,hnyy,jg/145.crt
137,三明,fjsm208,43.226.59.1,43.226.59.146,24,192.168.199.137,fjsming,jg/146.crt
138,南平,fjnp212,43.226.59.1,43.226.59.147,24,192.168.199.138,fjnp,jg/147.crt
139,厦门,fjxm207,43.226.59.1,43.226.59.148,24,192.168.199.139,fjsm,jg/148.crt
140,龙岩,fjly213,43.226.59.1,43.226.59.149,24,192.168.199.140,fjly,jg/149.crt
141,宁德,fjnd211,43.226.59.1,43.226.59.150,24,192.168.199.141,fjnd,jg/150.crt
142,泉州,fjqz209,43.226.59.1,43.226.59.151,24,192.168.199.142,fjqz,jg/151.crt
143,福州,fjfz214,43.226.59.1,43.226.59.152,24,192.168.199.143,fjfz,jg/152.crt
144,莆田,fjpt210,43.226.59.1,43.226.59.153,24,192.168.199.144,fjpt,jg/153.crt
145,六盘水,gzlps176,43.226.59.1,43.226.59.154,24,192.168.199.145,gzlps,jg/154.crt
146,黔东南,gzqdn175,43.226.59.1,43.226.59.155,24,192.168.199.146,gzqdn,jg/155.crt
147,贵阳,gzgy177,43.226.59.1,43.226.59.156,24,192.168.199.147,gzgy,jg/156.crt
148,遵义,gzzy173,43.226.59.1,43.226.59.157,24,192.168.199.148,gzzy,jg/157.crt
149,铜仁,gztr174,43.226.59.1,43.226.59.158,24,192.168.199.149,gztr,jg/158.crt
150,渭南,sxwn160,43.226.59.1,43.226.59.159,24,192.168.199.150,sxwn,jg/159.crt
151,宝鸡,sxbj162,43.226.59.1,43.226.59.160,24,192.168.199.151,sxbj,jg/160.crt
152,西安,sxxa159,43.226.59.1,43.226.59.161,24,192.168.199.152,sxxa,server.crt
153,铜川,sxtc161,43.226.59.1,43.226.59.162,24,192.168.199.153,sxtc,server.crt
154,咸阳,sxxy158,43.226.59.1,43.226.59.163,24,192.168.199.154,sxxy,server.crt
155,北京,bj129,43.226.59.1,43.226.59.164,24,192.168.199.155,bj,jg/164.crt
156,天津,tj131,43.226.59.1,43.226.59.165,24,192.168.199.156,tj,server.crt
157,南通,jsnt224,43.226.59.1,43.226.59.166,24,192.168.199.157,jsnt,jg/166.crt
158,宿迁,jssq220,43.226.59.1,43.226.59.167,24,192.168.199.158,jssq,jg/167.crt
159,常州,jscz228,43.226.59.1,43.226.59.168,24,192.168.199.159,jscz,jg/168.crt
160,南京,jsnj225,43.226.59.1,43.226.59.169,24,192.168.199.160,jsnj,jg/169.crt
161,泰州,jstz222,43.226.59.1,43.226.59.170,24,192.168.199.161,jstz,jg/170.crt
162,淮安,jsha227,43.226.59.1,43.226.59.171,24,192.168.199.162,jsha,server.crt
163,苏州,jssz223,43.226.59.1,43.226.59.172,24,192.168.199.163,jssz,jg/172.crt
164,连云港,jslyg226,43.226.59.1,43.226.59.173,24,192.168.199.164,jslyg,jg/173.crt
165,无锡,jswx221,43.226.59.1,43.226.59.174,24,192.168.199.165,jswx,jg/174.crt
166,扬州,jsyz217,43.226.59.1,43.226.59.175,24,192.168.199.166,jsyz,jg/175.crt
167,盐城,jsyc218,43.226.59.1,43.226.59.176,24,192.168.199.167,jsyc,jg/176.crt
168,徐州,jsxz219,43.226.59.1,43.226.59.177,24,192.168.199.168,jsxz,jg/177.crt
169,镇江,jszj216,43.226.59.1,43.226.59.178,24,192.168.199.169,jszj,jg/178.crt
170,咸宁,hbxn245,43.226.59.1,43.226.59.179,24,192.168.199.170,hbxn,server.crt
171,荆州,hbjz129,43.226.59.1,43.226.59.180,24,192.168.199.171,hbjz,jg/180.crt
172,黄石,hbhs131,43.226.59.1,43.226.59.181,24,192.168.199.172,hbhs,jg/181.crt
173,武汉,hbwh246,43.226.59.1,43.226.59.182,24,192.168.199.173,hbwh,server.crt
174,荆门,hbjm130,43.226.59.1,43.226.59.183,24,192.168.199.174,hbjm,jg/183.crt
175,孝感,hbxg243,43.226.59.1,43.226.59.184,24,192.168.199.175,hbxg,server.crt
176,宜昌,hbyc242,43.226.59.1,43.226.59.185,24,192.168.199.176,hbyc,server.crt
177,襄阳,hbxy244,43.226.59.1,43.226.59.186,24,192.168.199.177,hbxy,jg/186.crt
178,黄冈,hbhg132,43.226.59.1,43.226.59.187,24,192.168.199.178,hbhg,jg/187.crt
179,重庆,cq132,43.226.59.1,43.226.59.188,24,192.168.199.179,cq,jg/188.crt
180,白山,jlbs234,43.226.59.1,43.226.59.189,24,192.168.199.180,jlbs,jg/189.crt
181,通化,jlth231,43.226.59.1,43.226.59.190,24,192.168.199.181,jlth,jg/190.crt
182,松原,jlsy232,43.226.59.1,43.226.59.191,24,192.168.199.182,jlsy,jg/191.crt
183,长春,jlcc229,43.226.59.1,43.226.59.192,24,192.168.199.183,jlcc,jg/192.crt
184,四平,jlsp233,43.226.59.1,43.226.59.193,24,192.168.199.184,jlsp,jg/193.crt
185,延边,jlyb230,43.226.59.1,43.226.59.194,24,192.168.199.185,jlyb,jg/194.crt
186,广州,gdgz202,43.226.59.1,43.226.59.195,24,192.168.199.186,gdgz,jg/195.crt
187,惠州,gdhz200,43.226.59.1,43.226.59.196,24,192.168.199.187,gdhz,jg/196.crt
188,深圳,gdsz191,43.226.59.1,43.226.59.197,24,192.168.199.188,gdsz,jg/197.crt
189,珠海,gdzh185,43.226.59.1,43.226.59.198,24,192.168.199.189,gdzh,jg/198.crt
190,茂名,gdmm197,43.226.59.1,43.226.59.199,24,192.168.199.190,gdmm,jg/199.crt
191,阳江,gdyj190,43.226.59.1,43.226.59.200,24,192.168.199.191,gdyj,jg/200.crt
192,中山,gdzs186,43.226.59.1,43.226.59.201,24,192.168.199.192,gdzs,jg/201.crt
193,云浮,gdyf189,43.226.59.1,43.226.59.202,24,192.168.199.193,gdyf,jg/202.crt
194,揭阳,gdjy198,43.226.59.1,43.226.59.203,24,192.168.199.194,gdjy,jg/203.crt
195,汕头,gdst194,43.226.59.1,43.226.59.204,24,192.168.199.195,gdst,jg/204.crt
196,韶关,gdsg192,43.226.59.1,43.226.59.205,24,192.168.199.196,gdsg,jg/205.crt
197,潮州,gdcz205,43.226.59.1,43.226.59.206,24,192.168.199.197,gdcz,jg/206.crt
198,佛山,gdfs203,43.226.59.1,43.226.59.207,24,192.168.199.198,gdfs,jg/207.crt
199,汕尾,gdsw193,43.226.59.1,43.226.59.208,24,192.168.199.199,gdsw,jg/208.crt
200,江门,gdjm199,43.226.59.1,43.226.59.209,24,192.168.199.200,gdjm,jg/209.crt
201,河源,gdhy201,43.226.59.1,43.226.59.210,24,192.168.199.201,gdhy,jg/210.crt
202,清远,gdqy195,43.226.59.1,43.226.59.211,24,192.168.199.202,gdqy,jg/211.crt
203,湛江,gdzj188,43.226.59.1,43.226.59.212,24,192.168.199.203,gdzj,jg/212.crt
204,东莞,gddg204,43.226.59.1,43.226.59.213,24,192.168.199.204,gddg,jg/213.crt
205,梅州,gdmz196,43.226.59.1,43.226.59.214,24,192.168.199.205,gdmz,jg/214.crt
206,肇庆,gdzq187,43.226.59.1,43.226.59.215,24,192.168.199.206,gdzq,jg/215.crt
207,乌鲁木齐,xjwlmq145,43.226.59.1,43.226.59.216,24,192.168.199.207,xjwlmq,jg/216.crt
208,兰州,gslz206,43.226.59.1,43.226.59.217,24,192.168.199.208,gslz,jg/217.crt
209,七台河,hljqth137,43.226.59.1,43.226.59.218,24,192.168.199.209,hljqth,jg/218.crt
210,牡丹江,hljmdj138,43.226.59.1,43.226.59.219,24,192.168.199.210,hljmdj,jg/219.crt
211,绥化,hljsh134,43.226.59.1,43.226.59.220,24,192.168.199.211,hljsh,jg/220.crt
212,鹤岗,hljhg142,43.226.59.1,43.226.59.221,24,192.168.199.212,hljhg,jg/221.crt
213,双鸭山,hljsys135,43.226.59.1,43.226.59.222,24,192.168.199.213,hljsys,jg/222.crt
214,大庆,hljdq144,43.226.59.1,43.226.59.223,24,192.168.199.214,hljdq,server.crt
215,佳木斯,hljjms139,43.226.59.1,43.226.59.224,24,192.168.199.215,hljjms,jg/224.crt
216,鸡西,hljjx140,43.226.59.1,43.226.59.225,24,192.168.199.216,hljjx,jg/225.crt
217,伊春,hljyc133,43.226.59.1,43.226.59.226,24,192.168.199.217,hljyc,jg/226.crt
218,哈尔滨,hljheb143,43.226.59.1,43.226.59.227,24,192.168.199.218,hljheb,jg/227.crt
219,黑河,hljhh141,43.226.59.1,43.226.59.228,24,192.168.199.219,hljhhe,jg/228.crt
220,齐齐哈尔,hljqqhe136,43.226.59.1,43.226.59.229,24,192.168.199.220,hljqqhe,jg/229.crt
1 index name code gateway public mask private domain cert
2 1 宣城 ahxc215 43.226.59.1 43.226.59.10 24 192.168.199.1 ahxc server.crt
3 2 宿州 ahsz216 43.226.59.1 43.226.59.11 24 192.168.199.2 ahsz server.crt
4 3 阜阳 ahfy225 43.226.59.1 43.226.59.12 24 192.168.199.3 ahfy server.crt
5 4 合肥 ahhf224 43.226.59.1 43.226.59.13 24 192.168.199.4 ahhf server.crt
6 5 淮南 ahhn222 43.226.59.1 43.226.59.14 24 192.168.199.5 ahhn server.crt
7 6 铜陵 ahtl218 43.226.59.1 43.226.59.15 24 192.168.199.6 ahtl server.crt
8 7 马鞍山 ahmas219 43.226.59.1 43.226.59.16 24 192.168.199.7 ahmas server.crt
9 8 黄山 ahhs221 43.226.59.1 43.226.59.17 24 192.168.199.8 ahhs server.crt
10 9 亳州 ahbz228 43.226.59.1 43.226.59.18 24 192.168.199.9 ahbz server.crt
11 10 安庆 ahaq230 43.226.59.1 43.226.59.19 24 192.168.199.10 ahaq server.crt
12 11 淮北 ahhb223 43.226.59.1 43.226.59.20 24 192.168.199.11 ahhb server.crt
13 12 滁州 ahcz226 43.226.59.1 43.226.59.21 24 192.168.199.12 ahcz server.crt
14 13 芜湖 ahwh217 43.226.59.1 43.226.59.22 24 192.168.199.13 ahwh server.crt
15 14 六安 ahla220 43.226.59.1 43.226.59.23 24 192.168.199.14 ahla server.crt
16 15 蚌埠 ahbb229 43.226.59.1 43.226.59.24 24 192.168.199.15 ahbb server.crt
17 16 池州 ahchz227 43.226.59.1 43.226.59.25 24 192.168.199.16 ahchiz server.crt
18 17 营口 lnlyk196 43.226.59.1 43.226.59.26 24 192.168.199.17 lnyk server.crt
19 18 鞍山 lnas204 43.226.59.1 43.226.59.27 24 192.168.199.18 lnas server.crt
20 19 抚顺 lnfs201 43.226.59.1 43.226.59.28 24 192.168.199.19 lnfs server.crt
21 20 沈阳 lnsy198 43.226.59.1 43.226.59.29 24 192.168.199.20 lnsy server.crt
22 21 大连 lndl202 43.226.59.1 43.226.59.30 24 192.168.199.21 lndl server.crt
23 22 朝阳 lncy203 43.226.59.1 43.226.59.31 24 192.168.199.22 lnzy server.crt
24 23 盘锦 lnpj199 43.226.59.1 43.226.59.32 24 192.168.199.23 lnpj server.crt
25 24 葫芦岛 lnhld200 43.226.59.1 43.226.59.33 24 192.168.199.24 lnhld server.crt
26 25 铁岭 lntl197 43.226.59.1 43.226.59.34 24 192.168.199.25 lntl server.crt
27 26 攀枝花 scpzh148 43.226.59.1 43.226.59.35 24 192.168.199.26 scpzh server.crt
28 27 自贡 sczg146 43.226.59.1 43.226.59.36 24 192.168.199.27 sczg jg/36.crt
29 28 内江 scnj149 43.226.59.1 43.226.59.37 24 192.168.199.28 scnj server.crt
30 29 成都 sccd157 43.226.59.1 43.226.59.38 24 192.168.199.29 sccd server.crt
31 30 广元 scgy154 43.226.59.1 43.226.59.39 24 192.168.199.30 scgy server.crt
32 31 德阳 scdy155 43.226.59.1 43.226.59.40 24 192.168.199.31 scdy server.crt
33 32 泸州 sclz152 43.226.59.1 43.226.59.41 24 192.168.199.32 sclz server.crt
34 33 乐山 scls153 43.226.59.1 43.226.59.42 24 192.168.199.33 scls server.crt
35 34 绵阳 scmy151 43.226.59.1 43.226.59.43 24 192.168.199.34 scmy server.crt
36 35 达州 scdz156 43.226.59.1 43.226.59.44 24 192.168.199.35 scdz server.crt
37 36 南充 scnc150 43.226.59.1 43.226.59.45 24 192.168.199.36 scnc server.crt
38 37 宜宾 scyb147 43.226.59.1 43.226.59.46 24 192.168.199.37 scyb server.crt
39 38 保定 hbbd169 43.226.59.1 43.226.59.47 24 192.168.199.38 hbbd server.crt
40 39 张家口 hbzjk159 43.226.59.1 43.226.59.48 24 192.168.199.39 hbzjk server.crt
41 40 沧州 hbcz168 43.226.59.1 43.226.59.49 24 192.168.199.40 hbcz server.crt
42 41 秦皇岛 hbqhd163 43.226.59.1 43.226.59.50 24 192.168.199.41 hbqhd server.crt
43 42 邯郸 hbhd166 43.226.59.1 43.226.59.51 24 192.168.199.42 hbhd server.crt
44 43 唐山 hbts161 43.226.59.1 43.226.59.52 24 192.168.199.43 hbts server.crt
45 44 廊坊 hblf164 43.226.59.1 43.226.59.53 24 192.168.199.44 hblf server.crt
46 45 承德 hbcd167 43.226.59.1 43.226.59.54 24 192.168.199.45 hbcd server.crt
47 46 石家庄 hbsjz162 43.226.59.1 43.226.59.55 24 192.168.199.46 hbsjz server.crt
48 47 衡水 hbhs165 43.226.59.1 43.226.59.56 24 192.168.199.47 hbhshui server.crt
49 48 邢台 hbxt160 43.226.59.1 43.226.59.57 24 192.168.199.48 hbxt server.crt
50 49 台州 zjtz135 43.226.59.1 43.226.59.58 24 192.168.199.49 zjtz server.crt
51 50 嘉兴 zjjx141 43.226.59.1 43.226.59.59 24 192.168.199.50 zjjx server.crt
52 51 宁波 zjnb138 43.226.59.1 43.226.59.60 24 192.168.199.51 zjnb jg/60.crt
53 52 杭州 zjhz143 43.226.59.1 43.226.59.61 24 192.168.199.52 zjhz jg/61.crt
54 53 绍兴 zjsx136 43.226.59.1 43.226.59.62 24 192.168.199.53 zjsx jg/62.crt
55 54 丽水 zjls139 43.226.59.1 43.226.59.63 24 192.168.199.54 zjls jg/63.crt
56 55 温州 zjwz134 43.226.59.1 43.226.59.64 24 192.168.199.55 zjwz jg/64.crt
57 56 湖州 zjhz142 43.226.59.1 43.226.59.65 24 192.168.199.56 zjhuz jg/65.crt
58 57 舟山 zjzs133 43.226.59.1 43.226.59.66 24 192.168.199.57 zjzs jg/66.crt
59 58 衢州 zjqz137 43.226.59.1 43.226.59.67 24 192.168.199.58 zjqz jg/67.crt
60 59 金华 zjjh140 43.226.59.1 43.226.59.68 24 192.168.199.59 zjjh jg/68.crt
61 60 海口 hnhk172 43.226.59.1 43.226.59.69 24 192.168.199.60 hnhk jg/69.crt
62 61 文昌 hnwc170 43.226.59.1 43.226.59.70 24 192.168.199.61 hnwc jg/70.crt
63 62 三亚 hnsy171 43.226.59.1 43.226.59.71 24 192.168.199.62 hnsya jg/71.crt
64 63 上海 sh130 43.226.59.1 43.226.59.72 24 192.168.199.63 sh jg/72.crt
65 64 昆明 ynkm144 43.226.59.1 43.226.59.73 24 192.168.199.64 ynkm jg/73.crt
66 65 呼和浩特 nmghhht192 43.226.59.1 43.226.59.74 24 192.168.199.65 nmghhht jg/74.crt
67 66 赤峰 nmgcf194 43.226.59.1 43.226.59.75 24 192.168.199.66 nmgcf jg/75.crt
68 67 鄂尔多斯 nmgeeds193 43.226.59.1 43.226.59.76 24 192.168.199.67 nmgeeds jg/76.crt
69 68 通辽 nmgtl190 43.226.59.1 43.226.59.77 24 192.168.199.68 nmgtl jg/77.crt
70 69 包头 nmgbt195 43.226.59.1 43.226.59.78 24 192.168.199.69 nmgbt jg/78.crt
71 70 呼伦贝尔 nmghlbe191 43.226.59.1 43.226.59.79 24 192.168.199.70 nmghlbe jg/79.crt
72 71 南昌 jxnc210 43.226.59.1 43.226.59.80 24 192.168.199.71 jxnc jg/80.crt
73 72 鹰潭 jxyt205 43.226.59.1 43.226.59.81 24 192.168.199.72 jxyt jg/81.crt
74 73 抚州 jxfz215 43.226.59.1 43.226.59.82 24 192.168.199.73 jxfz jg/82.crt
75 74 新余 jxxy207 43.226.59.1 43.226.59.83 24 192.168.199.74 jxxy jg/83.crt
76 75 景德镇 jxjdz212 43.226.59.1 43.226.59.84 24 192.168.199.75 jxjdz jg/84.crt
77 76 萍乡 jxpx209 43.226.59.1 43.226.59.85 24 192.168.199.76 jxpx jg/85.crt
78 77 上饶 jxsr208 43.226.59.1 43.226.59.86 24 192.168.199.77 jxsr jg/86.crt
79 78 九江 jxjj211 43.226.59.1 43.226.59.87 24 192.168.199.78 jxjj jg/87.crt
80 79 吉安 jxja213 43.226.59.1 43.226.59.88 24 192.168.199.79 jxja jg/88.crt
81 80 宜春 jxyc206 43.226.59.1 43.226.59.89 24 192.168.199.80 jxyc jg/89.crt
82 81 赣州 jxgz214 43.226.59.1 43.226.59.90 24 192.168.199.81 jxgz jg/90.crt
83 82 德州 sddz187 43.226.59.1 43.226.59.91 24 192.168.199.82 sddz jg/91.crt
84 83 淄博 sdzb173 43.226.59.1 43.226.59.92 24 192.168.199.83 sdzb jg/92.crt
85 84 潍坊 sdwf176 43.226.59.1 43.226.59.93 24 192.168.199.84 sdwf jg/93.crt
86 85 烟台 sdyt175 43.226.59.1 43.226.59.94 24 192.168.199.85 sdyt jg/94.crt
87 86 菏泽 sdhz185 43.226.59.1 43.226.59.95 24 192.168.199.86 sdhz jg/95.crt
88 87 威海 sdwh177 43.226.59.1 43.226.59.96 24 192.168.199.87 sdwh jg/96.crt
89 88 枣庄 sdzz174 43.226.59.1 43.226.59.97 24 192.168.199.88 sdzz jg/97.crt
90 89 泰安 sdta178 43.226.59.1 43.226.59.98 24 192.168.199.89 sdta jg/98.crt
91 90 济宁 sdjn183 43.226.59.1 43.226.59.99 24 192.168.199.90 sdjin jg/99.crt
92 91 滨州 sdbz188 43.226.59.1 43.226.59.100 24 192.168.199.91 sdbz jg/100.crt
93 92 东营 sddy186 43.226.59.1 43.226.59.101 24 192.168.199.92 sddy jg/101.crt
94 93 日照 sdrz179 43.226.59.1 43.226.59.102 24 192.168.199.93 sdrz jg/102.crt
95 94 青岛 sdqd180 43.226.59.1 43.226.59.103 24 192.168.199.94 sdqd jg/103.crt
96 95 临沂 sdly181 43.226.59.1 43.226.59.104 24 192.168.199.95 sdly jg/104.crt
97 96 济南 sdjn184 43.226.59.1 43.226.59.105 24 192.168.199.96 sdjn jg/105.crt
98 97 聊城 sdlc182 43.226.59.1 43.226.59.106 24 192.168.199.97 sdlc jg/106.crt
99 98 商丘 hnsq151 43.226.59.1 43.226.59.107 24 192.168.199.98 hnsq server.crt
100 99 安阳 hnay158 43.226.59.1 43.226.59.108 24 192.168.199.99 hnay server.crt
101 100 开封 hnkf155 43.226.59.1 43.226.59.109 24 192.168.199.100 hnkf server.crt
102 101 新乡 hnxx150 43.226.59.1 43.226.59.110 24 192.168.199.101 hnxx server.crt
103 102 洛阳 hnly154 43.226.59.1 43.226.59.111 24 192.168.199.102 hnly server.crt
104 103 信阳 hnxy149 43.226.59.1 43.226.59.112 24 192.168.199.103 hnxy jg/112.crt
105 104 周口 hnzk146 43.226.59.1 43.226.59.113 24 192.168.199.104 hnzk jg/113.crt
106 105 漯河 hnlh153 43.226.59.1 43.226.59.114 24 192.168.199.105 hnlh server.crt
107 106 焦作 hnjz156 43.226.59.1 43.226.59.115 24 192.168.199.106 hnjz server.crt
108 107 驻马店 hnzmd145 43.226.59.1 43.226.59.116 24 192.168.199.107 hnzmd server.crt
109 108 鹤壁 hnhb157 43.226.59.1 43.226.59.117 24 192.168.199.108 hnhb server.crt
110 109 郑州 hnzz147 43.226.59.1 43.226.59.118 24 192.168.199.109 hnzz server.crt
111 110 南阳 hnny152 43.226.59.1 43.226.59.119 24 192.168.199.110 hnny jg/119.crt
112 111 许昌 hnxc148 43.226.59.1 43.226.59.120 24 192.168.199.111 hnxc server.crt
113 112 桂林 gxgl182 43.226.59.1 43.226.59.121 24 192.168.199.112 gxgl jg/121.crt
114 113 贵港 gxgg183 43.226.59.1 43.226.59.122 24 192.168.199.113 gxgg jg/122.crt
115 114 北海 gxbh184 43.226.59.1 43.226.59.123 24 192.168.199.114 gxbh jg/123.crt
116 115 南宁 gxnn180 43.226.59.1 43.226.59.124 24 192.168.199.115 gxnn jg/124.crt
117 116 柳州 gxlz181 43.226.59.1 43.226.59.125 24 192.168.199.116 gxlz jg/125.crt
118 117 钦州 gxqz179 43.226.59.1 43.226.59.126 24 192.168.199.117 gxqz jg/126.crt
119 118 玉林 gxyl178 43.226.59.1 43.226.59.127 24 192.168.199.118 gxyl jg/127.crt
120 119 银川 nxyc189 43.226.59.1 43.226.59.128 24 192.168.199.119 nxyc jg/128.crt
121 120 大同 sxdt172 43.226.59.1 43.226.59.129 24 192.168.199.120 sxdt jg/129.crt
122 121 晋城 sxjc171 43.226.59.1 43.226.59.130 24 192.168.199.121 sxjc jg/130.crt
123 122 长治 sxcz163 43.226.59.1 43.226.59.131 24 192.168.199.122 sxcz jg/131.crt
124 123 阳泉 sxyq165 43.226.59.1 43.226.59.132 24 192.168.199.123 sxyq jg/132.crt
125 124 临汾 sxlf170 43.226.59.1 43.226.59.133 24 192.168.199.124 sxlf jg/133.crt
126 125 吕梁 sxll169 43.226.59.1 43.226.59.134 24 192.168.199.125 sxll jg/134.crt
127 126 太原 sxty167 43.226.59.1 43.226.59.135 24 192.168.199.126 sxty jg/135.crt
128 127 忻州 sxxz166 43.226.59.1 43.226.59.136 24 192.168.199.127 sxxz jg/136.crt
129 128 朔州 sxsz168 43.226.59.1 43.226.59.137 24 192.168.199.128 sxsz jg/137.crt
130 129 运城 sxyc164 43.226.59.1 43.226.59.138 24 192.168.199.129 sxyc jg/138.crt
131 130 株洲 hnzz235 43.226.59.1 43.226.59.139 24 192.168.199.130 hnzhuz jg/139.crt
132 131 邵阳 hnsy239 43.226.59.1 43.226.59.140 24 192.168.199.131 hnsy jg/140.crt
133 132 郴州 hncz241 43.226.59.1 43.226.59.141 24 192.168.199.132 hncz server.crt
134 133 长沙 hncs236 43.226.59.1 43.226.59.142 24 192.168.199.133 hncs jg/142.crt
135 134 湘潭 hnxt238 43.226.59.1 43.226.59.143 24 192.168.199.134 hnxt jg/143.crt
136 135 衡阳 hnhy240 43.226.59.1 43.226.59.144 24 192.168.199.135 hnhy jg/144.crt
137 136 岳阳 hnyy237 43.226.59.1 43.226.59.145 24 192.168.199.136 hnyy jg/145.crt
138 137 三明 fjsm208 43.226.59.1 43.226.59.146 24 192.168.199.137 fjsming jg/146.crt
139 138 南平 fjnp212 43.226.59.1 43.226.59.147 24 192.168.199.138 fjnp jg/147.crt
140 139 厦门 fjxm207 43.226.59.1 43.226.59.148 24 192.168.199.139 fjsm jg/148.crt
141 140 龙岩 fjly213 43.226.59.1 43.226.59.149 24 192.168.199.140 fjly jg/149.crt
142 141 宁德 fjnd211 43.226.59.1 43.226.59.150 24 192.168.199.141 fjnd jg/150.crt
143 142 泉州 fjqz209 43.226.59.1 43.226.59.151 24 192.168.199.142 fjqz jg/151.crt
144 143 福州 fjfz214 43.226.59.1 43.226.59.152 24 192.168.199.143 fjfz jg/152.crt
145 144 莆田 fjpt210 43.226.59.1 43.226.59.153 24 192.168.199.144 fjpt jg/153.crt
146 145 六盘水 gzlps176 43.226.59.1 43.226.59.154 24 192.168.199.145 gzlps jg/154.crt
147 146 黔东南 gzqdn175 43.226.59.1 43.226.59.155 24 192.168.199.146 gzqdn jg/155.crt
148 147 贵阳 gzgy177 43.226.59.1 43.226.59.156 24 192.168.199.147 gzgy jg/156.crt
149 148 遵义 gzzy173 43.226.59.1 43.226.59.157 24 192.168.199.148 gzzy jg/157.crt
150 149 铜仁 gztr174 43.226.59.1 43.226.59.158 24 192.168.199.149 gztr jg/158.crt
151 150 渭南 sxwn160 43.226.59.1 43.226.59.159 24 192.168.199.150 sxwn jg/159.crt
152 151 宝鸡 sxbj162 43.226.59.1 43.226.59.160 24 192.168.199.151 sxbj jg/160.crt
153 152 西安 sxxa159 43.226.59.1 43.226.59.161 24 192.168.199.152 sxxa server.crt
154 153 铜川 sxtc161 43.226.59.1 43.226.59.162 24 192.168.199.153 sxtc server.crt
155 154 咸阳 sxxy158 43.226.59.1 43.226.59.163 24 192.168.199.154 sxxy server.crt
156 155 北京 bj129 43.226.59.1 43.226.59.164 24 192.168.199.155 bj jg/164.crt
157 156 天津 tj131 43.226.59.1 43.226.59.165 24 192.168.199.156 tj server.crt
158 157 南通 jsnt224 43.226.59.1 43.226.59.166 24 192.168.199.157 jsnt jg/166.crt
159 158 宿迁 jssq220 43.226.59.1 43.226.59.167 24 192.168.199.158 jssq jg/167.crt
160 159 常州 jscz228 43.226.59.1 43.226.59.168 24 192.168.199.159 jscz jg/168.crt
161 160 南京 jsnj225 43.226.59.1 43.226.59.169 24 192.168.199.160 jsnj jg/169.crt
162 161 泰州 jstz222 43.226.59.1 43.226.59.170 24 192.168.199.161 jstz jg/170.crt
163 162 淮安 jsha227 43.226.59.1 43.226.59.171 24 192.168.199.162 jsha server.crt
164 163 苏州 jssz223 43.226.59.1 43.226.59.172 24 192.168.199.163 jssz jg/172.crt
165 164 连云港 jslyg226 43.226.59.1 43.226.59.173 24 192.168.199.164 jslyg jg/173.crt
166 165 无锡 jswx221 43.226.59.1 43.226.59.174 24 192.168.199.165 jswx jg/174.crt
167 166 扬州 jsyz217 43.226.59.1 43.226.59.175 24 192.168.199.166 jsyz jg/175.crt
168 167 盐城 jsyc218 43.226.59.1 43.226.59.176 24 192.168.199.167 jsyc jg/176.crt
169 168 徐州 jsxz219 43.226.59.1 43.226.59.177 24 192.168.199.168 jsxz jg/177.crt
170 169 镇江 jszj216 43.226.59.1 43.226.59.178 24 192.168.199.169 jszj jg/178.crt
171 170 咸宁 hbxn245 43.226.59.1 43.226.59.179 24 192.168.199.170 hbxn server.crt
172 171 荆州 hbjz129 43.226.59.1 43.226.59.180 24 192.168.199.171 hbjz jg/180.crt
173 172 黄石 hbhs131 43.226.59.1 43.226.59.181 24 192.168.199.172 hbhs jg/181.crt
174 173 武汉 hbwh246 43.226.59.1 43.226.59.182 24 192.168.199.173 hbwh server.crt
175 174 荆门 hbjm130 43.226.59.1 43.226.59.183 24 192.168.199.174 hbjm jg/183.crt
176 175 孝感 hbxg243 43.226.59.1 43.226.59.184 24 192.168.199.175 hbxg server.crt
177 176 宜昌 hbyc242 43.226.59.1 43.226.59.185 24 192.168.199.176 hbyc server.crt
178 177 襄阳 hbxy244 43.226.59.1 43.226.59.186 24 192.168.199.177 hbxy jg/186.crt
179 178 黄冈 hbhg132 43.226.59.1 43.226.59.187 24 192.168.199.178 hbhg jg/187.crt
180 179 重庆 cq132 43.226.59.1 43.226.59.188 24 192.168.199.179 cq jg/188.crt
181 180 白山 jlbs234 43.226.59.1 43.226.59.189 24 192.168.199.180 jlbs jg/189.crt
182 181 通化 jlth231 43.226.59.1 43.226.59.190 24 192.168.199.181 jlth jg/190.crt
183 182 松原 jlsy232 43.226.59.1 43.226.59.191 24 192.168.199.182 jlsy jg/191.crt
184 183 长春 jlcc229 43.226.59.1 43.226.59.192 24 192.168.199.183 jlcc jg/192.crt
185 184 四平 jlsp233 43.226.59.1 43.226.59.193 24 192.168.199.184 jlsp jg/193.crt
186 185 延边 jlyb230 43.226.59.1 43.226.59.194 24 192.168.199.185 jlyb jg/194.crt
187 186 广州 gdgz202 43.226.59.1 43.226.59.195 24 192.168.199.186 gdgz jg/195.crt
188 187 惠州 gdhz200 43.226.59.1 43.226.59.196 24 192.168.199.187 gdhz jg/196.crt
189 188 深圳 gdsz191 43.226.59.1 43.226.59.197 24 192.168.199.188 gdsz jg/197.crt
190 189 珠海 gdzh185 43.226.59.1 43.226.59.198 24 192.168.199.189 gdzh jg/198.crt
191 190 茂名 gdmm197 43.226.59.1 43.226.59.199 24 192.168.199.190 gdmm jg/199.crt
192 191 阳江 gdyj190 43.226.59.1 43.226.59.200 24 192.168.199.191 gdyj jg/200.crt
193 192 中山 gdzs186 43.226.59.1 43.226.59.201 24 192.168.199.192 gdzs jg/201.crt
194 193 云浮 gdyf189 43.226.59.1 43.226.59.202 24 192.168.199.193 gdyf jg/202.crt
195 194 揭阳 gdjy198 43.226.59.1 43.226.59.203 24 192.168.199.194 gdjy jg/203.crt
196 195 汕头 gdst194 43.226.59.1 43.226.59.204 24 192.168.199.195 gdst jg/204.crt
197 196 韶关 gdsg192 43.226.59.1 43.226.59.205 24 192.168.199.196 gdsg jg/205.crt
198 197 潮州 gdcz205 43.226.59.1 43.226.59.206 24 192.168.199.197 gdcz jg/206.crt
199 198 佛山 gdfs203 43.226.59.1 43.226.59.207 24 192.168.199.198 gdfs jg/207.crt
200 199 汕尾 gdsw193 43.226.59.1 43.226.59.208 24 192.168.199.199 gdsw jg/208.crt
201 200 江门 gdjm199 43.226.59.1 43.226.59.209 24 192.168.199.200 gdjm jg/209.crt
202 201 河源 gdhy201 43.226.59.1 43.226.59.210 24 192.168.199.201 gdhy jg/210.crt
203 202 清远 gdqy195 43.226.59.1 43.226.59.211 24 192.168.199.202 gdqy jg/211.crt
204 203 湛江 gdzj188 43.226.59.1 43.226.59.212 24 192.168.199.203 gdzj jg/212.crt
205 204 东莞 gddg204 43.226.59.1 43.226.59.213 24 192.168.199.204 gddg jg/213.crt
206 205 梅州 gdmz196 43.226.59.1 43.226.59.214 24 192.168.199.205 gdmz jg/214.crt
207 206 肇庆 gdzq187 43.226.59.1 43.226.59.215 24 192.168.199.206 gdzq jg/215.crt
208 207 乌鲁木齐 xjwlmq145 43.226.59.1 43.226.59.216 24 192.168.199.207 xjwlmq jg/216.crt
209 208 兰州 gslz206 43.226.59.1 43.226.59.217 24 192.168.199.208 gslz jg/217.crt
210 209 七台河 hljqth137 43.226.59.1 43.226.59.218 24 192.168.199.209 hljqth jg/218.crt
211 210 牡丹江 hljmdj138 43.226.59.1 43.226.59.219 24 192.168.199.210 hljmdj jg/219.crt
212 211 绥化 hljsh134 43.226.59.1 43.226.59.220 24 192.168.199.211 hljsh jg/220.crt
213 212 鹤岗 hljhg142 43.226.59.1 43.226.59.221 24 192.168.199.212 hljhg jg/221.crt
214 213 双鸭山 hljsys135 43.226.59.1 43.226.59.222 24 192.168.199.213 hljsys jg/222.crt
215 214 大庆 hljdq144 43.226.59.1 43.226.59.223 24 192.168.199.214 hljdq server.crt
216 215 佳木斯 hljjms139 43.226.59.1 43.226.59.224 24 192.168.199.215 hljjms jg/224.crt
217 216 鸡西 hljjx140 43.226.59.1 43.226.59.225 24 192.168.199.216 hljjx jg/225.crt
218 217 伊春 hljyc133 43.226.59.1 43.226.59.226 24 192.168.199.217 hljyc jg/226.crt
219 218 哈尔滨 hljheb143 43.226.59.1 43.226.59.227 24 192.168.199.218 hljheb jg/227.crt
220 219 黑河 hljhh141 43.226.59.1 43.226.59.228 24 192.168.199.219 hljhhe jg/228.crt
221 220 齐齐哈尔 hljqqhe136 43.226.59.1 43.226.59.229 24 192.168.199.220 hljqqhe jg/229.crt

View File

@@ -27,7 +27,7 @@
24,葫芦岛,lnhld200,43.226.58.1,43.226.58.33,24,192.168.99.24,lnhld,server.crt 24,葫芦岛,lnhld200,43.226.58.1,43.226.58.33,24,192.168.99.24,lnhld,server.crt
25,铁岭,lntl197,43.226.58.1,43.226.58.34,24,192.168.99.25,lntl,server.crt 25,铁岭,lntl197,43.226.58.1,43.226.58.34,24,192.168.99.25,lntl,server.crt
26,攀枝花,scpzh148,43.226.58.1,43.226.58.35,24,192.168.99.26,scpzh,server.crt 26,攀枝花,scpzh148,43.226.58.1,43.226.58.35,24,192.168.99.26,scpzh,server.crt
27,自贡,sczg146,43.226.58.1,43.226.58.36,24,192.168.99.27,sczg,server.crt 27,自贡,sczg146,43.226.58.1,43.226.58.36,24,192.168.99.27,sczg,server.36.crt
28,内江,scnj149,43.226.58.1,43.226.58.37,24,192.168.99.28,scnj,server.crt 28,内江,scnj149,43.226.58.1,43.226.58.37,24,192.168.99.28,scnj,server.crt
29,成都,sccd157,43.226.58.1,43.226.58.38,24,192.168.99.29,sccd,server.crt 29,成都,sccd157,43.226.58.1,43.226.58.38,24,192.168.99.29,sccd,server.crt
30,广元,scgy154,43.226.58.1,43.226.58.39,24,192.168.99.30,scgy,server.crt 30,广元,scgy154,43.226.58.1,43.226.58.39,24,192.168.99.30,scgy,server.crt
@@ -39,7 +39,7 @@
36,南充,scnc150,43.226.58.1,43.226.58.45,24,192.168.99.36,scnc,server.crt 36,南充,scnc150,43.226.58.1,43.226.58.45,24,192.168.99.36,scnc,server.crt
37,宜宾,scyb147,43.226.58.1,43.226.58.46,24,192.168.99.37,scyb,server.crt 37,宜宾,scyb147,43.226.58.1,43.226.58.46,24,192.168.99.37,scyb,server.crt
38,保定,hbbd169,43.226.58.1,43.226.58.47,24,192.168.99.38,hbbd,server.crt 38,保定,hbbd169,43.226.58.1,43.226.58.47,24,192.168.99.38,hbbd,server.crt
39,张家口,hbzjk159,43.226.58.1,43.226.58.48,24,192.168.99.39,hbzjk,server.crt 39,张家口,hbzjk159,43.226.58.1,43.226.58.48,24,192.168.99.39,hbzjk,server.48.crt
40,沧州,hbcz168,43.226.58.1,43.226.58.49,24,192.168.99.40,hbcz,server.crt 40,沧州,hbcz168,43.226.58.1,43.226.58.49,24,192.168.99.40,hbcz,server.crt
41,秦皇岛,hbqhd163,43.226.58.1,43.226.58.50,24,192.168.99.41,hbqhd,server.crt 41,秦皇岛,hbqhd163,43.226.58.1,43.226.58.50,24,192.168.99.41,hbqhd,server.crt
42,邯郸,hbhd166,43.226.58.1,43.226.58.51,24,192.168.99.42,hbhd,server.crt 42,邯郸,hbhd166,43.226.58.1,43.226.58.51,24,192.168.99.42,hbhd,server.crt
1 index name code gateway public mask private domain cert
27 24 葫芦岛 lnhld200 43.226.58.1 43.226.58.33 24 192.168.99.24 lnhld server.crt
28 25 铁岭 lntl197 43.226.58.1 43.226.58.34 24 192.168.99.25 lntl server.crt
29 26 攀枝花 scpzh148 43.226.58.1 43.226.58.35 24 192.168.99.26 scpzh server.crt
30 27 自贡 sczg146 43.226.58.1 43.226.58.36 24 192.168.99.27 sczg server.crt server.36.crt
31 28 内江 scnj149 43.226.58.1 43.226.58.37 24 192.168.99.28 scnj server.crt
32 29 成都 sccd157 43.226.58.1 43.226.58.38 24 192.168.99.29 sccd server.crt
33 30 广元 scgy154 43.226.58.1 43.226.58.39 24 192.168.99.30 scgy server.crt
39 36 南充 scnc150 43.226.58.1 43.226.58.45 24 192.168.99.36 scnc server.crt
40 37 宜宾 scyb147 43.226.58.1 43.226.58.46 24 192.168.99.37 scyb server.crt
41 38 保定 hbbd169 43.226.58.1 43.226.58.47 24 192.168.99.38 hbbd server.crt
42 39 张家口 hbzjk159 43.226.58.1 43.226.58.48 24 192.168.99.39 hbzjk server.crt server.48.crt
43 40 沧州 hbcz168 43.226.58.1 43.226.58.49 24 192.168.99.40 hbcz server.crt
44 41 秦皇岛 hbqhd163 43.226.58.1 43.226.58.50 24 192.168.99.41 hbqhd server.crt
45 42 邯郸 hbhd166 43.226.58.1 43.226.58.51 24 192.168.99.42 hbhd server.crt

12
main.py
View File

@@ -8,7 +8,9 @@ from steps import *
''' '''
自动配置 ros 脚本,需要安装 librouteros 库: 自动配置 ros 脚本,需要安装 librouteros 库:
```
pip install librouteros pip install librouteros
```
配置文件格式为 CSV包含以下字段 配置文件格式为 CSV包含以下字段
@@ -20,9 +22,9 @@ pip install librouteros
- mask: 公网子网掩码 - mask: 公网子网掩码
- private: 内网 IP - private: 内网 IP
如果需要添加或修改配置项,在编辑前记得先备份 config.csv 文件 如果需要添加或修改配置项,从 config.*.bak.csv 文件复制配置项到 config.csv 文件
如果需要修改配置内容,在 start 函数里 “配置 ros” 部分添加或修改函数调用 如果需要修改配置内容,在下面 “配置执行步骤” 部分添加或修改函数调用
''' '''
threads = [] threads = []
@@ -30,11 +32,7 @@ failed = []
# 配置执行步骤 # 配置执行步骤
steps = [ steps = [
configNet, configNet
configOutsMix,
configScripts,
configLogs,
configDrop
] ]

741
steps.py
View File

@@ -1,371 +1,466 @@
import re import re
from librouteros import connect,Api from librouteros import Api
def configDefault(conn:Api,config):
configNet(conn, config)
configOuts(conn, config)
configScripts(conn, config)
'''
配置步骤,每个步骤都可以安全幂等执行,配置混合节点的出口的函数可能会很慢,因为出口比较多
'''
def configNet(conn:Api,config): def configNet(conn:Api,config):
''' '''
配置网络 配置网络
''' '''
# 配置路由 try:
routes = conn.path('ip', 'route') # 配置路由
for route in routes: routes = conn.path('ip', 'route')
if route['routing-table'] == '1': for route in routes:
try: if route['routing-table'] == '1':
routes.update(**{ try:
'.id': route['.id'], routes.update(**{
'gateway': config['gateway'] '.id': route['.id'],
}) 'gateway': config['gateway']
except Exception as e: })
print('更新默认路由失败: {}'.format(e)) except Exception as e:
continue print('更新默认路由失败: {}'.format(e))
continue
# 配置地址 # 配置地址
addrs = conn.path('ip', 'address') addrs = conn.path('ip', 'address')
for addr in addrs: for addr in addrs:
if addr['interface'] == 'lan': if addr['interface'] == 'lan':
try: try:
addrs.update(**{ addrs.update(**{
'.id': addr['.id'], '.id': addr['.id'],
'address': config['private'] 'address': config['private']
}) })
except Exception as e: except Exception as e:
print('更新 WAN 地址失败: {}'.format(e)) print('更新 WAN 地址失败: {}'.format(e))
continue continue
# 刷新 mac 地址 # 刷新 mac 地址
eths = conn.path('interface', 'ethernet') eths = conn.path('interface', 'ethernet')
for eth in eths: for eth in eths:
if eth['name'] == 'lan': if eth['name'] == 'lan':
tuple(eths('reset-mac-address', **{ tuple(eths('reset-mac-address', **{
'.id': eth['.id'] '.id': eth['.id']
})) }))
except Exception as e:
raise RuntimeError(f'配置网络失败: {e}')
def configOuts(conn:Api,config): # ====================
# 极狐配置
# ====================
def configJhOuts(conn:Api,config):
''' '''
配置 vpn 出口负载均衡 配置 vpn 出口负载均衡
''' '''
count = 20
# 配置 ppp try:
ppps = conn.path('interface', 'l2tp-client') count = 20
# 删除旧的 ppp # 配置 ppp
for ppp in ppps: ppps = conn.path('interface', 'l2tp-client')
if ppp['name'].startswith('l2tp-out'):
try:
ppps.remove(ppp['.id'])
except Exception as e:
print('删除 PPP 失败: {}'.format(e))
continue
# 添加新的 ppp # 删除旧的 ppp
for i in range(1, count+1): for ppp in ppps:
ppps.add(**{ if ppp['name'].startswith('l2tp-out'):
'name':'l2tp-out{}'.format(i), try:
'connect-to':'192.168.25{}.25{}'.format((i-1)%3+1, (i-1)%3+1), ppps.remove(ppp['.id'])
'user':'jdzz{}dt{}'.format(i, config['index']), except Exception as e:
'password':'123231', print('删除 PPP 失败: {}'.format(e))
'disabled':'no', continue
})
# 配置路由
routes = conn.path('ip', 'route')
# 删除旧的路由表
for route in routes:
if str(route['routing-table']).startswith('r'):
try:
routes.remove(route['.id'])
except Exception as e:
print('删除路由表失败: {}'.format(e))
continue
# 添加新的路由表
for i in range(1,count+1):
routeName = 'r{}'.format(i)
routeOut = 'l2tp-out{}'.format(i)
try:
routes.add(**{
'dst-address': '0.0.0.0/0',
'gateway': routeOut,
'routing-table': routeName,
})
except Exception as e:
print('添加路由表失败: {}'.format(e))
continue
def configOutsMix(conn:Api,config):
ppps = conn.path('interface', 'l2tp-client')
for ppp in ppps:
if ppp['name'].startswith('l2tp-out'):
try:
ppps.remove(ppp['.id'])
except Exception as e:
print('删除 PPP 失败: {}'.format(e))
continue
for i in range(30):
for j in range(10):
n = j*30 + i
k = n%3 + 1
# 添加新的 ppp
for i in range(1, count+1):
ppps.add(**{ ppps.add(**{
'name':f'l2tp-out{n+1}', 'name':'l2tp-out{}'.format(i),
'connect-to':f'192.168.25{k}.25{k}', 'connect-to':'192.168.25{}.25{}'.format((i-1)%3+1, (i-1)%3+1),
'user':f'jdzz{j+11}dt{i+221}', 'user':'jdzz{}dt{}'.format(i, config['index']),
'password':'123231', 'password':'123231',
'disabled':'no', 'disabled':'no',
}) })
routes = conn.path('ip', 'route')
for route in routes: # 配置路由
if str(route['routing-table']).startswith('r'): routes = conn.path('ip', 'route')
# 删除旧的路由表
for route in routes:
if str(route['routing-table']).startswith('r'):
try:
routes.remove(route['.id'])
except Exception as e:
print('删除路由表失败: {}'.format(e))
continue
# 添加新的路由表
for i in range(1,count+1):
routeName = 'r{}'.format(i)
routeOut = 'l2tp-out{}'.format(i)
try: try:
routes.remove(route['.id']) routes.add(**{
'dst-address': '0.0.0.0/0',
'gateway': routeOut,
'routing-table': routeName,
})
except Exception as e: except Exception as e:
print('删除路由表失败: {}'.format(e)) print('添加路由表失败: {}'.format(e))
continue continue
except Exception as e:
raise RuntimeError(f'配置出口失败: {e}')
for i in range(300): def configJhMixOuts(conn:Api,config):
routeName = f'r{i+1}' '''
routeOut = f'l2tp-out{i+1}' 配置 vpn 出口负载均衡 (混合模式)
try: '''
routes.add(**{
'dst-address': '0.0.0.0/0',
'gateway': routeOut,
'routing-table': routeName,
})
except Exception as e:
print('添加路由表失败: {}'.format(e))
continue
try:
ppps = conn.path('interface', 'l2tp-client')
for ppp in ppps:
if ppp['name'].startswith('l2tp-out'):
try:
ppps.remove(ppp['.id'])
except Exception as e:
print('删除 PPP 失败: {}'.format(e))
continue
def configScripts(conn:Api,config): for i in range(30):
for j in range(10):
n = j*30 + i
k = n%3 + 1
ppps.add(**{
'name':f'l2tp-out{n+1}',
'connect-to':f'192.168.25{k}.25{k}',
'user':f'jdzz{j+11}dt{i+221}',
'password':'123231',
'disabled':'no',
})
routes = conn.path('ip', 'route')
for route in routes:
if str(route['routing-table']).startswith('r'):
try:
routes.remove(route['.id'])
except Exception as e:
print('删除路由表失败: {}'.format(e))
continue
for i in range(300):
routeName = f'r{i+1}'
routeOut = f'l2tp-out{i+1}'
try:
routes.add(**{
'dst-address': '0.0.0.0/0',
'gateway': routeOut,
'routing-table': routeName,
})
except Exception as e:
print('添加路由表失败: {}'.format(e))
continue
except Exception as e:
raise RuntimeError(f'配置出口失败: {e}')
def configJhScripts(conn:Api,config):
''' '''
配置脚本 配置脚本
''' '''
# 配置脚本 try:
scripts = conn.path('system', 'script') # 配置脚本
for script in scripts: scripts = conn.path('system', 'script')
if script['name'] == 'up': for script in scripts:
with open('scripts/up.rsc', 'rb') as file: if script['name'] == 'up':
upScript = str(file.read(), encoding='utf-8') with open('scripts/up.rsc', 'rb') as file:
scripts.update(**{ upScript = str(file.read(), encoding='utf-8')
'.id': script['.id'], scripts.update(**{
'source': upScript '.id': script['.id'],
}) 'source': upScript
elif script['name'] == 'down': })
with open('scripts/down.rsc', 'rb') as file: elif script['name'] == 'down':
downScript = str(file.read(), encoding='utf-8') with open('scripts/down.rsc', 'rb') as file:
scripts.update(**{ downScript = str(file.read(), encoding='utf-8')
'.id': script['.id'], scripts.update(**{
'source': downScript '.id': script['.id'],
}) 'source': downScript
elif script['name'] == 'onlinestatus': })
with open('scripts/onlinestatus.rsc', 'rb') as file: elif script['name'] == 'onlinestatus':
onlineStatusScript = str(file.read(), encoding='utf-8') with open('scripts/onlinestatus.rsc', 'rb') as file:
scripts.update(**{ onlineStatusScript = str(file.read(), encoding='utf-8')
'.id': script['.id'], scripts.update(**{
'source': onlineStatusScript.replace('<IP>', config['public']) '.id': script['.id'],
}) 'source': onlineStatusScript.replace('<IP>', config['public'])
elif script['name'] == 'pppoestatus': })
with open('scripts/pppoestatus.rsc', 'rb') as file: elif script['name'] == 'pppoestatus':
pppoeStatusScript = str(file.read(), encoding='utf-8') with open('scripts/pppoestatus.rsc', 'rb') as file:
scripts.update(**{ pppoeStatusScript = str(file.read(), encoding='utf-8')
'.id': script['.id'], scripts.update(**{
'source': pppoeStatusScript.replace('<IP>', config['public']) '.id': script['.id'],
}) 'source': pppoeStatusScript.replace('<IP>', config['public'])
})
# todo 配置计划任务 # todo 配置计划任务
def configLogs(conn:Api,config): except Exception as e:
raise RuntimeError(f'配置脚本失败: {e}')
def configJhLogs(conn:Api,config):
''' '''
配置日志处理 配置日志处理
''' '''
# 添加日志过滤器 try:
filters = conn.path('ip', 'firewall', 'filter') # 添加日志过滤器
for filter in filters: filters = conn.path('ip', 'firewall', 'filter')
if filter['comment'] == 'natlog': for filter in filters:
try: if filter['comment'] == 'natlog':
filters.remove(filter['.id']) try:
except Exception as e: filters.remove(filter['.id'])
print('删除过滤器失败: {}'.format(e)) except Exception as e:
continue print('删除过滤器失败: {}'.format(e))
continue
filters.add(**{ filters.add(**{
'chain': 'forward', 'chain': 'forward',
'action': 'log', 'action': 'log',
'comment': 'natlog', 'comment': 'natlog',
'dst-address': '10.0.0.0/8', 'dst-address': '10.0.0.0/8',
'protocol': 'tcp', 'protocol': 'tcp',
'connection-nat-state': 'srcnat', 'connection-nat-state': 'srcnat',
'tcp-flags': 'syn', 'tcp-flags': 'syn',
})
filters.add(**{
'chain': 'forward',
'action': 'log',
'comment': 'natlog',
'src-address': '10.0.0.0/8',
'protocol': 'udp',
'dst-port': '!53',
'connection-nat-state': '!srcnat',
})
# 添加日志动作
actions = conn.path('system', 'logging', 'action')
for action in actions:
if action['name'] in ['logremote', 'logremoteidc']:
try:
actions.remove(action['.id'])
except Exception as e:
print('删除日志动作失败: {}'.format(e))
continue
actions.add(**{
'name': 'logremote',
'target': 'remote',
'src-address': '0.0.0.0',
'remote': '106.119.167.38',
'remote-port': '5775',
})
actions.add(**{
'name': 'logremoteidc',
'target': 'remote',
'src-address': '0.0.0.0',
'remote': '192.168.100.255',
'remote-port': '5775',
})
# 配置日志动作
logs = conn.path('system', 'logging')
for log in logs:
if 'firewall' in log['topics'] and 'info' in log['topics']:
try:
logs.remove(log['.id'])
except Exception as e:
print('删除日志配置失败: {}'.format(e))
continue
logs.add(**{
'topics': 'firewall,info',
'prefix': config['code'],
'action': 'logremote',
})
logs.add(**{
'topics': 'firewall,info',
'prefix': config['code'],
'action': 'logremoteidc',
})
def configDrop(conn:Api, config):
'''
添加丢弃规则
'''
domains = [
'kasut.org',
'chigua41.xyz',
'chigua35.info',
'chigua32.life',
'iufsvayufgiwlj6ok.com',
'kaixr.top',
'qiopqc.cn',
'lsdhgsduyccnja18.com',
'tongyan01.club',
'nenmei37.club',
'69lesbi.com',
'ero-labs.cool',
'soxue100.com',
'24news.world',
'aaa215.click',
'qqqqqdfggjkgfgfhe.cc',
'lovefootjob.com',
'hadesex.com',
]
ips = [
'23.231.144.26',
'23.231.183.17',
'23.231.182.57',
'23.231.182.56',
'154.92.94.91',
'154.92.94.163',
'192.250.241.167',
'192.250.192.242',
]
# 非法网站列表
layer7 = conn.path('ip', 'firewall', 'layer7-protocol')
for item in layer7:
if item['name'] == 'illegal':
try:
layer7.remove(item['.id'])
except Exception as e:
print('删除 Layer7 规则失败: {}'.format(e))
continue
layer7.add(**{
'name': 'illegal',
'regexp': f'({"|".join([re.escape(domain) for domain in domains])})[/:]?.*',
})
# 非法 IP 列表
addressLists = conn.path('ip', 'firewall', 'address-list')
for item in addressLists:
if item['list'] == 'illegal':
try:
ips.remove(item['address'])
except Exception as e:
continue
for ip in ips:
addressLists.add(**{
'list': 'illegal',
'address': ip,
}) })
# 添加丢弃规则 filters.add(**{
filters = conn.path('ip', 'firewall', 'filter') 'chain': 'forward',
'action': 'log',
'comment': 'natlog',
'src-address': '10.0.0.0/8',
'protocol': 'udp',
'dst-port': '!53',
'connection-nat-state': '!srcnat',
})
for item in filters: # 添加日志动作
if item['comment'] == 'drop illegal websites': actions = conn.path('system', 'logging', 'action')
for action in actions:
if action['name'] in ['logremote', 'logremoteidc']:
try:
actions.remove(action['.id'])
except Exception as e:
print('删除日志动作失败: {}'.format(e))
continue
actions.add(**{
'name': 'logremote',
'target': 'remote',
'src-address': '0.0.0.0',
'remote': '106.119.167.38',
'remote-port': '5775',
})
actions.add(**{
'name': 'logremoteidc',
'target': 'remote',
'src-address': '0.0.0.0',
'remote': '192.168.100.255',
'remote-port': '5775',
})
# 配置日志动作
logs = conn.path('system', 'logging')
for log in logs:
if 'firewall' in log['topics'] and 'info' in log['topics']:
try:
logs.remove(log['.id'])
except Exception as e:
print('删除日志配置失败: {}'.format(e))
continue
logs.add(**{
'topics': 'firewall,info',
'prefix': config['code'],
'action': 'logremote',
})
logs.add(**{
'topics': 'firewall,info',
'prefix': config['code'],
'action': 'logremoteidc',
})
except Exception as e:
raise RuntimeError(f'配置日志处理失败: {e}')
def configJhDrop(conn:Api, config):
'''
配置丢弃规则
'''
try:
domains = [
'kasut.org',
'chigua41.xyz',
'chigua35.info',
'chigua32.life',
'iufsvayufgiwlj6ok.com',
'kaixr.top',
'qiopqc.cn',
'lsdhgsduyccnja18.com',
'tongyan01.club',
'nenmei37.club',
'69lesbi.com',
'ero-labs.cool',
'soxue100.com',
'24news.world',
'aaa215.click',
'qqqqqdfggjkgfgfhe.cc',
'lovefootjob.com',
'hadesex.com',
]
ips = [
'23.231.144.26',
'23.231.183.17',
'23.231.182.57',
'23.231.182.56',
'154.92.94.91',
'154.92.94.163',
'192.250.241.167',
'192.250.192.242',
]
# 非法网站列表
layer7 = conn.path('ip', 'firewall', 'layer7-protocol')
for item in layer7:
if item['name'] == 'illegal':
try:
layer7.remove(item['.id'])
except Exception as e:
print('删除 Layer7 规则失败: {}'.format(e))
continue
layer7.add(**{
'name': 'illegal',
'regexp': f'({"|".join([re.escape(domain) for domain in domains])})[/:]?.*',
})
# 非法 IP 列表
addressLists = conn.path('ip', 'firewall', 'address-list')
for item in addressLists:
if item['list'] == 'illegal':
try:
ips.remove(item['address'])
except Exception as e:
continue
for ip in ips:
addressLists.add(**{
'list': 'illegal',
'address': ip,
})
# 添加丢弃规则
filters = conn.path('ip', 'firewall', 'filter')
for item in filters:
if item['comment'] == 'drop illegal websites':
try:
filters.remove(item['.id'])
except Exception as e:
print('删除过滤器失败: {}'.format(e))
continue
elif item['comment'] == 'drop illegal ips':
try:
filters.remove(item['.id'])
except Exception as e:
print('删除过滤器失败: {}'.format(e))
continue
filters.add(**{
'chain': 'forward',
'action': 'drop',
'layer7-protocol': 'illegal',
'comment': 'drop illegal websites',
})
filters.add(**{
'chain': 'forward',
'action': 'drop',
'src-address-list': 'illegal',
'comment': 'drop illegal ips',
})
except Exception as e:
raise RuntimeError(f'配置丢弃规则失败: {e}')
# ====================
# 极光配置
# ====================
def configJgOuts(conn:Api,config):
'''
配置 vpn 出口负载均衡
'''
try:
count = 20
# 配置 ppp
ppps = conn.path('interface', 'l2tp-client')
# 删除旧的 ppp
for ppp in ppps:
if ppp['name'].startswith('l2tp-out'):
try:
ppps.remove(ppp['.id'])
except Exception as e:
print('删除 PPP 失败: {}'.format(e))
continue
# 添加新的 ppp
for i in range(1, count+1):
ppps.add(**{
'name':'l2tp-out{}'.format(i),
'connect-to':'192.168.25{}.25{}'.format((i-1)%3+1, (i-1)%3+1),
'user':'jdzz{}dt{}'.format(i, config['index']),
'password':'123231',
'disabled':'no',
})
# 配置路由
routes = conn.path('ip', 'route')
# 删除旧的路由表
for route in routes:
if str(route['routing-table']).startswith('r'):
try:
routes.remove(route['.id'])
except Exception as e:
print('删除路由表失败: {}'.format(e))
continue
# 添加新的路由表
for i in range(1,count+1):
routeName = 'r{}'.format(i)
routeOut = 'l2tp-out{}'.format(i)
try: try:
filters.remove(item['.id']) routes.add(**{
'dst-address': '0.0.0.0/0',
'gateway': routeOut,
'routing-table': routeName,
})
except Exception as e: except Exception as e:
print('删除过滤器失败: {}'.format(e)) print('添加路由表失败: {}'.format(e))
continue
elif item['comment'] == 'drop illegal ips':
try:
filters.remove(item['.id'])
except Exception as e:
print('删除过滤器失败: {}'.format(e))
continue continue
except Exception as e:
raise RuntimeError(f'配置出口失败: {e}')
filters.add(**{ # ====================
'chain': 'forward', # 临时
'action': 'drop', # ====================
'layer7-protocol': 'illegal',
'comment': 'drop illegal websites',
})
filters.add(**{ def temp(conn:Api,config):
'chain': 'forward', ppps = conn.path('interface', 'l2tp-client')
'action': 'drop',
'src-address-list': 'illegal',
'comment': 'drop illegal ips',
})