Commit c4c0b64e authored by Vitaly Lipatov's avatar Vitaly Lipatov

update routing update scripts

parent 90d51b3d
...@@ -4,3 +4,4 @@ ...@@ -4,3 +4,4 @@
#cat dump.csv |cut -f1 -d';'|tr '|' '\n'| tr -d ' '|sort -u #cat dump.csv |cut -f1 -d';'|tr '|' '\n'| tr -d ' '|sort -u
#cat dump.csv |cut -f1 -d';'|tr '|' '\n'| tr -d ' '|sed '1d'|sort -u #cat dump.csv |cut -f1 -d';'|tr '|' '\n'| tr -d ' '|sed '1d'|sort -u
curl http://reestr.rublacklist.net/api/ips | sed -e 's|"||g' | sed -e 's|;|\n|g' curl http://reestr.rublacklist.net/api/ips | sed -e 's|"||g' | sed -e 's|;|\n|g'
cat a_manual.list | grep -v "^#"
...@@ -18,8 +18,8 @@ ipset create $SETNAME.tmp hash:ip || exit ...@@ -18,8 +18,8 @@ ipset create $SETNAME.tmp hash:ip || exit
#done #done
#ssh -q 192.168.1.217 -l xoxo| grep -v "Last login"| sed $'s/\r//' | while read ip ; do #ssh -q 192.168.1.217 -l xoxo| grep -v "Last login"| sed $'s/\r//' | while read ip ; do
#./get_ips_z-i.sh | while read ip ; do ./get_ips_z-i.sh | while read ip ; do
cat z | while read ip ; do #cat z | while read ip ; do
#ip rule add to $ip table openroute #ip rule add to $ip table openroute
ipset add $SETNAME.tmp $ip ipset add $SETNAME.tmp $ip
done done
...@@ -32,6 +32,10 @@ if ! iptables -L -t mangle | grep -q $SETNAME ; then ...@@ -32,6 +32,10 @@ if ! iptables -L -t mangle | grep -q $SETNAME ; then
iptables -t mangle -A PREROUTING -i $IFACE -m set --match-set $SETNAME dst -j MARK --set-mark 5 || exit iptables -t mangle -A PREROUTING -i $IFACE -m set --match-set $SETNAME dst -j MARK --set-mark 5 || exit
fi fi
if ! sysctl net.ipv4.conf.tun0.rp_filter | grep -q " = 2" ; then
sysctl -w net.ipv4.conf.tun0.rp_filter=2
fi
if ! ip route show table openroute | grep -q "default dev tun0" ; then if ! ip route show table openroute | grep -q "default dev tun0" ; then
ip route replace default table openroute scope global nexthop dev tun0 || exit ip route replace default table openroute scope global nexthop dev tun0 || exit
fi fi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment