Last active
September 28, 2021 09:44
-
-
Save lixingcong/286144b3a521add58d8dcf045700963f to your computer and use it in GitHub Desktop.
chinaroute路由表更新命令
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
路由表使用cidrmerge进行合并 | |
cat route.txt| cidrmerge > route_merged.txt | |
https://github.com/karlpilkington/cidrmerge | |
ipip.net中国大陆路由表(每两个月更新一次) | |
wget https://github.com/17mon/china_ip_list/raw/master/china_ip_list.txt -O /tmp/route.txt | |
ChinaRoute ipv4路由表 | |
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)) }' > /tmp/route.txt | |
Adblock_china_easylist去广告: | |
wget -4 --no-check-certificate -O - https://easylist-downloads.adblockplus.org/easylistchina+easylist.txt | grep -E '^\|\|[^\*]*\^$' | sed -e 's:||:address\=\/:' -e 's:\^:/127\.0\.0\.1:' | sort | uniq > /tmp/adblock.conf | |
AdAway去广告:大体积版本:2.1MB...注意这个ad_server.txt行尾是DOS,这里使用sed替换为Unix! | |
wget -4 --no-check-certificate -O - https://hosts-file.net/ad_servers.txt | sed $'s/\r$//' | grep -E '^127.0.0.1' | awk '{printf "address=/%s/127.0.0.1\n",$2}' | sort > /tmp/adaway_max.conf | |
AdAway去广告:小体积版本 | |
wget -4 --no-check-certificate -O - https://adaway.org/hosts.txt | grep -E '^127.0.0.1' | awk '{printf "address=/%s/127.0.0.1\n",$2}' | sort > /tmp/adaway_mini.conf | |
ChinaRoute ipv6路由表 | |
curl 'http://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-latest' | grep ipv6 | grep CN | awk -F\| '{ printf("%s/%d\n", $4, 32-log($5)/log(2)) }' > /tmp/route_v6.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment