4,512
edits
→Networking: opening and closing ports |
|||
Line 308: | Line 308: | ||
|- | |- | ||
| Scan a network for connected computers | | Scan a network for connected computers | ||
| class="cli" | sudo nmap -sP 129.24.22.0/24 | | class="cli" | $ sudo nmap -sP 129.24.22.0/24 | ||
| | | | ||
|} | |||
== Firewall == | |||
{| class="wikitable" border="1" style="border-collapse:collapse" | |||
! style="text-align: center;"| Description | |||
! Command | |||
! Distro | |||
|- | |- | ||
| Open a firewall port | | Open a firewall port | ||
| class="cli" | sudo firewall-cmd --zone=public --add-port=55301/tcp --permanent | | class="cli" | $ sudo ufw allow 55301 | ||
| | |||
|- | |||
| Open a firewall port | |||
| class="cli" | $ sudo firewall-cmd --zone=public --add-port=55301/tcp --permanent<br>$ sudo firewall-cmd --reload | |||
| {{testedon|2020-04-21|CentOS 7.7.1908}} | |||
|- | |||
| Close a firewall port | |||
| class="cli" | $ sudo ufw deny 55301 | |||
| {{testedon|2020-04-21|CentOS 7.7.1908}} | |||
|- | |||
| Close a firewall port | |||
| class="cli" | $ sudo firewall-cmd --zone=public --remove-port=55301/tcp --permanent<br>$ sudo firewall-cmd --reload | |||
| {{testedon|2020-04-21|CentOS 7.7.1908}} | | {{testedon|2020-04-21|CentOS 7.7.1908}} | ||
|} | |} |