vpn.sh 334 B

1234567891011
  1. #!/bin/sh
  2. set -eux
  3. iptables -P FORWARD DROP
  4. iptables -A FORWARD -i eth0 -o tun0 -d 10.10.10.0/24 -j ACCEPT
  5. iptables -A FORWARD -i tun0 -o eth0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
  6. iptables -t nat -A POSTROUTING -o tun0 -j MASQUERADE
  7. exec openvpn --config "$OPENVPN_CONFIG_PATH" \
  8. --user openvpn --group openvpn