Nav apraksta
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

rc.local_ansible_openvpn 695B

123456789101112131415161718
  1. #!/bin/sh -e
  2. # {{ ansible_managed }}
  3. #
  4. # This script should be included in your rc.local
  5. #
  6. iptables -C FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT || \
  7. iptables -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
  8. iptables -C FORWARD -s {{ openvpn_ip_start }}.0/24 -j ACCEPT || \
  9. iptables -A FORWARD -s {{ openvpn_ip_start }}.0/24 -j ACCEPT
  10. iptables -C FORWARD -j REJECT || \
  11. iptables -A FORWARD -j REJECT
  12. iptables -t nat -C POSTROUTING -s {{ openvpn_ip_start }}.0/24 -o {{ ansible_default_ipv4.interface }} -j MASQUERADE || \
  13. iptables -t nat -A POSTROUTING -s {{ openvpn_ip_start }}.0/24 -o {{ ansible_default_ipv4.interface }} -j MASQUERADE
  14. systemctl restart dnsmasq
  15. exit 0