Changes

Jump to: navigation, search

BlackBlockGoogle

191 bytes removed, 11:24, 27 April 2018
no edit summary
-------
IP=nslookup $1 | grep -E '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | tail -n1 | cut -d\ -f3
AS=wget -q -O - http://ipinfo.io/$IP/org | cut -f1 -d \ | sed -e 's/AS//'
NETWORKS=wget -O - http://stat.ripe.net/data/announced-prefixes/data.yaml?resource=$AS|grep prefix\:|grep -v \:\:|awk '{print $3}'
for i in $NETWORKS; do echo "iptables -t mangle -A ggl_ip -d $i -j ggl_do"; done-- -- iptsetup.sh --
This is a script that would run on OpenWRT:
 
You would do, for example:
* root@OpenWrt:~# iptsetup.sh google.com gl 1"
* That would create for you add_gl.sh and del_gl.sh in the current working directory.
* Then run ./add_gl.sh and all packets destined to google will be marked with MARK 1
------
-- iptsetup.sh --
<pre>
#!/bin/sh
</pre>
 
Do, for example: "iptsetup.sh google.com gl 1"
that would create for you add_gl.sh and del_gl.sh
13
edits

Navigation menu