Skip to content

Instantly share code, notes, and snippets.

@hotfix31
Last active September 5, 2017 15:30
Show Gist options
  • Save hotfix31/bacbb3240859120a148c9d56302e3b95 to your computer and use it in GitHub Desktop.
Save hotfix31/bacbb3240859120a148c9d56302e3b95 to your computer and use it in GitHub Desktop.
Pour se protéger des VPN (openvpn) pro qui autorisent le client-to-client.
#!/bin/bash
[ "$script_type" ] || exit 0
[ "$dev" ] || exit 0
case "$script_type" in
up)
iptables -A OUTPUT -i $dev -j ACCEPT
iptables -A INPUT -i $dev -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -i $dev -j DROP
;;
down)
iptables -D OUTPUT -i $dev -j ACCEPT
iptables -D INPUT -i $dev -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -D INPUT -i $dev -j DROP
;;
esac
exit 0
@hotfix31
Copy link
Author

hotfix31 commented Sep 5, 2017

Il suffit de placer dans votre config openvpn les options :

up /etc/openvpn/update-iptables.sh
down /etc/openvpn/update-iptables.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment