This guide outlines the basic steps to test firewall configuration on different Linux OS.
Install Nmap on the server with the below command.
# yum install nmap
![linuxnmap1](https://www.layerstack.com/img/docs/resources/linuxnmap1.png)
To test a single TCP port, run the below command.
# nmap -p <port> <ip address="">
Here 445 is the TCP port number and you can use the Original Port number and IP address that wish to test.
![linuxnmap2](https://www.layerstack.com/img/docs/resources/linuxnmap2.png)
Run the below command to test all TCP ports.
# nmap <ip address="">
![linuxnmap3](https://www.layerstack.com/img/docs/resources/linuxnmap3.png)
Run the below command to test all TCP ports and also detect the version. It will detect and show which services and which versions are running.
# nmap -sV <ip address="">
![linuxnmap4](https://www.layerstack.com/img/docs/resources/linuxnmap4.png)
Run the below command to test all TCP ports and run basic security checks. It will help to detect common vulnerabilities and misconfigurations.
# nmap -sC <ip address="">
![linuxnmap5](https://www.layerstack.com/img/docs/resources/linuxnmap5.png)
You can use the below command if need to know more detailed information about the remote machine.
# nmap -v <ip address="">
![linuxnmap6](https://www.layerstack.com/img/docs/resources/linuxnmap6.png)
Run the below command to scan OS information and Traceroute.
# nmap -A <ip address="">
![linuxnmap7](https://www.layerstack.com/img/docs/resources/linuxnmap7.png)
NOTE: Use the Original Port number and IP address that wish to test.
Install Nmap on the server with the below command.
# apt install nmap
![linuxnmap8](https://www.layerstack.com/img/docs/resources/linuxnmap8.png)
To test a single TCP port, run the below command.
# nmap -p <port> <ip address="">
Here 445 is the TCP port number and you can use the Original Port number and IP address that wish to test.
![linuxnmap9](https://www.layerstack.com/img/docs/resources/linuxnmap9.png)
Run the below command to test all TCP ports.
# nmap <ip address="">
![linuxnmap10](https://www.layerstack.com/img/docs/resources/linuxnmap10.png)
Run the below command to test all TCP ports and also detect the version. It will detect and show which services and which versions are running.
# nmap -sV <ip address="">
![linuxnmap11](https://www.layerstack.com/img/docs/resources/linuxnmap11.png)
Run the below command to test all TCP ports and run basic security checks. It will help to detect common vulnerabilities and misconfigurations.
# nmap -sC <ip address="">
![linuxnmap12](https://www.layerstack.com/img/docs/resources/linuxnmap12.png)
You can use the below command if need to know more detailed information about the remote machine.
# nmap -v <ip address="">
![linuxnmap13](https://www.layerstack.com/img/docs/resources/linuxnmap13.png)
Run the below command to scan OS information and Traceroute.
# nmap -A <ip address="">
![linuxnmap14](https://www.layerstack.com/img/docs/resources/linuxnmap14.png)
NOTE: Use the Original Port number and IP address that wish to test.