We help IT Professionals succeed at work.

upd port test

Shen
Shen asked
on
How can we test a udp port from a unix solaris machine
Comment
Watch Question

Zephyr ICTCloud Architect
Commented:
Since udp is connection-less you need to send data to it ...

There is a way to test it with netcat, something like this:

nc -u <your-host> <udp-port>

Open in new window

Topic Advisor
Most Valuable Expert 2016
Commented:
Yes you can test that with netcat (nc), an example:

On your solaris machine setup nc to listen on a UDP port:
nc -luv -p 1234 > output.txt

Open in new window

( this will setup nc to listen on local UDP port 1234 and anything that is received gets redirected to the file output.txt)

On another machine setup nc to send something, for a example a text file called input.txt:
nc -vu <ip address of solaris machine> 1234 < input.txt

Open in new window

The v option gives you verbose output, you should see a connection message and a transfer message.

Author

Commented:
tried to run the nc but  command but is not found
Zephyr ICTCloud Architect

Commented:
You might need to install it first... You can find it here: https://www.opencsw.org/package/netcat/ 

But maybe you have a different system? What's your version of Solaris?
Gerwin Jansen, EE MVETopic Advisor
Most Valuable Expert 2016

Commented:

Author

Commented:
Sun4v Sparc Sunw Sparc-Enterprise-t5120

Author

Commented:
i was able to download it from http://netcat.sourceforge.net/download.php. The other link did not work.

The file downloaded:  netcat-0.7.1.tar.gz.  Is this the file for our OS. If so on what directory in Unix  should i install this.
Gerwin Jansen, EE MVETopic Advisor
Most Valuable Expert 2016

Commented:
This is a file with the sources of nc - you need to unpack and then compile them. You do have C compiler installed I hope? Anyone like a system manager that can help you with that? If not we need to find you a binary, what exact Solaris version do you have?

Author

Commented:
i copied the file to: /var/tmp
then gunzip  netcat-0.71.tar.gz
then tar -xvf netcat-0.7.1.tar
then cd netcat-0.7.1
then ./configure
then tried: make -- does not work

Author

Commented:
uname -a
SUNOS 5.10 ... sun4v sparc SUNW, SPARC-Enterprise-T5120
Gerwin Jansen, EE MVETopic Advisor
Most Valuable Expert 2016

Commented:
Any output of the configure command? What is the output of the make command?

Author

Commented:
make not found

Author

Commented:
Like you said it looks likea compiler issue. Is there any way to check if i have a c compiler

 when i ran ./configure i saw:

configuration: error: no acceptable c compiler found in $PATH
Gerwin Jansen, EE MVETopic Advisor
Most Valuable Expert 2016

Commented:
Yes, you need a C compiler, make etc. Anyone that can install those for you?
Gerwin Jansen, EE MVETopic Advisor
Most Valuable Expert 2016

Commented:
Do you have pkgadd? If so you could try and install like this instead:

pkgadd -d http://get.opencsw.org/now
/opt/csw/bin/pkgutil -U
/opt/csw/bin/pkgutil -y -i netcat
/usr/sbin/pkgchk -L CSWnetcat # list files

(source: https://www.opencsw.org/packages/CSWnetcat/)

Author

Commented:
just before your response i added tothe the path

PATH=$path:/usr/sww/bin. Thne ran ./configure and the config.lo file show exit 0. Looks like i ran successfully. Howerver, i tried make and it still doesn ot work.

I will try pkgadd.

Author

Commented:
Correction:

PATH=$path:/usr/sfw/bin

Author

Commented:
this server does not have internet connection.
so from another computer i download from: http://get.opencsw.org/now the file: "now". Is this correct
Gerwin Jansen, EE MVETopic Advisor
Most Valuable Expert 2016

Commented:
This won't work, better chance to get a compiler installed I guess.

Author

Commented:
do you know how to get the compiler
Gerwin Jansen, EE MVETopic Advisor
Most Valuable Expert 2016

Commented:
I would try the Oracle site maybe, couldn't find it at the gnu.org site.

Author

Commented:
I was able to compile netcat .  After finding the make command location , added it to the path,then ran the make command and make install

Author

Commented:
thanks for the help.  It works