for i in `cat $path/privacy-filter.list`; do traceroute $i | head -1 | grep -oE "$regexp" >> $path/privacy_block.pre; done
awk '!/^127\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^192\.168\.)/' $path/privacy_block.pre > $path/privacy_block.list
ipset -L privacy-filter | grep -oE '(^127\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^192\.168\.)'
Code:ipset -L privacy-filter | grep -oE '^127\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^192\.168\.)'
According to ARIN private IP ranges areCode:for i in `cat $path/privacy-filter.list`; do traceroute $i | head -1 | grep -oE "$regexp" >> $path/privacy_block.pre; done awk '!/^127\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^192\.168\.)/' $path/privacy_block.pre > $path/privacy_block.list
think i made it safe
@tomsk mind reviewing ?
Is it missing '(' ?
so future plans here for privacy-filter i plan to support ipv6 pretty soon so that those with ipv6 can also benefit from this script although this can only benefit ipset 6.x users.
I gave it quick look over...saw a couple of small mistakes, but looks like it will work ok with those corrected.so i put it up on my personal gitlab
https://gitlab.com/swe_toast/privacy-filter/blob/master/privacy-filter
this is just for review not for actual usage since im unsure on how it would perform gonna need todo alot of testing.
ipset -L privacy-filter_ipv6
Name: privacy-filter_ipv6
Type: hash:ip
Revision: 0
Header: family inet6 hashsize 1024 maxelem 65536
Size in memory: 9080
References: 1
Members:
2400:cb00:2048:1::6810:335d
2606:2800:133:206e:1315:22a5:2006:24fd
2400:cb00:2048:1::6810:345d
2400:cb00:2048:1::6810:355d
2606:2800:234:2294:b59:11e7:560:10db
2a03:2880:f00a:2:face:b00c:0:8c
2a01:111:f30e:1790::f001:dcc1
2604:a880:800:10::99:7001
2400:cb00:2048:1::6810:315d
2a01:111:f303:1791::b01
2a00:1450:400f:808::2006
2400:cb00:2048:1::6810:325d
2a01:111:f330:1790::a01
Welcome To SNBForums
SNBForums is a community for anyone who wants to learn about or discuss the latest in wireless routers, network storage and the ins and outs of building and maintaining a small network.
If you'd like to post a question, simply register and have at it!
While you're at it, please check out SmallNetBuilder for product reviews and our famous Router Charts, Ranker and plenty more!