-
-
Save userid/0369e60f02195d47971909772011d745 to your computer and use it in GitHub Desktop.
chinaroute路由表更新命令
This file contains hidden or 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 | |
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