Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

获取中国 IP 网段 #64

Open
isayme opened this issue Nov 8, 2021 · 0 comments
Open

获取中国 IP 网段 #64

isayme opened this issue Nov 8, 2021 · 0 comments

Comments

@isayme
Copy link
Owner

isayme commented Nov 8, 2021

获取 IP 网段

数据源1

wget -O- 'http://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-latest' | awk -F\| '/CN\|ipv4/ { printf("%s/%d\n", $4, 32-log($5)/log(2)) }' > ./chnroute.txt

数据源2

wget -O- http://www.ipdeny.com/ipblocks/data/countries/cn.zone > ./chnroute.txt

创建并初始化 ipset

ipset -N chnroute hash:net
for i in $(cat ./chnroute.txt ); do ipset -A chnroute $i; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant