AIX - Ports in use and how to check them

Posted on 2012-09-07
Last Modified: 2012-09-10
I have two issues below that I need help with.

First, I have an  example port receiving details that it is in use or blocked. How do I check to see what is using this port?

servername:/> netstat | grep -v grep | grep 201

udp4       0      0  servername.201    *.*

Second, I have an application that uses ports 1911-1919. These are application specific ports. How do I check what is using them and how to free up the ports?

servername:/> netstat -an | grep .191
tcp        0      0  1X.2XX.XXX.XX.9638    XX.XXX.XXX.XX.1913    ESTABLISHED
tcp        0      0  1X.2XX.XXX.XX.9639     XX.XXX.XXX.XX.1913    ESTABLISHED
tcp        0      0  1X.2XX.XXX.XX.9640     XX.XXX.XXX.XX.1913    ESTABLISHED
tcp        0      0  1X.2XX.XXX.XX.9641     XX.XXX.XXX.XX.1913    ESTABLISHED
tcp4       0      0  1X.2XX.XXX.XX.9642     XX.XXX.XXX.XX.1913    ESTABLISHED
tcp4       0      0  *.1911                *.*                    LISTEN
tcp4       0      0  *.1912                *.*                    LISTEN
tcp4       0      0  *.1914                *.*                    LISTEN
tcp4       0      0  *.1913                *.*                    LISTEN
Question by:AIX25
    LVL 40

    Assisted Solution

    LVL 68

    Accepted Solution

    And if you don't want to (or can't) use lsof:

    1) Issue

    netstat -Aan | grep <portno>

    2) Use the address displayed in the first column (the PCB = protocol control block) to issue:

    rmsock <pcb_address> tcpcb

    Example for port 13 (inetd):

    netstat -Aan | grep "*.13 "
    f100060001814b98 tcp4       0      0  *.13               *.*                LISTEN

    rmsock f100060001814b98 tcpcb
    The socket 0x1814808 is being held by proccess 131162 (inetd).

    Freeing up ports is only possible by killing the processes which use them.

    Author Comment

    I used both methods and both worked properly.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    My previous tech tip, Installing the Solaris OS From the Flash Archive On a Tape (, discussed installing the Solaris Operating S…
    I have been running these systems for a few years now and I am just very happy with them.   I just wanted to share the manual that I have created for upgrades and other things.  Oooh yes! FreeBSD makes me happy (as a server), no maintenance and I al…
    In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.
    Video by: Phil
    This video goes over how to configure and start a jail in FreeBSD.  This video is meant to supplement the article included with this course.

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now