Testing firewall rules with netcat

From EggeWiki

It's quite easy to test to see if a firewall will allow traffic on a specific port if you have control of the server behind the firewall. Example:

On the remote side, listen to a port: <geshi lang="bash"> echo 'OMG!' | nc -l -p 5152 </geshi>

On the local side, use telnet or nc to connect to the remote.

<geshi lang="bash"> telnet remote 5152 Trying 10.136.2.242... Connected to remote. Escape character is '^]'. OMG! </geshi>