Last active
September 16, 2020 12:30
-
-
Save rzdhop/7f8adb92a8831aa25b0caf72c2f45fe1 to your computer and use it in GitHub Desktop.
This file contains 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
Check the service status with standard systemctl command: | |
$ sudo systemctl status ufw | |
Enable UFW with enable command: | |
$ sudo ufw enable | |
Syntax to open specific TCP port: | |
$ sudo ufw allow (port)/tcp | |
Syntax supports also names which reffer to specific ports: | |
$ sudo ufw allow https | |
To allow incoming tcp and udp packet on port 21, enter: | |
$ sudo ufw allow 21 | |
Example for specific IP Address: | |
$ sudo ufw allow from 190.34.21.113 to any port | |
Let’s check the configuration: | |
$ sudo ufw status verbose | |
To open a specific port | |
$ iptables -A INPUT -p tcp -i eth0 --dport 80 -j ACCEPT | |
$ firewall-cmd --zone=public --add-port=3306/tcp --permanent | |
$ firewall-cmd --reload |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment