- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- killing a specific TCP session
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-06-2008 09:01 PM
тАО07-06-2008 09:01 PM
killing a specific TCP session
Does HP-UX provide a system call (assuming root privilege) that can kill a specific TCP session? We would like to be able to interrupt any TCP connection to the host based on the IP address and TCP port numbers.
Thanks,
Senthil.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-06-2008 09:15 PM
тАО07-06-2008 09:15 PM
Re: killing a specific TCP session
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-06-2008 09:23 PM
тАО07-06-2008 09:23 PM
Re: killing a specific TCP session
Well, you can identify and kill a process associated to the ip address. Is this what you're looking for? For this use netstat.
netstat -an | grep port / ip
You can then use 'ps' command or the 'lsof' command to either examine the process or the open files being used by the process. Then its just 'kill -9 pid'.
Is this what you're looking for?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-06-2008 09:37 PM
тАО07-06-2008 09:37 PM
Re: killing a specific TCP session
# netstat -an | grep 65154
tcp4 0 0 *.65154 *.* LISTEN
# lsof -i tcp:65154
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
java 430100 was 255u IPv4 0xf100020003cc3390 0t0 TCP *:65154 (LISTEN)
Download from here:
http://hpux.cs.utah.edu/hppd/hpux/Sysadmin/lsof-4.80/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-07-2008 05:17 PM
тАО07-07-2008 05:17 PM
Re: killing a specific TCP session
Is there a specific reason you want to be able to reach-out and terminate a given TCP connection with extreme predjudice?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-07-2008 07:56 PM
тАО07-07-2008 07:56 PM
Re: killing a specific TCP session
For example, Solaris provides an ioctl (TCP_IOC_ABORT_CONN) command to kill a given TCP connection, given the ip address and port number pairs.
This was allegedly ported from the BSD (OpenBSD, FreeBSD, NetBSD) implementation of tcpdrop. We were wondering if HP UX also has a feature like a system call to terminate a TCP connection.
Thnaks,
Senthil.
Will be soon assigning points to all those who replied.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-07-2008 08:09 PM
тАО07-07-2008 08:09 PM
Re: killing a specific TCP session
Please check my script below ,
Note:-substitude your ip address with "192.168.053.050"
#!/usr/bin/sh
> /portid
ndd -get /dev/tcp tcp_status |grep -i tcp_established |grep "192.168.053.050" | awk '{print $1}' > /portid
P=`cat /portid |wc -l`
echo $P
if [ $P -gt "0" ]
then
echo "Clearing the port/ports"
for i in `cat /portid`
do
ndd -set /dev/tcp tcp_discon 0x$i
done
else echo "Port is already cleared"
fi
Thanks ,
Aneesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-07-2008 11:56 PM
тАО07-07-2008 11:56 PM
Re: killing a specific TCP session
do the tcp_discon* tunables require a certain patch to become operational on B.11.11?
e.g.
# ndd -h unsupported|grep tcp_discon
tcp_discon - Terminate a TCP connection
tcp_discon_by_addr - Terminate a TCP connection
# ndd -h supported|grep -c tcp_discon
0
# ndd -h tcp_discon
Unknown tunable parameter: tcp_discon
# ndd -h tcp_discon_by_addr
Unknown tunable parameter: tcp_discon_by_addr
# uname -srv
HP-UX B.11.11 U
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-08-2008 01:00 AM
тАО07-08-2008 01:00 AM
Re: killing a specific TCP session
>do the tcp_discon* tunables require a certain patch to become operational on B.11.11?
I couldn`t able to find any patches to make it supported ,but I can able to use tcp_discon on 11.11 :).
Even on 11.31 also tcp_discon shows unsupported
fyi:-
# uname -srv;ndd -h unsupported |grep tcp_discon
HP-UX B.11.31 U
tcp_discon - Terminate a TCP connection
tcp_discon_by_addr - Terminate a TCP connection
#
Thanks,
Aneesh