NETSTAT(8) Linux Programmer's Manual NETSTAT(8) NAME netstat - Display network connections, routing tables, interface statistics, masquerade connections, netlink mes- sages, and multicast memberships SYNOPSIS netstat [-venaoc] [--tcp|-t] [--udp|-u] [--raw|-w] [--groups|-g] [--unix|-x] [--inet|--ip] [--ax25] [--ipx] [--netrom] netstat [-veenc] [--inet] [--ipx] [--netrom] [--ddp] [--ax25] {--route|-r} netstat [-veenpac] {--interfaces|-i} [iface] netstat [-enc] {--masquerade|-M} netstat [-cn] {--netlink|-N} netstat {-V|--version} {-h|--help} DESCRIPTION Netstat displays information of the Linux networking sub- system. (no option) You can view the status of network connections by listing the open sockets. This is the default operation: If you don't specify any address families, then the active sock- ets of all configured address families will be printed. With -e you get some additional informations (userid). With the -v switch you can make netstat complain about known address families which are not supported by the ker- nel. The -o option displays some additional information on networking timers. Enabling the -p will show you the pro- cess PID and name of the program holding the socket. -a print all sockets, including the listening server sockets. The address family inet will display raw, udp and tcp sockets. net-tools 25 Feb 1999 NETSTAT(8) Linux Programmer's Manual NETSTAT(8) -r, --route With the -r, --route option, you get the kernel routing tables in the same format as route -e use. netstat -er will use the output format of route. Please see route(8) for details. -g, --groups With the .BR -g ", " --groups option, multicast group mem- bership information for IPv4 and IPv6 is displayed. -i, --interface iface If you use the -i, --interfaces option, a table of all (or the specified iface) networking interfaces will be printed. The output uses the ifconfig -e format, and is described in ifconfig(8). netstat -ei will print a table or a single interface entry just like ifconfig does. With the -a switch, you can include interfaces which are not configured (i.e. don't have the U=UP flag set). -M, --masquerade A list of all masqueraded sessions can be viewed, too. With the -e switch you can include some more informations about sequenze numbering and deltas, caused by data rewrites on FTP sessions (PORT command). Masquerade sup- port is used to hide hosts with unofficial network addresses from the outside world, as described in ipfw(4),ipfwadm(8) and ipfw(8). -N, --netlink Recent kernels have a kernel/user communication support called netlink. You can get messages about creation or deletion of interfaces or routes from /dev/route (36,0). OPTIONS -v, --verbose Tell the user what is going on by being verbose. Espe- cially print some usefull informations about unconfigured address families. -n, --numeric shows numerical addresses instead of trying to determine symbolic host, port or user names. -p, --programs displays process name and PID of the owner of each socket it dumps. You have to be the owner of such process to have net-tools 25 Feb 1999 NETSTAT(8) Linux Programmer's Manual NETSTAT(8) all it's sockets matched to it or generally root user will see all the necessary information in place. -A, --af family use a different method to set the address families. fam- ily is a comma (',') seperated list of address family key- words like inet, unix, ipx, ax25, netrom and ddp. This is has the same effect as using the long options --inet, --unix, --ipx, --ax25, --netrom and --ddp. -c, --continous This will cause netstat to print the selected table every second continously on the screen until you interrupt it. OUTPUT Active Internet connections (TCP, UDP, RAW) Proto The protocol (tcp, udp, raw) used by the socket. Recv-Q The count of bytes not copied by the user program con- nected to this socket. Send-Q The count of bytes not acknoledged by the remote host. Local Address The local address (local hostname) and port number of the socket. Unless the -n switch is given, the socket address is resolved to its canonical hostname, and the port number is translated into the corresponding service name. Foreign Address The remote address (remote hostname) and port number of he socket. As with the local address:port, the -n switch turns off hostname and service name resolution. State The state of the socket. Since there are no states in RAW and usually no states used in UDP, this row may be left blank. Normally this can be one of several values: ESTABLISHED The socket has an established connection. net-tools 25 Feb 1999 3 NETSTAT(8) Linux Programmer's Manual NETSTAT(8) SYN_SENT The socket is actively attempting to establish a connection. SYN_RECV A connection request has been received from the network. FIN_WAIT1 The socket is closed, and the connection is shut- ting down. FIN_WAIT2 Connection is closed, and the socket is waiting for a shutdown from the remote end.