How to Kill a Single TCP Connection on the NetScaler

How to Kill a Single TCP Connection on the NetScaler

book

Article ID: CTX120663

calendar_today

Updated On:

Description

This article describes how to kill an individual connection on the NetScaler.


Instructions

You can kill a single connection on the NetScaler without affecting other connections by using the nsapimgr command. Using the command nsapimgr -d allpcbs shows all active connections. You must first locate the connection as follows.
  1. Locate the connection. The connection to kill in this example is in bold. In this case, the Local-IP-Port is the VIP and the Remote-IP-Port is the client's IP address and port. 

    root@ns# nsapimgr -d allpcbs
    Displaying all PCB entries ...

    Index  t_flags pcbdevno lnkdevno st remote-IP-port        local-IP-port
        0 40000002  5427125  5427124  4    10.217.6.247    22   10.217.253.53  2062
        1 40000A02  5429926        0  4    10.217.6.251    80    10.217.6.248 24546
        2 40000201  5429946        0  4   10.217.253.53  3934    10.217.6.245    80    
        3 400000C2  5429940        0 10       127.0.0.1  7776       127.0.0.2 27047
        4 400000C2  5429923        0 10       127.0.0.1  7776       127.0.0.2  3619
        5 400000C2  5429952        0 10       127.0.0.1  7776       127.0.0.2 31197
        6 400000C2  5429945        0 10       127.0.0.1  7776       127.0.0.2 17746
        7 40000001  5427124  5427125  4   10.217.253.53  2062    10.217.6.247    22
        8 40000002  5429418  5429405  4    10.217.6.247    22   10.217.253.53  3684
        9 400000C2  5429937        0 10       127.0.0.1  7776       127.0.0.2 38949
       10 40000002  5427189  5427188  4    10.217.6.247    22   10.217.253.53  2076
       11 40000001  5427188  5427189  4   10.217.253.53  2076    10.217.6.247    22
       12 40000002  5429442  5429441  4    10.217.6.247    22   10.217.253.53  3693
       13 40000001  5475899        0  4       127.0.0.1  3021    10.217.6.247  3011
       14 40000001  5429441  5429442  4   10.217.253.53  3693    10.217.6.247    22
       15 400000C2  5429944        0 10       127.0.0.1  7776       127.0.0.2 37428
       16 400000C2  5429939        0 10       127.0.0.1  7776       127.0.0.2 45990
       17 40000001  5429405  5429418  4   10.217.253.53  3684    10.217.6.247    22
       18 400000C2  5429928        0 10       127.0.0.1  7776       127.0.0.2 49412
       19 400000C2  5429942        0 10       127.0.0.1  7776       127.0.0.2 55070
  2. Use the following command to kill the connection:
    root@ns# nsapimgr -ys  fip=10.217.253.53 -ys fport=3934   -ys lip=10.217.6.245 -ys lport=80 -yf onepcb

Note: You can combine the nsapimgr -d allpcbs command with grep to narrow your search.

Issue/Introduction

This article describes how to kill an individual connection on the NetScaler.