Guest User

down.sh

a guest
May 20th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. #! /bin/sh
  2. # This script disables policy routing before the tunnel interface is brought down
  3.  
  4. killall checkVPN
  5.  
  6. /etc/init.d/transmission-daemon stop
  7.  
  8. #On efface les règles iptables ajoutées
  9.  
  10. iptables -D FORWARD -s 192.168.10.1/32 -o eth0 -j DROP
  11. iptables -D SERVICES -p udp --dport 51413 -j ACCEPT # DHT
  12. iptables -D SERVICES -p tcp --dport 51413 -j ACCEPT # rTorrent random range
  13. iptables -D INPUT -i $1 -m state --state RELATED,ESTABLISHED -j ACCEPT
  14. iptables -D POSTROUTING -t nat -o $1 -j MASQUERADE
  15. iptables -D PREROUTING -t nat -i $1 -p udp --dport 443 -j DNAT --to 192.168.10.1
  16. iptables -D PREROUTING -t nat -i $1 -p tcp --dport 443 -j DNAT --to 192.168.10.1
  17.  
  18. # Remove rule for the secondary loopback IP address (192.168.10.1)
  19. ip rule del from 192.168.10.1/32 table VPN
  20.  
  21. # Remove rule for tun0 IP address
  22. ip rule del from $4/32 table VPN
Add Comment
Please, Sign In to add comment