Skip to content

Latest commit

 

History

History
25 lines (18 loc) · 367 Bytes

README.md

File metadata and controls

25 lines (18 loc) · 367 Bytes

cnips

获取中国的 IP 地址范围

用法

gcc cnips.c -O2 -o cnips

wget http://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-latest
cat delegated-apnic-latest | ./cnips

配合 iproute2 来设置路由表

for net in `cat delegated-apnic-latest | ./cnips`
do
  ip route add $net via <your_gateway> table <your_rule_table>
done