upd port test

How can we test a udp port from a unix solaris machine
ShenAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Zephyr ICTCloud ArchitectCommented:
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

Gerwin Jansen, EE MVETopic Advisor 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.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ShenAuthor Commented:
tried to run the nc but  command but is not found
OWASP: Threats Fundamentals

Learn the top ten threats that are present in modern web-application development and how to protect your business from them.

Zephyr ICTCloud ArchitectCommented:
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 Commented:
ShenAuthor Commented:
Sun4v Sparc Sunw Sparc-Enterprise-t5120
ShenAuthor 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 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?
ShenAuthor 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
ShenAuthor Commented:
uname -a
SUNOS 5.10 ... sun4v sparc SUNW, SPARC-Enterprise-T5120
Gerwin Jansen, EE MVETopic Advisor Commented:
Any output of the configure command? What is the output of the make command?
ShenAuthor Commented:
make not found
ShenAuthor 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 Commented:
Yes, you need a C compiler, make etc. Anyone that can install those for you?
Gerwin Jansen, EE MVETopic Advisor 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/)
ShenAuthor 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.
ShenAuthor Commented:
Correction:

PATH=$path:/usr/sfw/bin
ShenAuthor 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 Commented:
This won't work, better chance to get a compiler installed I guess.
ShenAuthor Commented:
do you know how to get the compiler
Gerwin Jansen, EE MVETopic Advisor Commented:
I would try the Oracle site maybe, couldn't find it at the gnu.org site.
ShenAuthor 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
ShenAuthor Commented:
thanks for the help.  It works
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Unix OS

From novice to tech pro — start learning today.