While working on VMware Unified Access Gateway, we needed to test TCP/UDP port connectivity from within the appliance to a syslog server.

The appliance did not have the usual go to tool, netcat. So, what are the alternatives to test port connectivity in Linux?

Interestingly, you can use bash to test port connectivity for you, like below:

To test tcp port connectivity to 192.168.1.1 on port 514, use the command

localhost:~# cat < /dev/tcp/192.168.1.1/514

If the connection is not successful, you would notice an error similar to:

-bash: connect: Connection refused
-bash: /dev/tcp/192.168.1.1/514: Connection refused