Last active
August 2, 2024 23:16
-
-
Save prasetiyohadi/fa802e51be2c21ecf1c2 to your computer and use it in GitHub Desktop.
Firewall-cmd configuration for OpenVPN service
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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