Skip to content

Instantly share code, notes, and snippets.

@prasetiyohadi
Last active December 23, 2015 09:56
Show Gist options
  • Save prasetiyohadi/fa802e51be2c21ecf1c2 to your computer and use it in GitHub Desktop.
Save prasetiyohadi/fa802e51be2c21ecf1c2 to your computer and use it in GitHub Desktop.
Firewall-cmd configuration for OpenVPN service
#!/bin/bash
echo "net.ipv4.ip_forward = 1" | sudo tee -a /etc/sysctl.conf
sudo sysctl -p
sudo systemctl start firewalld.service
sudo firewall-cmd --zone=public --add-service openvpn --permanent
sudo firewall-cmd --zone=public --add-masquerade --permanent
# confirm
sudo firewall-cmd --zone=public --query-masquerade
# reload firewall
sudo firewall-cmd --reload
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment