Implement server side ACL & an example script

This commit is contained in:
Toby
2020-04-27 13:46:11 -07:00
parent ea7b596f79
commit 2ee4f245a8
8 changed files with 7143 additions and 17 deletions

7030
docs/acl/chnroutes.acl Normal file

File diff suppressed because it is too large Load Diff

20
docs/acl/chnroutes.py Normal file
View File

@@ -0,0 +1,20 @@
#! /usr/bin/env python3
import urllib.request
from itertools import chain
from datetime import date
data_ipv4 = urllib.request.urlopen(
'https://www.ipdeny.com/ipblocks/data/aggregated/cn-aggregated.zone')
data_ipv6 = urllib.request.urlopen(
'https://www.ipdeny.com/ipv6/ipaddresses/aggregated/cn-aggregated.zone')
data = chain(data_ipv4, data_ipv6)
with open('chnroutes.acl', 'w') as out:
out.write('# chnroutes\n# Generated on %s\n\n' %
date.today().strftime("%B %d, %Y"))
for l in data:
ls = str(l, 'UTF8').strip()
if ls:
out.write('direct cidr %s\n' % ls)