Regras firewall para openvpn

Regras para passar trafego pelo iptables:

Exemplo:

tun0 – interface openvpn
eth0 – lan

# vpn
iptables -A INPUT -i tun0 -j ACCEPT

# openvpn
iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE

iptables -A FORWARD -i tun0 -j ACCEPT
iptables -A FORWARD -i tun0 -o eth0 -m state –state RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i eth0 -o tun0 -m state –state RELATED,ESTABLISHED -j ACCEPT

# aceitar a openvpn
iptables -A INPUT -p udp –dport 1195 -j ACCEPT

Deixe uma resposta