- Newest
- Most votes
- Most comments
Hello.
If you just want to do a port scan you can use the "nmap" command.
https://linux.die.net/man/1/nmap
Is the "nmap" command not enough to meet your needs?
# TCP
nmap -sT <Server IP Address>
# UDP
nmap -sU <Server IP Address>
In scenarios where you have access to both the client and server but need to test connectivity through a 'black box' network (likely protected by a firewall), port scanning with nmap will most likely be blocked by the firewall/middle box. Instead, I suggest using netcat, which is typically pre-installed on many systems and supports both TCP and UDP connections. It's better to test specific ports or port ranges systematically rather than attempting to scan all 65,535 ports.
On client C (test connection):
for port in 22 80 443 8080 8443; do
nc -zv server_ip $port
done
Then expand to ranges if needed:
for port in {8000..8100}; do
nc -zv server_ip $port
done
answered a year ago
I assume for the TCP ports it will mark every port with a RST response as open. correct me if I'm wrong. how will it determine the UDP ones as there is not RST in UDP?
Relevant content
- AWS OFFICIALUpdated 4 months ago
- AWS OFFICIALUpdated a year ago

will it need a process on the server to handshake to? or simply it will consider any port with RST response as being open?