-
Notifications
You must be signed in to change notification settings - Fork 0
/
import-zones.sh
865 lines (685 loc) · 31 KB
/
import-zones.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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
#!/bin/sh
# Flush existing IPv4 rules
/sbin/ipset flush blocked-countries-ipv4
# China IPv4
for ZONE in $(wget --quiet -O - https://www.ipdeny.com/ipblocks/data/aggregated/cn-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv4 "$ZONE"
done
# Russia IPv4
for ZONE in $(wget --quiet -O - https://www.ipdeny.com/ipblocks/data/aggregated/ru-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv4 "$ZONE"
done
# AFGHANISTAN IPv4
for ZONE in $(wget --quiet -O - https://www.ipdeny.com/ipblocks/data/aggregated/af-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv4 "$ZONE"
done
# ALBANIA IPv4
for ZONE in $(wget --quiet -O - https://www.ipdeny.com/ipblocks/data/aggregated/al-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv4 "$ZONE"
done
# ALGERIA IPv4
for ZONE in $(wget --quiet -O - https://www.ipdeny.com/ipblocks/data/aggregated/dz-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv4 "$ZONE"
done
# ANDORRA IPv4
for ZONE in $(wget --quiet -O - https://www.ipdeny.com/ipblocks/data/aggregated/ad-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv4 "$ZONE"
done
# ANGOLA IPv4
for ZONE in $(wget --quiet -O - https://www.ipdeny.com/ipblocks/data/aggregated/ao-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv4 "$ZONE"
done
# ARMENIA IPv4
for ZONE in $(wget --quiet -O - https://www.ipdeny.com/ipblocks/data/aggregated/am-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv4 "$ZONE"
done
# AUSTRALIA IPv4
for ZONE in $(wget --quiet -O - https://www.ipdeny.com/ipblocks/data/aggregated/au-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv4 "$ZONE"
done
# AZERBAIJAN IPv4
for ZONE in $(wget --quiet -O - https://www.ipdeny.com/ipblocks/data/aggregated/az-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv4 "$ZONE"
done
# BANGLADESH IPv4
for ZONE in $(wget --quiet -O - https://www.ipdeny.com/ipblocks/data/aggregated/bd-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv4 "$ZONE"
done
# BELARUS IPv4
for ZONE in $(wget --quiet -O - https://www.ipdeny.com/ipblocks/data/aggregated/by-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv4 "$ZONE"
done
# BRAZIL IPv4
for ZONE in $(wget --quiet -O - https://www.ipdeny.com/ipblocks/data/aggregated/br-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv4 "$ZONE"
done
# BULGARIA IPv4
for ZONE in $(wget --quiet -O - https://www.ipdeny.com/ipblocks/data/aggregated/bg-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv4 "$ZONE"
done
# CAMBODIA IPv4
for ZONE in $(wget --quiet -O - https://www.ipdeny.com/ipblocks/data/aggregated/kh-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv4 "$ZONE"
done
# CAYMAN ISLANDS IPv4
for ZONE in $(wget --quiet -O - https://www.ipdeny.com/ipblocks/data/aggregated/ky-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv4 "$ZONE"
done
# CENTRAL AFRICAN REPUBLIC IPv4
for ZONE in $(wget --quiet -O - https://www.ipdeny.com/ipblocks/data/aggregated/cf-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv4 "$ZONE"
done
# CHAD IPv4
for ZONE in $(wget --quiet -O - https://www.ipdeny.com/ipblocks/data/aggregated/td-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv4 "$ZONE"
done
#CHILE IPv4
for ZONE in $(wget --quiet -O - https://www.ipdeny.com/ipblocks/data/aggregated/cl-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv4 "$ZONE"
done
# COLOMBIA IPv4
for ZONE in $(wget --quiet -O - https://www.ipdeny.com/ipblocks/data/aggregated/co-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv4 "$ZONE"
done
# CONGO IPv4
for ZONE in $(wget --quiet -O - https://www.ipdeny.com/ipblocks/data/aggregated/cg-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv4 "$ZONE"
done
# COSTA RICA IPv4
for ZONE in $(wget --quiet -O - https://www.ipdeny.com/ipblocks/data/aggregated/cr-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv4 "$ZONE"
done
# COTE D'IVOIRE IPv4
for ZONE in $(wget --quiet -O - https://www.ipdeny.com/ipblocks/data/aggregated/ci-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv4 "$ZONE"
done
# CUBA IPv4
for ZONE in $(wget --quiet -O - https://www.ipdeny.com/ipblocks/data/aggregated/cu-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv4 "$ZONE"
done
# DJIBOUTI IPv4
for ZONE in $(wget --quiet -O - https://www.ipdeny.com/ipblocks/data/aggregated/dj-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv4 "$ZONE"
done
# ECUADOR IPv4
for ZONE in $(wget --quiet -O - https://www.ipdeny.com/ipblocks/data/aggregated/ec-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv4 "$ZONE"
done
# EGYPT IPv4
for ZONE in $(wget --quiet -O - https://www.ipdeny.com/ipblocks/data/aggregated/eg-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv4 "$ZONE"
done
# EL SALVADOR IPv4
for ZONE in $(wget --quiet -O - https://www.ipdeny.com/ipblocks/data/aggregated/sv-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv4 "$ZONE"
done
# ETHIOPIA IPv4
for ZONE in $(wget --quiet -O - https://www.ipdeny.com/ipblocks/data/aggregated/et-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv4 "$ZONE"
done
# FIJI IPv4
for ZONE in $(wget --quiet -O - https://www.ipdeny.com/ipblocks/data/aggregated/fj-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv4 "$ZONE"
done
# GABON IPv4
for ZONE in $(wget --quiet -O - https://www.ipdeny.com/ipblocks/data/aggregated/ga-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv4 "$ZONE"
done
# GAMBIA IPv4
for ZONE in $(wget --quiet -O - https://www.ipdeny.com/ipblocks/data/aggregated/gm-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv4 "$ZONE"
done
# GHANA IPv4
for ZONE in $(wget --quiet -O - https://www.ipdeny.com/ipblocks/data/aggregated/gh-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv4 "$ZONE"
done
# GUATEMALA IPv4
for ZONE in $(wget --quiet -O - https://www.ipdeny.com/ipblocks/data/aggregated/gt-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv4 "$ZONE"
done
# HONDURAS IPv4
for ZONE in $(wget --quiet -O - https://www.ipdeny.com/ipblocks/data/aggregated/hn-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv4 "$ZONE"
done
# HONG KONG IPv4
for ZONE in $(wget --quiet -O - https://www.ipdeny.com/ipblocks/data/aggregated/hk-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv4 "$ZONE"
done
# INDONESIA IPv4
for ZONE in $(wget --quiet -O - https://www.ipdeny.com/ipblocks/data/aggregated/id-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv4 "$ZONE"
done
# IRAN, ISLAMIC REPUBLIC IPv4
for ZONE in $(wget --quiet -O - https://www.ipdeny.com/ipblocks/data/aggregated/ir-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv4 "$ZONE"
done
# IRAQ IPv4
for ZONE in $(wget --quiet -O - https://www.ipdeny.com/ipblocks/data/aggregated/iq-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv4 "$ZONE"
done
# ISRAEL IPv4
for ZONE in $(wget --quiet -O - https://www.ipdeny.com/ipblocks/data/aggregated/il-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv4 "$ZONE"
done
# JORDAN IPv4
for ZONE in $(wget --quiet -O - https://www.ipdeny.com/ipblocks/data/aggregated/jo-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv4 "$ZONE"
done
# KAZAKHSTAN IPv4
for ZONE in $(wget --quiet -O - https://www.ipdeny.com/ipblocks/data/aggregated/kz-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv4 "$ZONE"
done
# KENYA IPv4
for ZONE in $(wget --quiet -O - https://www.ipdeny.com/ipblocks/data/aggregated/ke-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv4 "$ZONE"
done
# KOREA, DEMOCRATIC PEOPLE'S REPUBLIC OF IPv4
for ZONE in $(wget --quiet -O - https://www.ipdeny.com/ipblocks/data/aggregated/kp-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv4 "$ZONE"
done
# KOREA, REPUBLIC OF IPv4
for ZONE in $(wget --quiet -O - https://www.ipdeny.com/ipblocks/data/aggregated/kr-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv4 "$ZONE"
done
# KUWAIT IPv4
for ZONE in $(wget --quiet -O - https://www.ipdeny.com/ipblocks/data/aggregated/kw-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv4 "$ZONE"
done
# KYRGYZSTAN IPv4
for ZONE in $(wget --quiet -O - https://www.ipdeny.com/ipblocks/data/aggregated/kg-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv4 "$ZONE"
done
# SINGAPORE IPv4
for ZONE in $(wget --quiet -O - https://www.ipdeny.com/ipblocks/data/aggregated/sg-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv4 "$ZONE"
done
# LAO PEOPLE'S DEMOCRATIC REPUBLIC IPv4
for ZONE in $(wget --quiet -O - https://www.ipdeny.com/ipblocks/data/aggregated/la-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv4 "$ZONE"
done
# LEBANON IPv4
for ZONE in $(wget --quiet -O - https://www.ipdeny.com/ipblocks/data/aggregated/lb-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv4 "$ZONE"
done
# LIBYAN ARAB JAMAHIRIYA IPv4
for ZONE in $(wget --quiet -O - https://www.ipdeny.com/ipblocks/data/aggregated/ly-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv4 "$ZONE"
done
# MADAGASCAR IPv4
for ZONE in $(wget --quiet -O - https://www.ipdeny.com/ipblocks/data/aggregated/mg-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv4 "$ZONE"
done
# MALAYSIA IPv4
for ZONE in $(wget --quiet -O - https://www.ipdeny.com/ipblocks/data/aggregated/my-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv4 "$ZONE"
done
# MEXICO IPv4
for ZONE in $(wget --quiet -O - https://www.ipdeny.com/ipblocks/data/aggregated/mx-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv4 "$ZONE"
done
# MOLDOVA, REPUBLIC OF IPv4
for ZONE in $(wget --quiet -O - https://www.ipdeny.com/ipblocks/data/aggregated/md-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv4 "$ZONE"
done
# MONGOLIA IPv4
for ZONE in $(wget --quiet -O - https://www.ipdeny.com/ipblocks/data/aggregated/mn-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv4 "$ZONE"
done
# MYANMAR IPv4
for ZONE in $(wget --quiet -O - https://www.ipdeny.com/ipblocks/data/aggregated/mm-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv4 "$ZONE"
done
# NEW ZEALAND IPv4
for ZONE in $(wget --quiet -O - https://www.ipdeny.com/ipblocks/data/aggregated/nz-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv4 "$ZONE"
done
# OMAN IPv4
for ZONE in $(wget --quiet -O - https://www.ipdeny.com/ipblocks/data/aggregated/om-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv4 "$ZONE"
done
# PAKISTAN IPv4
for ZONE in $(wget --quiet -O - https://www.ipdeny.com/ipblocks/data/aggregated/pk-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv4 "$ZONE"
done
# PALESTINIAN TERRITORY, OCCUPIED
for ZONE in $(wget --quiet -O - https://www.ipdeny.com/ipblocks/data/aggregated/ps-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv4 "$ZONE"
done
# PANAMA IPv4
for ZONE in $(wget --quiet -O - https://www.ipdeny.com/ipblocks/data/aggregated/pa-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv4 "$ZONE"
done
# PAPUA NEW GUINEA IPv4
for ZONE in $(wget --quiet -O - https://www.ipdeny.com/ipblocks/data/aggregated/pg-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv4 "$ZONE"
done
# PARAGUAY IPv4
for ZONE in $(wget --quiet -O - https://www.ipdeny.com/ipblocks/data/aggregated/py-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv4 "$ZONE"
done
# PERU IPv4
for ZONE in $(wget --quiet -O - https://www.ipdeny.com/ipblocks/data/aggregated/pe-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv4 "$ZONE"
done
# PHILIPPINES IPv4
for ZONE in $(wget --quiet -O - https://www.ipdeny.com/ipblocks/data/aggregated/ph-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv4 "$ZONE"
done
# PUERTO RICO IPv4
for ZONE in $(wget --quiet -O - https://www.ipdeny.com/ipblocks/data/aggregated/pr-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv4 "$ZONE"
done
# QATAR IPv4
for ZONE in $(wget --quiet -O - https://www.ipdeny.com/ipblocks/data/aggregated/qa-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv4 "$ZONE"
done
# SAUDI ARABIA IPv4
for ZONE in $(wget --quiet -O - https://www.ipdeny.com/ipblocks/data/aggregated/sa-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv4 "$ZONE"
done
# SEYCHELLES IPv4
for ZONE in $(wget --quiet -O - https://www.ipdeny.com/ipblocks/data/aggregated/sc-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv4 "$ZONE"
done
# SOUTH AFRICA IPv4
for ZONE in $(wget --quiet -O - https://www.ipdeny.com/ipblocks/data/aggregated/za-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv4 "$ZONE"
done
# SYRIAN ARAB REPUBLIC IPv4
for ZONE in $(wget --quiet -O - https://www.ipdeny.com/ipblocks/data/aggregated/sy-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv4 "$ZONE"
done
# TAIWAN IPv4
for ZONE in $(wget --quiet -O - https://www.ipdeny.com/ipblocks/data/aggregated/tw-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv4 "$ZONE"
done
# TAJIKISTAN IPv4
for ZONE in $(wget --quiet -O - https://www.ipdeny.com/ipblocks/data/aggregated/tj-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv4 "$ZONE"
done
# THAILAND IPv4
for ZONE in $(wget --quiet -O - https://www.ipdeny.com/ipblocks/data/aggregated/th-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv4 "$ZONE"
done
# UNITED ARAB EMIRATES IPv4
for ZONE in $(wget --quiet -O - https://www.ipdeny.com/ipblocks/data/aggregated/ae-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv4 "$ZONE"
done
# YEMEN IPv4
for ZONE in $(wget --quiet -O - https://www.ipdeny.com/ipblocks/data/aggregated/ye-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv4 "$ZONE"
done
# VIET NAM IPv4
for ZONE in $(wget --quiet -O - https://www.ipdeny.com/ipblocks/data/aggregated/vn-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv4 "$ZONE"
done
# UZBEKISTAN IPv4
for ZONE in $(wget --quiet -O - https://www.ipdeny.com/ipblocks/data/aggregated/uz-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv4 "$ZONE"
done
###############
# Flush existing IPv6 rules
/sbin/ipset flush blocked-countries-ipv6
# China IPv6
for ZONE in $(wget --quiet --no-check-certificate -O - https://ipdeny.com/ipv6/ipaddresses/aggregated/cn-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv6 "$ZONE"
done
# Russia IPv6
for ZONE in $(wget --quiet --no-check-certificate -O - https://ipdeny.com/ipv6/ipaddresses/aggregated/ru-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv6 "$ZONE"
done
# AFGHANISTAN IPv6
for ZONE in $(wget --quiet --no-check-certificate -O - https://ipdeny.com/ipv6/ipaddresses/aggregated/af-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv6 "$ZONE"
done
# ALBANIA IPv6
for ZONE in $(wget --quiet --no-check-certificate -O - https://ipdeny.com/ipv6/ipaddresses/aggregated/al-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv6 "$ZONE"
done
# ALGERIA IPv6
for ZONE in $(wget --quiet --no-check-certificate -O - https://ipdeny.com/ipv6/ipaddresses/aggregated/dz-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv6 "$ZONE"
done
# ANDORRA IPv6
for ZONE in $(wget --quiet --no-check-certificate -O - https://ipdeny.com/ipv6/ipaddresses/aggregated/ad-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv6 "$ZONE"
done
# ANGOLA IPv6
for ZONE in $(wget --quiet --no-check-certificate -O - https://ipdeny.com/ipv6/ipaddresses/aggregated/ao-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv6 "$ZONE"
done
# ARMENIA IPv6
for ZONE in $(wget --quiet --no-check-certificate -O - https://ipdeny.com/ipv6/ipaddresses/aggregated/am-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv6 "$ZONE"
done
# AUSTRALIA IPv6
for ZONE in $(wget --quiet --no-check-certificate -O - https://ipdeny.com/ipv6/ipaddresses/aggregated/au-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv6 "$ZONE"
done
# AZERBAIJAN IPv6
for ZONE in $(wget --quiet --no-check-certificate -O - https://ipdeny.com/ipv6/ipaddresses/aggregated/az-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv6 "$ZONE"
done
# BANGLADESH IPv6
for ZONE in $(wget --quiet --no-check-certificate -O - https://ipdeny.com/ipv6/ipaddresses/aggregated/bd-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv6 "$ZONE"
done
# BELARUS IPv6
for ZONE in $(wget --quiet --no-check-certificate -O - https://ipdeny.com/ipv6/ipaddresses/aggregated/by-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv6 "$ZONE"
done
# BRAZIL IPv6
for ZONE in $(wget --quiet --no-check-certificate -O - https://ipdeny.com/ipv6/ipaddresses/aggregated/br-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv6 "$ZONE"
done
# BULGARIA IPv6
for ZONE in $(wget --quiet --no-check-certificate -O - https://ipdeny.com/ipv6/ipaddresses/aggregated/bg-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv6 "$ZONE"
done
# CAMBODIA IPv6
for ZONE in $(wget --quiet --no-check-certificate -O - https://ipdeny.com/ipv6/ipaddresses/aggregated/kh-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv6 "$ZONE"
done
# CAYMAN ISLANDS IPv6
for ZONE in $(wget --quiet --no-check-certificate -O - https://ipdeny.com/ipv6/ipaddresses/aggregated/ky-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv6 "$ZONE"
done
# CENTRAL AFRICAN REPUBLIC IPv6
for ZONE in $(wget --quiet --no-check-certificate -O - https://ipdeny.com/ipv6/ipaddresses/aggregated/cf-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv6 "$ZONE"
done
# CHAD IPv6
for ZONE in $(wget --quiet --no-check-certificate -O - https://ipdeny.com/ipv6/ipaddresses/aggregated/td-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv6 "$ZONE"
done
#CHILE IPv6
for ZONE in $(wget --quiet --no-check-certificate -O - https://ipdeny.com/ipv6/ipaddresses/aggregated/cl-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv6 "$ZONE"
done
# COLOMBIA IPv6
for ZONE in $(wget --quiet --no-check-certificate -O - https://ipdeny.com/ipv6/ipaddresses/aggregated/co-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv6 "$ZONE"
done
# CONGO IPv6
for ZONE in $(wget --quiet --no-check-certificate -O - https://ipdeny.com/ipv6/ipaddresses/aggregated/cg-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv6 "$ZONE"
done
# COSTA RICA IPv6
for ZONE in $(wget --quiet --no-check-certificate -O - https://ipdeny.com/ipv6/ipaddresses/aggregated/cr-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv6 "$ZONE"
done
# COTE D'IVOIRE IPv6
for ZONE in $(wget --quiet --no-check-certificate -O - https://ipdeny.com/ipv6/ipaddresses/aggregated/ci-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv6 "$ZONE"
done
# CUBA IPv6
for ZONE in $(wget --quiet --no-check-certificate -O - https://ipdeny.com/ipv6/ipaddresses/aggregated/cu-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv6 "$ZONE"
done
# DJIBOUTI IPv6
for ZONE in $(wget --quiet --no-check-certificate -O - https://ipdeny.com/ipv6/ipaddresses/aggregated/dj-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv6 "$ZONE"
done
# ECUADOR IPv6
for ZONE in $(wget --quiet --no-check-certificate -O - https://ipdeny.com/ipv6/ipaddresses/aggregated/ec-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv6 "$ZONE"
done
# EGYPT IPv6
for ZONE in $(wget --quiet --no-check-certificate -O - https://ipdeny.com/ipv6/ipaddresses/aggregated/eg-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv6 "$ZONE"
done
# EL SALVADOR IPv6
for ZONE in $(wget --quiet --no-check-certificate -O - https://ipdeny.com/ipv6/ipaddresses/aggregated/sv-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv6 "$ZONE"
done
# ETHIOPIA IPv6
for ZONE in $(wget --quiet --no-check-certificate -O - https://ipdeny.com/ipv6/ipaddresses/aggregated/et-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv6 "$ZONE"
done
# FIJI IPv6
for ZONE in $(wget --quiet --no-check-certificate -O - https://ipdeny.com/ipv6/ipaddresses/aggregated/fj-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv6 "$ZONE"
done
# GABON IPv6
for ZONE in $(wget --quiet --no-check-certificate -O - https://ipdeny.com/ipv6/ipaddresses/aggregated/ga-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv6 "$ZONE"
done
# GAMBIA IPv6
for ZONE in $(wget --quiet --no-check-certificate -O - https://ipdeny.com/ipv6/ipaddresses/aggregated/gm-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv6 "$ZONE"
done
# GHANA IPv6
for ZONE in $(wget --quiet --no-check-certificate -O - https://ipdeny.com/ipv6/ipaddresses/aggregated/gh-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv6 "$ZONE"
done
# GUATEMALA IPv6
for ZONE in $(wget --quiet --no-check-certificate -O - https://ipdeny.com/ipv6/ipaddresses/aggregated/gt-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv6 "$ZONE"
done
# HONDURAS IPv6
for ZONE in $(wget --quiet --no-check-certificate -O - https://ipdeny.com/ipv6/ipaddresses/aggregated/hn-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv6 "$ZONE"
done
# HONG KONG IPv6
for ZONE in $(wget --quiet --no-check-certificate -O - https://ipdeny.com/ipv6/ipaddresses/aggregated/hk-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv6 "$ZONE"
done
# INDONESIA IPv6
for ZONE in $(wget --quiet --no-check-certificate -O - https://ipdeny.com/ipv6/ipaddresses/aggregated/id-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv6 "$ZONE"
done
# IRAN, ISLAMIC REPUBLIC IPv6
for ZONE in $(wget --quiet --no-check-certificate -O - https://ipdeny.com/ipv6/ipaddresses/aggregated/ir-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv6 "$ZONE"
done
# IRAQ IPv6
for ZONE in $(wget --quiet --no-check-certificate -O - https://ipdeny.com/ipv6/ipaddresses/aggregated/iq-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv6 "$ZONE"
done
# ISRAEL IPv6
for ZONE in $(wget --quiet --no-check-certificate -O - https://ipdeny.com/ipv6/ipaddresses/aggregated/il-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv6 "$ZONE"
done
# JORDAN IPv6
for ZONE in $(wget --quiet --no-check-certificate -O - https://ipdeny.com/ipv6/ipaddresses/aggregated/jo-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv6 "$ZONE"
done
# KAZAKHSTAN IPv6
for ZONE in $(wget --quiet --no-check-certificate -O - https://ipdeny.com/ipv6/ipaddresses/aggregated/kz-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv6 "$ZONE"
done
# KENYA IPv6
for ZONE in $(wget --quiet --no-check-certificate -O - https://ipdeny.com/ipv6/ipaddresses/aggregated/ke-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv6 "$ZONE"
done
# KOREA, DEMOCRATIC PEOPLE'S REPUBLIC OF IPv6
for ZONE in $(wget --quiet --no-check-certificate -O - https://ipdeny.com/ipv6/ipaddresses/aggregated/kp-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv6 "$ZONE"
done
# KOREA, REPUBLIC OF IPv6
for ZONE in $(wget --quiet --no-check-certificate -O - https://ipdeny.com/ipv6/ipaddresses/aggregated/kr-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv6 "$ZONE"
done
# KUWAIT IPv6
for ZONE in $(wget --quiet --no-check-certificate -O - https://ipdeny.com/ipv6/ipaddresses/aggregated/kw-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv6 "$ZONE"
done
# KYRGYZSTAN IPv6
for ZONE in $(wget --quiet --no-check-certificate -O - https://ipdeny.com/ipv6/ipaddresses/aggregated/kg-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv6 "$ZONE"
done
# SINGAPORE IPv6
for ZONE in $(wget --quiet --no-check-certificate -O - https://ipdeny.com/ipv6/ipaddresses/aggregated/sg-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv6 "$ZONE"
done
# LAO PEOPLE'S DEMOCRATIC REPUBLIC IPv6
for ZONE in $(wget --quiet --no-check-certificate -O - https://ipdeny.com/ipv6/ipaddresses/aggregated/la-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv6 "$ZONE"
done
# LEBANON IPv6
for ZONE in $(wget --quiet --no-check-certificate -O - https://ipdeny.com/ipv6/ipaddresses/aggregated/lb-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv6 "$ZONE"
done
# LIBYAN ARAB JAMAHIRIYA IPv6
for ZONE in $(wget --quiet --no-check-certificate -O - https://ipdeny.com/ipv6/ipaddresses/aggregated/ly-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv6 "$ZONE"
done
# MADAGASCAR IPv6
for ZONE in $(wget --quiet --no-check-certificate -O - https://ipdeny.com/ipv6/ipaddresses/aggregated/mg-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv6 "$ZONE"
done
# MALAYSIA IPv6
for ZONE in $(wget --quiet --no-check-certificate -O - https://ipdeny.com/ipv6/ipaddresses/aggregated/my-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv6 "$ZONE"
done
# MEXICO IPv6
for ZONE in $(wget --quiet --no-check-certificate -O - https://ipdeny.com/ipv6/ipaddresses/aggregated/mx-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv6 "$ZONE"
done
# MOLDOVA, REPUBLIC OF IPv6
for ZONE in $(wget --quiet --no-check-certificate -O - https://ipdeny.com/ipv6/ipaddresses/aggregated/md-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv6 "$ZONE"
done
# MONGOLIA IPv6
for ZONE in $(wget --quiet --no-check-certificate -O - https://ipdeny.com/ipv6/ipaddresses/aggregated/mn-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv6 "$ZONE"
done
# MYANMAR IPv6
for ZONE in $(wget --quiet --no-check-certificate -O - https://ipdeny.com/ipv6/ipaddresses/aggregated/mm-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv6 "$ZONE"
done
# NEW ZEALAND IPv6
for ZONE in $(wget --quiet --no-check-certificate -O - https://ipdeny.com/ipv6/ipaddresses/aggregated/nz-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv6 "$ZONE"
done
# OMAN IPv6
for ZONE in $(wget --quiet --no-check-certificate -O - https://ipdeny.com/ipv6/ipaddresses/aggregated/om-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv6 "$ZONE"
done
# PAKISTAN IPv6
for ZONE in $(wget --quiet --no-check-certificate -O - https://ipdeny.com/ipv6/ipaddresses/aggregated/pk-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv6 "$ZONE"
done
# PALESTINIAN TERRITORY, OCCUPIED
for ZONE in $(wget --quiet --no-check-certificate -O - https://ipdeny.com/ipv6/ipaddresses/aggregated/ps-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv6 "$ZONE"
done
# PANAMA IPv6
for ZONE in $(wget --quiet --no-check-certificate -O - https://ipdeny.com/ipv6/ipaddresses/aggregated/pa-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv6 "$ZONE"
done
# PAPUA NEW GUINEA IPv6
for ZONE in $(wget --quiet --no-check-certificate -O - https://ipdeny.com/ipv6/ipaddresses/aggregated/pg-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv6 "$ZONE"
done
# PARAGUAY IPv6
for ZONE in $(wget --quiet --no-check-certificate -O - https://ipdeny.com/ipv6/ipaddresses/aggregated/py-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv6 "$ZONE"
done
# PERU IPv6
for ZONE in $(wget --quiet --no-check-certificate -O - https://ipdeny.com/ipv6/ipaddresses/aggregated/pe-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv6 "$ZONE"
done
# PHILIPPINES IPv6
for ZONE in $(wget --quiet --no-check-certificate -O - https://ipdeny.com/ipv6/ipaddresses/aggregated/ph-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv6 "$ZONE"
done
# PUERTO RICO IPv6
for ZONE in $(wget --quiet --no-check-certificate -O - https://ipdeny.com/ipv6/ipaddresses/aggregated/pr-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv6 "$ZONE"
done
# QATAR IPv6
for ZONE in $(wget --quiet --no-check-certificate -O - https://ipdeny.com/ipv6/ipaddresses/aggregated/qa-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv6 "$ZONE"
done
# SAUDI ARABIA IPv6
for ZONE in $(wget --quiet --no-check-certificate -O - https://ipdeny.com/ipv6/ipaddresses/aggregated/sa-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv6 "$ZONE"
done
# SEYCHELLES IPv6
for ZONE in $(wget --quiet --no-check-certificate -O - https://ipdeny.com/ipv6/ipaddresses/aggregated/sc-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv6 "$ZONE"
done
# SOUTH AFRICA IPv6
for ZONE in $(wget --quiet --no-check-certificate -O - https://ipdeny.com/ipv6/ipaddresses/aggregated/za-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv6 "$ZONE"
done
# SYRIAN ARAB REPUBLIC IPv6
for ZONE in $(wget --quiet --no-check-certificate -O - https://ipdeny.com/ipv6/ipaddresses/aggregated/sy-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv6 "$ZONE"
done
# TAIWAN IPv6
for ZONE in $(wget --quiet --no-check-certificate -O - https://ipdeny.com/ipv6/ipaddresses/aggregated/tw-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv6 "$ZONE"
done
# TAJIKISTAN IPv6
for ZONE in $(wget --quiet --no-check-certificate -O - https://ipdeny.com/ipv6/ipaddresses/aggregated/tj-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv6 "$ZONE"
done
# THAILAND IPv6
for ZONE in $(wget --quiet --no-check-certificate -O - https://ipdeny.com/ipv6/ipaddresses/aggregated/th-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv6 "$ZONE"
done
# UNITED ARAB EMIRATES IPv6
for ZONE in $(wget --quiet --no-check-certificate -O - https://ipdeny.com/ipv6/ipaddresses/aggregated/ae-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv6 "$ZONE"
done
# YEMEN IPv6
for ZONE in $(wget --quiet --no-check-certificate -O - https://ipdeny.com/ipv6/ipaddresses/aggregated/ye-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv6 "$ZONE"
done
# VIET NAM IPv6
for ZONE in $(wget --quiet --no-check-certificate -O - https://ipdeny.com/ipv6/ipaddresses/aggregated/vn-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv6 "$ZONE"
done
# UZBEKISTAN IPv6
for ZONE in $(wget --quiet --no-check-certificate -O - https://ipdeny.com/ipv6/ipaddresses/aggregated/uz-aggregated.zone)
do /sbin/ipset --add blocked-countries-ipv6 "$ZONE"
done
###############
# Flush existing FireHOL rules
/sbin/ipset flush firehol
# FireHOL ‘level 1’ blacklist
for ZONE in $(wget --quiet -O - https://iplists.firehol.org/files/firehol_level1.netset | sed '/#/d')
do /sbin/ipset --add firehol "$ZONE"
done
# Flush existing FireHOL rules
/sbin/ipset flush firehol_webserver
for ZONE in $(wget --quiet -O - https://iplists.firehol.org/files/firehol_webserver.netset | sed '/#/d')
do /sbin/ipset --add firehol_webserver "$ZONE"
done
# Flush existing FireHOL rules
/sbin/ipset flush firehol_openproxys
for ZONE in $(wget --quiet -O - https://iplists.firehol.org/files/firehol_proxies.netset | sed '/#/d')
do /sbin/ipset --add firehol_openproxys "$ZONE"
done
# Flush existing FireHOL rules
/sbin/ipset flush firehol_tor_exits
for ZONE in $(wget --quiet -O - https://iplists.firehol.org/files/tor_exits_7d.ipset | sed '/#/d')
do /sbin/ipset --add firehol_tor_exits "$ZONE"
done
# Flush existing FireHOL rules
/sbin/ipset flush firehol_ssh
for ZONE in $(wget --quiet -O - https://iplists.firehol.org/files/blocklist_de_ssh.ipset | sed '/#/d')
do /sbin/ipset --add firehol_ssh "$ZONE"
done
# Flush existing FireHOL rules
/sbin/ipset flush firehol_mail
for ZONE in $(wget --quiet -O - https://iplists.firehol.org/files/blocklist_de_mail.ipset | sed '/#/d')
do /sbin/ipset --add firehol_mail "$ZONE"
done
# Flush existing FireHOL rules
/sbin/ipset flush firehol_imap
for ZONE in $(wget --quiet -O - https://iplists.firehol.org/files/blocklist_de_imap.ipset | sed '/#/d')
do /sbin/ipset --add firehol_imap "$ZONE"
done
# Flush existing FireHOL rules
/sbin/ipset flush firehol_bruteforce
for ZONE in $(wget --quiet -O - https://iplists.firehol.org/files/blocklist_de_bruteforce.ipset | sed '/#/d')
do /sbin/ipset --add firehol_bruteforce "$ZONE"
done
# Flush existing FireHOL rules
/sbin/ipset flush firehol_strongips
for ZONE in $(wget --quiet -O - https://iplists.firehol.org/files/blocklist_de_strongips.ipset | sed '/#/d')
do /sbin/ipset --add firehol_strongips "$ZONE"
done