Last active
June 4, 2016 03:59
-
-
Save leozhang2018/6327e0deecce0154740cf6745892efbf to your computer and use it in GitHub Desktop.
Get CN_IPv4 from APNIC
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
# Get CN_IPv4 from APNIC | |
function CurlIptable(){ | |
## 指定作用域分隔符为 '|',同时计算子网掩码位数之后进行拼接(http://www.cnblogs.com/ggjucheng/archive/2013/01/13/2858470.html) | |
curl $Delegated_apnic_latest_URL | grep 'apnic|CN|ipv4' | awk -F '|' '/CN/&&/ipv4/ {print "iptables -t nat -I SHADOWSOCKS -d " $4 "/" 32-log($5)/log(2) " -j RETURN" }'|cat > $save_to_file | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment