Questions tagged [netstat]

netstat is a tool for viewing active network connections, listeners and sockets.

netstat is a tool for viewing active network connections, listeners and sockets.

322 questions
284
votes
5 answers

What's the difference between IP address 0.0.0.0 and 127.0.0.1?

I know that 127.0.0.1 ~ 127.255.255.254 are the loopback IP addresses for most modern operating systems, and these IP addresses can be used to refer to our own computer. But what's 0.0.0.0? It seems it also refers to the local computer, so what's…
Jichao
  • 3,037
  • 4
  • 18
  • 14
51
votes
4 answers

How do I make cURL use keepalive from the command line?

I'm trying to verify that HTTP persistent connections are being used during communication with a Tomcat webserver I've got running. Currently, I can retrieve a resource on my server from a browser (e.g. Chrome) and verify using netstat that the…
Rob Hruska
  • 683
  • 1
  • 5
  • 10
48
votes
7 answers

How to find other end of unix socket connection?

I have a process (dbus-daemon) which has many open connection over UNIX sockets. One of these connections is fd #36: =$ ps uw -p 23284 USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND depesz 23284 0.0 0.0 24680 1772 ? …
user13185
38
votes
7 answers

netstat shows a listening port with no pid but lsof does not

This question is similar to Network port open, but no process attached? I've tried everything from there, reviewed the logs, etc... and can't find anything. My netstat shows a TCP listening port and a UDP port without a pid. When I search lsof for…
mhost
  • 1,179
  • 3
  • 16
  • 25
38
votes
7 answers

Huge amount of TIME_WAIT connections says netstat

Okay, this is creeping me out - I see about 1500-2500 of these: root@wherever:# netstat Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 localhost:60930 localhost:sunrpc TIME_WAIT …
KTamas
  • 589
  • 1
  • 8
  • 15
30
votes
6 answers

Network port open, but no process attached?

I have a weird situation going on with an open network port. My main question is, why would there not be a program associated with an open TCP port: netstat -ln --program Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address …
Gary Richardson
  • 1,827
  • 3
  • 20
  • 21
28
votes
9 answers

How do I get rid of sockets in FIN_WAIT1 state?

I have a port that is blocked by a process I needed to kill. (a little telnet daemon that crashed). The process was killed successfully but the port is still in a 'FIN_WAIT1' state. It doesn't come out of it, the timeout for that seems to be set to…
Gert M
  • 1,471
  • 1
  • 15
  • 14
28
votes
5 answers

Netstat continuous refresh (watch changes the output)

I am using this simple command to monitor connections (to deal with some recent DoS attacks) on my Debian server: netstat -ntu | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n How do I run it continuously? So it will refresh itself once…
Ruslan Osipov
  • 381
  • 1
  • 3
  • 7
23
votes
5 answers

netstat -ntap doesn't show pid/process name for some connections?

I have ubuntu/hardy server, with kernel 2.6.24-23-server and netstat: # netstat --version net-tools 1.60 netstat 1.42 (2001-04-15) The problem is that we have a lot of ESTABLISHED connections that don't show PID nor Program name in netstat -ntap…
user13185
17
votes
10 answers

Port 80 is being used by SYSTEM (PID 4), what is that?

I am trying to use port 80 for my application server, but when I perform "netstat -aon" I get TCP 0.0.0.0:80 0.0.0.0:0 LISTENING 4 When I look up the process in task manager, it shows PID 4 is SYSTEM, thats it, not…
GiH
14
votes
2 answers

How to make netstat on Linux only show OUTBOUND tcp connections?

My ubuntu server is infected and there is a process making a bunch of HTTP requests to a bunch of websites (sucks!). I have added the following to my firewall (UFW): sudo ufw deny out proto tcp to any port 1:65535 To Action …
David Coch
  • 141
  • 1
  • 1
  • 5
14
votes
1 answer

Netstat hangs: why?

Sometimes (not too often at all) when I type "netstat", it takes over 5 seconds to return. While other times is instantaneous. I have been observing this for weeks on my server (CentOS 6.4), but I don't understand why!? Can anyone give an…
Daniele B
  • 367
  • 1
  • 4
  • 14
13
votes
5 answers

linux : netstat listening queue length

Is there a way to view queue length on listening socket under Linux, the same way as netstat -L outputs for FreeBSD? I.e. you can see X/Y/Z in netstat -L output, but netstat under Linux doesn't support -L flag.
Artem G
  • 351
  • 1
  • 2
  • 6
13
votes
4 answers

TCP monitoring on a server: comparing netstat vs lsof?

I'm monitoring the TCP stack on a server hoping to generically infer problems with application on the box. My first inclination is to measure the number of sockets in all reported states (LISTEN,ESTABLISHED,FIN_WAIT2,TIME_WAIT, etc) and detect some…
ericslaw
  • 1,572
  • 2
  • 13
  • 15
13
votes
3 answers

Semantics of :: and 0.0.0.0 in dual-stack OSes

Back in the IPv4-only days, a LISTEN connection showing in netstat as listening on 0.0.0.0 would respond to connections on any IPv4 interface in the system. As I understand it, the new IPv6 idiom :: listens on all available IPv6 and IPv4 interfaces.…
Alex J
  • 2,844
  • 2
  • 23
  • 24
1
2 3
21 22