<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-15"
 http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Hi Peter,<br>
<br>
Peter Garrett schrieb:
<blockquote
 cite="mid:20080405070529.26fe8dc8.peter.garrett@optusnet.com.au"
 type="cite">
  <pre wrap="">On Fri, 04 Apr 2008 20:24:16 +0200
<a class="moz-txt-link-rfc2396E" href="mailto:ml@bortal.de">"ml@bortal.de"</a> <a class="moz-txt-link-rfc2396E" href="mailto:ml@bortal.de"><ml@bortal.de></a> wrote:

  </pre>
  <blockquote type="cite">
    <pre wrap="">i would like to send some data from a netcat client to a netcat server.
Can you set up the netcat server so that it echos what he recieves?
    </pre>
  </blockquote>
  <pre wrap=""><!---->
As I understand it, netcat acts as both a client and server, effectively,
depending on which end you look at it from ;) So I'm not sure what you mean
here. 

  </pre>
  <blockquote type="cite">
    <pre wrap="">Background: I would like to test my firewall setup if all my open ports
(tcp and udp) work. So i want to send some data and check if the same
data comes back.

Can netcat do that? (no i dont want to use nmap :) )
    </pre>
  </blockquote>
  <pre wrap=""><!---->
You can use netcat ( nc ) to "scan" ports - for example:
  </pre>
</blockquote>
I actually do not want to find open port, but test if my open ports can
be reached (UDP and TCP).<br>
<blockquote
 cite="mid:20080405070529.26fe8dc8.peter.garrett@optusnet.com.au"
 type="cite">
  <pre wrap="">
nc -w 2 -z name-or-IP 80

checks if the system at "name-or-IP" is listening on port 80 . The -w
option is a "timeout" in seconds. If successful, nc exits silently. If
not, you see an error message. 

For example:

$ nc -w 2 -z archive.ubuntu.com 80                     # OK - silent exit 
$ nc -w 2 -z archive.ubuntu.com.bogus 80 
archive.ubuntu.com.bogus: forward host lookup failed: Unknown host :
Connection timed out

  </pre>
</blockquote>
A UDP Port never replies by default. Thats why i need some
client/server setup to check if the udp port is really open (or better:
if the udp port is allowed by the firewall inbetween!)<br>
<br>
Thanks, Mario<br>
<blockquote
 cite="mid:20080405070529.26fe8dc8.peter.garrett@optusnet.com.au"
 type="cite">
  <pre wrap="">
Peter

  </pre>
</blockquote>
<br>
</body>
</html>