cancel
Showing results for 
Search instead for 
Did you mean: 

HP-UX:Kill/Shut Ports

AwadheshPandey
Honored Contributor

HP-UX:Kill/Shut Ports

Dear Experts,

I have a port open on my server, but I am not able to find any process associated with it. Please let me know how to close this.

#netstat -an|grep -w 844
udp 0 0 *.844 *.*
# lsof -i udp:844
#
It's kind of fun to do the impossible
5 REPLIES
klb
Valued Contributor

Re: HP-UX:Kill/Shut Ports


Execute the following command:

ndd -get /dev/tcp tcp_status

... to list off all your tcp connections/sockets. Look for your port, 844, in the [lport,fport] column ( in HEX: 844=34C ).

Once you've found the LISTEN socket on that port, use the first column from the ndd output above for that socket and do this:

ndd -set /dev/tcp tcp_discon 0x

... That should take care of your open port, but... you may find that this doesn't really solve your issue. Let us know what happens next.

-klb
AwadheshPandey
Honored Contributor

Re: HP-UX:Kill/Shut Ports

thanks klb for your suggestion.

there is a small change.

I want a solution for udp port. ndd o/p is below.

eux390{root}# ndd -get /dev/udp udp_status|grep 844
000000008fedb0c0 00844 000.000.000.000 000.000.000.000 00000 IDLE
It's kind of fun to do the impossible
Bob_Vance
Esteemed Contributor

Re: HP-UX:Kill/Shut Ports

What is column one of that output?

bv
"The lyf so short, the craft so long to lerne." - Chaucer
Laurent Menase
Honored Contributor

Re: HP-UX:Kill/Shut Ports

to klb tcp_discon is for tcp not udp


eux390{root}# ndd -get /dev/udp udp_status|grep 844
000000008fedb0c0 00844 000.000.000.000 000.000.000.000 00000 IDLE
if it is not seen by lsof it may need 2 possible things:
1) it is a kernel opened connection
2) it is internalized and send through a unix socket.

Don't you use nfs over udp? kernel rpc are not seen by lsof and use reserved ports when using udp.

To identify it you can try to make a network trace, and see if you can find any traffic.
you can also probe rpc traffic to it.

Else there are some hp internal tools which could help you to identify it through hp support direction.

if it is nfs, there is no much you can do.

Why are you trying to close it?

Also is it used on every reboot or only that time?
klb
Valued Contributor

Re: HP-UX:Kill/Shut Ports

> tcp_discon is for tcp not udp

After I posted the ndd stuff, I noticed the OP was referring to a UDP port.

Then noticed there really isn't a similar UDP attribute that could be used to disconnect the port.

-klb