Firewall Ports
- Chris Speed

- Nov 26, 2022
- 1 min read
Updated: Jul 25, 2023
Ubuntu
Turn Firewall On or Off
sudo ufw enable
sudo ufw disableCheck Firewall Ports
sudo ufw status verbose
sudo ufw app listOpen a Port
sudo ufw allow 22/tcp
sudo ufw allow from 192.168.1.10 to any port 22Delete a Port
sudo ufw status numbered
sudo ufw delete 3
or
sudo ufw delete allow 22/tcpCentos
Open/Close a Port
sudo firewall-cmd --zone=public --add-port=55555/tcp --permanent
sudo firewall-cmd --zone=public --remove-port=55555/tcp --permanent
sudo firewall-cmd --reloadCheck Firewall Ports
sudo firewall-cmd --list-all
sudo yum install nmap
sudo nmap -n -PN -sT -sU -p- localhost
sudo yum install net-tools
netstat -pnltuWindows
Open Windows Firewall by clicking the Start button Picture of the Start button, and then clicking Control Panel. In the search box, type firewall, and then click Windows Firewall.
In the left pane, click Advanced settings. Administrator permission required If you're prompted for an administrator password or confirmation, type the password or provide confirmation.
In the Windows Firewall with Advanced Security dialog box, in the left pane, click Inbound Rules, and then, in the right pane, click New Rule.
Now select port and click next, now enter your port in specific local ports OR check on All local port.
Select your preferred setting on next two panel, and the last give your Inbound rule.
References:
How to Install netstat Command in Linux. https://www.tecmint.com/install-netstat-in-linux/

Comments