Find the answer to your Linux question:
Page 2 of 2 FirstFirst 1 2
Results 11 to 19 of 19
You're really good and I truly appreciate your help my friend. Forgive me for asking (lol) but if you have any "newbie" or somewhat any Linux related help sites, links ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #11
    Just Joined!
    Join Date
    Oct 2004
    Posts
    52

    You're really good and I truly appreciate your help my friend. Forgive me for asking (lol) but if you have any "newbie" or somewhat any Linux related help sites, links to share I'd appreciate that.

    For anyone on the board (newbies perhaps) needing linux help sites, these are what I know:
    http://www.webhostgear.com/35.html
    http://www.oreillynet.com/linux/cmd/

    I got this (and didn't want to guess which command it was). FYI, I'm on a Fedora Core 2 OS, not sure if it makes much difference but figured I'd mention that.

    root@server [~]# netstat -n -I
    netstat: invalid option -- I
    usage: netstat [-veenNcCF] [<Af>] -r netstat {-V|--version|-h|--help}
    netstat [-vnNcaeol] [<Socket> ...]
    netstat { [-veenNac] -i[<Iface>] | [-cnNe] -M | -s } [delay]

    -r, --route display routing table
    -i, --interfaces=[<Iface>] display interface table
    -g, --groups display multicast group memberships
    -s, --statistics display networking statistics (like SNMP)
    -M, --masquerade display masqueraded connections

    -v, --verbose be verbose
    -n, --numeric don't resolve names
    --numeric-hosts don't resolve host names
    --numeric-ports don't resolve port names
    --numeric-users don't resolve user names
    -N, --symbolic resolve hardware names
    -e, --extend display other/more information
    -p, --programs display PID/Program name for sockets
    -c, --continuous continuous listing

    -l, --listening display listening server sockets
    -a, --all, --listening display all sockets (default: connected)
    -o, --timers display timers
    -F, --fib display Forwarding Information Base (default)
    -C, --cache display routing cache instead of FIB

    <Iface>: Name of interface to monitor/list.
    <Socket>={-t|--tcp} {-u|--udp} {-w|--raw} {-x|--unix} --ax25 --ipx --netrom
    <AF>=Use '-A <af>' or '--<af>'; default: inet
    List of possible address families (which support routing):
    inet (DARPA Internet) inet6 (IPv6) ax25 (AMPR AX.25)
    netrom (AMPR NET/ROM) ipx (Novell IPX) ddp (Appletalk DDP)
    x25 (CCITT X.25)

  2. #12
    Linux Engineer
    Join Date
    Sep 2003
    Location
    Knoxhell, TN
    Posts
    1,078
    oh.. the font in my Eterm sucks..
    Code:
    netstat -n -l
    (that's a lowercase 'L')
    Their code will be beautiful, even if their desks are buried in 3 feet of crap. - esr

  3. #13
    Just Joined!
    Join Date
    Oct 2004
    Posts
    52
    Ok I ran it, sorry to sound excessivley "newbie" but if I'm not mistaking, "listen" means already in use, and blank (under that same column) means the port is free? And where exactly is the port number on each line? I'm guessing under the third column correct? I notice some obvious ones with "listen", so I know they are in use already. So, any number not there is basically free?

    Code:
    root@server &#91;~&#93;# netstat -n -l
    Active Internet connections &#40;only servers&#41;
    Proto Recv-Q Send-Q Local Address           Foreign Address         State
    tcp        0      0 0.0.0.0&#58;993             0.0.0.0&#58;*               LISTEN
    tcp        0      0 0.0.0.0&#58;1               0.0.0.0&#58;*               LISTEN
    tcp        0      0 0.0.0.0&#58;2082            0.0.0.0&#58;*               LISTEN
    tcp        0      0 0.0.0.0&#58;2083            0.0.0.0&#58;*               LISTEN
    tcp        0      0 0.0.0.0&#58;995             0.0.0.0&#58;*               LISTEN
    tcp        0      0 0.0.0.0&#58;2084            0.0.0.0&#58;*               LISTEN
    tcp        0      0 0.0.0.0&#58;2086            0.0.0.0&#58;*               LISTEN
    tcp        0      0 0.0.0.0&#58;2087            0.0.0.0&#58;*               LISTEN
    tcp        0      0 0.0.0.0&#58;6666            0.0.0.0&#58;*               LISTEN
    tcp        0      0 0.0.0.0&#58;3306            0.0.0.0&#58;*               LISTEN
    tcp        0      0 0.0.0.0&#58;110             0.0.0.0&#58;*               LISTEN
    tcp        0      0 0.0.0.0&#58;2095            0.0.0.0&#58;*               LISTEN
    tcp        0      0 127.0.0.1&#58;783           0.0.0.0&#58;*               LISTEN
    tcp        0      0 0.0.0.0&#58;143             0.0.0.0&#58;*               LISTEN
    tcp        0      0 0.0.0.0&#58;111             0.0.0.0&#58;*               LISTEN
    tcp        0      0 0.0.0.0&#58;2096            0.0.0.0&#58;*               LISTEN
    tcp        0      0 0.0.0.0&#58;80              0.0.0.0&#58;*               LISTEN
    tcp        0      0 0.0.0.0&#58;465             0.0.0.0&#58;*               LISTEN
    tcp        0      0 xx.x.177.191&#58;53         0.0.0.0&#58;*               LISTEN
    tcp        0      0 xx.x.177.190&#58;53         0.0.0.0&#58;*               LISTEN
    tcp        0      0 xx.x.177.189&#58;53         0.0.0.0&#58;*               LISTEN
    tcp        0      0 xx.x.177.188&#58;53         0.0.0.0&#58;*               LISTEN
    tcp        0      0 xx.x.177.187&#58;53         0.0.0.0&#58;*               LISTEN
    tcp        0      0 xx.x.177.186&#58;53         0.0.0.0&#58;*               LISTEN
    tcp        0      0 xx.x.177.185&#58;53         0.0.0.0&#58;*               LISTEN
    tcp        0      0 xx.x.177.184&#58;53         0.0.0.0&#58;*               LISTEN
    tcp        0      0 xx.x.166.223&#58;53         0.0.0.0&#58;*               LISTEN
    tcp        0      0 xx.x.166.222&#58;53         0.0.0.0&#58;*               LISTEN
    tcp        0      0 xx.x.166.221&#58;53         0.0.0.0&#58;*               LISTEN
    tcp        0      0 xx.x.166.220&#58;53         0.0.0.0&#58;*               LISTEN
    tcp        0      0 xx.x.166.219&#58;53         0.0.0.0&#58;*               LISTEN
    tcp        0      0 xx.x.166.218&#58;53         0.0.0.0&#58;*               LISTEN
    tcp        0      0 xx.x.166.217&#58;53         0.0.0.0&#58;*               LISTEN
    tcp        0      0 xx.x.166.216&#58;53         0.0.0.0&#58;*               LISTEN
    tcp        0      0 xx.x.166.215&#58;53         0.0.0.0&#58;*               LISTEN
    tcp        0      0 xx.x.166.214&#58;53         0.0.0.0&#58;*               LISTEN
    tcp        0      0 xx.x.166.213&#58;53         0.0.0.0&#58;*               LISTEN
    tcp        0      0 xx.x.166.212&#58;53         0.0.0.0&#58;*               LISTEN
    tcp        0      0 xx.x.166.211&#58;53         0.0.0.0&#58;*               LISTEN
    tcp        0      0 xx.x.166.210&#58;53         0.0.0.0&#58;*               LISTEN
    tcp        0      0 xx.x.166.209&#58;53         0.0.0.0&#58;*               LISTEN
    tcp        0      0 xx.x.166.208&#58;53         0.0.0.0&#58;*               LISTEN
    tcp        0      0 xx.x.166.50&#58;53          0.0.0.0&#58;*               LISTEN
    tcp        0      0 127.0.0.1&#58;53            0.0.0.0&#58;*               LISTEN
    tcp        0      0 0.0.0.0&#58;21              0.0.0.0&#58;*               LISTEN
    tcp        0      0 0.0.0.0&#58;5432            0.0.0.0&#58;*               LISTEN
    tcp        0      0 0.0.0.0&#58;25              0.0.0.0&#58;*               LISTEN
    tcp        0      0 127.0.0.1&#58;953           0.0.0.0&#58;*               LISTEN
    tcp        0      0 0.0.0.0&#58;443             0.0.0.0&#58;*               LISTEN
    tcp        0      0 &#58;&#58;&#58;1922                 &#58;&#58;&#58;*                    LISTEN
    tcp        0      0 &#58;&#58;&#58;8009                 &#58;&#58;&#58;*                    LISTEN
    tcp        0      0 &#58;&#58;ffff&#58;127.0.0.1&#58;8905   &#58;&#58;&#58;*                    LISTEN
    tcp        0      0 &#58;&#58;&#58;8080                 &#58;&#58;&#58;*                    LISTEN
    tcp        0      0 &#58;&#58;&#58;21                   &#58;&#58;&#58;*                    LISTEN
    tcp        0      0 &#58;&#58;&#58;22                   &#58;&#58;&#58;*                    LISTEN
    tcp        0      0 &#58;&#58;&#58;9080                 &#58;&#58;&#58;*                    LISTEN
    tcp        0      0 &#58;&#58;&#58;5432                 &#58;&#58;&#58;*                    LISTEN
    udp        0      0 xx.x.177.191&#58;53         0.0.0.0&#58;*
    udp        0      0 xx.x.177.190&#58;53         0.0.0.0&#58;*
    udp        0      0 xx.x.177.189&#58;53         0.0.0.0&#58;*
    udp        0      0 xx.x.177.188&#58;53         0.0.0.0&#58;*
    udp        0      0 xx.x.177.187&#58;53         0.0.0.0&#58;*
    udp        0      0 xx.x.177.186&#58;53         0.0.0.0&#58;*
    udp        0      0 xx.x.177.185&#58;53         0.0.0.0&#58;*
    udp        0      0 xx.x.177.184&#58;53         0.0.0.0&#58;*
    udp        0      0 xx.x.166.223&#58;53         0.0.0.0&#58;*
    udp        0      0 xx.x.166.222&#58;53         0.0.0.0&#58;*
    udp        0      0 xx.x.166.221&#58;53         0.0.0.0&#58;*
    udp        0      0 xx.x.166.220&#58;53         0.0.0.0&#58;*
    udp        0      0 xx.x.166.219&#58;53         0.0.0.0&#58;*
    udp        0      0 xx.x.166.218&#58;53         0.0.0.0&#58;*
    udp        0      0 xx.x.166.217&#58;53         0.0.0.0&#58;*
    udp        0      0 xx.x.166.216&#58;53         0.0.0.0&#58;*
    udp        0      0 xx.x.166.215&#58;53         0.0.0.0&#58;*
    udp        0      0 xx.x.166.214&#58;53         0.0.0.0&#58;*
    udp        0      0 xx.x.166.213&#58;53         0.0.0.0&#58;*
    udp        0      0 xx.x.166.212&#58;53         0.0.0.0&#58;*
    udp        0      0 xx.x.166.211&#58;53         0.0.0.0&#58;*
    udp        0      0 xx.x.166.210&#58;53         0.0.0.0&#58;*
    udp        0      0 xx.x.166.209&#58;53         0.0.0.0&#58;*
    udp        0      0 xx.x.166.208&#58;53         0.0.0.0&#58;*
    udp        0      0 xx.x.166.50&#58;53          0.0.0.0&#58;*
    udp        0      0 127.0.0.1&#58;53            0.0.0.0&#58;*
    udp        0      0 0.0.0.0&#58;37048           0.0.0.0&#58;*
    udp        0      0 0.0.0.0&#58;56672           0.0.0.0&#58;*
    udp        0      0 &#58;&#58;&#58;37049                &#58;&#58;&#58;*
    Active UNIX domain sockets &#40;only servers&#41;
    Proto RefCnt Flags       Type       State         I-Node Path
    unix  2      &#91; ACC &#93;     STREAM     LISTENING     182057521 /var/lib/mysql/mysql
    .sock
    unix  2      &#91; ACC &#93;     STREAM     LISTENING     142191678 /var/run/ftpd.sock
    unix  2      &#91; ACC &#93;     STREAM     LISTENING     171307779 /tmp/.s.PGSQL.5432
    unix  2      &#91; ACC &#93;     STREAM     LISTENING     193004922 /var/clamd

  4. #14
    Just Joined!
    Join Date
    Oct 2004
    Posts
    52
    By the way, for security I replaced the first few IP digits on the lines with "x"

  5. #15
    Linux Engineer
    Join Date
    Sep 2003
    Location
    Knoxhell, TN
    Posts
    1,078
    what that is showing is all of the ports that have a program waiting for connections...

    if you just type 'man netstat' it should bring up the manpage... there are a *lot* more options you can use to gather info about the network interface...

    the port is the number after the : in the IP addresses...
    Their code will be beautiful, even if their desks are buried in 3 feet of crap. - esr

  6. #16
    Just Joined!
    Join Date
    Oct 2004
    Posts
    52
    When you say waiting for connections are you saying they are basically free? Because I know cpanel itself by default uses ports 2082, 2083, 2095, 2086, 2087, 2096 which you can see is in the list.

  7. #17
    Linux Engineer
    Join Date
    Sep 2003
    Location
    Knoxhell, TN
    Posts
    1,078
    what that means is that there is already a daemon/server listening for incoming connections on that port.... in other words, another program has already claimed it.
    Their code will be beautiful, even if their desks are buried in 3 feet of crap. - esr

  8. #18
    Just Joined!
    Join Date
    Oct 2004
    Posts
    52
    Ok so to make it my final question, any number not listed there is a free port? What constitutes a good free port, or guessing for a good number not on a list? I assume one factor is a high number, preferably 3 or 4 digits.

  9. #19
    Linux Engineer
    Join Date
    Sep 2003
    Location
    Knoxhell, TN
    Posts
    1,078
    just pick a randomly high number that you can remember...
    Their code will be beautiful, even if their desks are buried in 3 feet of crap. - esr

Page 2 of 2 FirstFirst 1 2

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •