Linux /proc/net/ 下文件用途

系统版本

cat /proc/version 
Linux version 2.6.27.19-5-pae (geeko@buildhost) (gcc version 4.3.2 [gcc-4_3-branch revision 141291] (SUSE Linux) ) #1 SMP 2009-02-28 04:40:21 +0100

 ls /proc/net/
arp        dev_mcast    ip_mr_vif  netlink    psched  route     snmp          stat    udp      wireless
connector  igmp         mcfilter   netstat    ptype   rt_acct   sockstat      tcp     udplite
dev        ip_mr_cache  netfilter  protocols  raw     rt_cache  softnet_stat  tr_rif  unix

详细介绍:

/proc/net/arp

IP address       HW type     Flags       HW address            Mask     Device
192.168.1.151    0x1         0x2         00:e0:4c:19:1a:98     *        eth0
192.168.1.1      0x1         0x2         00:14:78:e7:c4:e8     *        eth0

每个网络接口的arp表中dev包的统计
IP address:IP地址(直连)
HW type:硬件类型 
23=0x17   strip (Metricom Starmode IP) 
01=0x01   ether (Ethernet) 
15=0xf      dlci (Frame Relay DLCI) 
Flags:
HW address:MAC 地址
Mask:
Device:所在网络接口

/proc/net/dev

Inter-|   Receive bytes      packets errs drop fifo frame                                              
 face |  compressed multicast
 lo:       238306  4170      0        0    0     0                 0         0
 eth0:   885217  2782      0        0    0     0                 0         0
 pan0:  0            0            0        0    0     0                 0         0
 tap0:   4092      46          0        0    0     0                 0         0

|  Transmit                                              
|bytes        packets errs drop fifo colls carrier compressed
238306     4170      0       0    0     0       0          0
3581505   19730    0       0    0     0       0          0
0                0           0       0    0     0       0          0
5644          38         0       0    0     0       0          0

网络设备的统计

/proc/net/dev_mcast

2    eth0            1     0     01005e0000fb
2    eth0            1     0     01005e000001
5    tap0            1     0     01005e0000fb
5    tap0            1     0     01005e000001

组播包统计

/proc/net/igmp

Idx     Device    : Count Querier       Group    Users Timer    Reporter
1       lo        :     0      V3
                                010000E0     1 0:00000000               0
2       eth0      :     2      V3
                                FB0000E0     1 0:00000000               0
                                010000E0     1 0:00000000               0
5       tap0      :     2      V3
                                FB0000E0     1 0:00000000               0
                                010000E0     1 0:00000000               0

IGMP 分组情况

/proc/net/netlink

sk       Eth Pid    Groups   Rmem     Wmem     Dump     Locks
cedaae00 0   2527   00000111 0        0        00000000 2
cec2a400 0   0      00000000 0        0        00000000 2
cdc8da00 7   0      00000000 0        0        00000000 2
cef32400 9   0      00000000 0        0        00000000 2
ce000c00 9   2482   00000000 0        0        00000000 2
cecb8400 10  0      00000000 0        0        00000000 2
cecaaa00 11  0      00000000 0        0        00000000 2
cf832600 15  542    00000001 0        0        00000000 2
cec5fe00 15  0      00000000 0        0        00000000 2
cecaa800 16  0      00000000 0        0        00000000 2
cddd8a00 18  0      00000000 0        0        00000000 2

netlink套接口的信息

/proc/net/netstat

TcpExt: SyncookiesSent SyncookiesRecv SyncookiesFailed EmbryonicRsts PruneCalled RcvPruned OfoPruned OutOfWindowIcmps LockDroppedIcmps ArpFilter TW TWRecycled TWKilled PAWSPassive PAWSActive PAWSEstab DelayedACKs DelayedACKLocked DelayedACKLost ListenOverflows ListenDrops TCPPrequeued TCPDirectCopyFromBacklog TCPDirectCopyFromPrequeue TCPPrequeueDropped TCPHPHits TCPHPHitsToUser TCPPureAcks TCPHPAcks TCPRenoRecovery TCPSackRecovery TCPSACKReneging TCPFACKReorder TCPSACKReorder TCPRenoReorder TCPTSReorder TCPFullUndo TCPPartialUndo TCPDSACKUndo TCPLossUndo TCPLoss TCPLostRetransmit TCPRenoFailures TCPSackFailures TCPLossFailures TCPFastRetrans TCPForwardRetrans TCPSlowStartRetrans TCPTimeouts TCPRenoRecoveryFail TCPSackRecoveryFail TCPSchedulerFailed TCPRcvCollapsed TCPDSACKOldSent TCPDSACKOfoSent TCPDSACKRecv TCPDSACKOfoRecv TCPAbortOnSyn TCPAbortOnData TCPAbortOnClose TCPAbortOnMemory TCPAbortOnTimeout TCPAbortOnLinger TCPAbortFailed TCPMemoryPressures TCPSACKDiscard TCPDSACKIgnoredOld TCPDSACKIgnoredNoUndo TCPSpuriousRTOs TCPMD5NotFound TCPMD5Unexpected

TcpExt: 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 555 145 2 0 0 0 0 0 0 3029 0 10463 1848 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 2 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0

IpExt: InNoRoutes InTruncatedPkts InMcastPkts OutMcastPkts InBcastPkts OutBcastPkts
IpExt:   0                    0                        30                36                    79                  0

网络流量的多种统计

/proc/net/raw

  sl  local_address rem_address   st tx_queue rx_queue tr tm->when retrnsmt   uid  timeout inode ref pointer drops

原始套接口的套接口表

/proc/net/route

Iface  Destination   Gateway     Flags  RefCnt Use   Metric Mask      MTU   Window IRTT                            
tap0  000010AC    00000000    0001  0    0    0    00FFFFFF    0    0    0                                        
eth0  0001A8C0    00000000    0001  0    0    0    00FFFFFF    0    0    0                                        
eth0  0000FEA9    00000000    0001  0    0    0    0000FFFF    0    0    0                                        
lo   0000007F    00000000    0001  0    0    0    000000FF    0    0    0                                         
eth0  00000000    0101A8C0    0003  0    0    0    00000000    0    0    0            

静态路由表

/proc/net/rt_cache

Iface  Destination   Gateway     Flags      RefCnt Use   Metric Source     MTU   Window IRTT  TOS   HHRef    HHUptod SpecDst             
lo   FF01A8C0    FF01A8C0    94000000    0    0    0    9701A8C0    0    0    0    00   -10    C901A8C0                              
eth0  9701A8C0    9701A8C0        0    2    1    0    C901A8C0    1500  0    0    10   20    C901A8C0                            
lo   C901A8C0    C901A8C0    84000000    0    185   0    9701A8C0    0    0    0    00   -10    C901A8C0  

路由缓存表

/proc/net/snmp

Ip: Forwarding DefaultTTL InReceives InHdrErrors InAddrErrors ForwDatagrams InUnknownProtos InDiscards InDelivers OutRequests OutDiscards OutNoRoutes ReasmTimeout ReasmReqds ReasmOKs ReasmFails FragOKs FragFails FragCreates
Ip: 2 64 17123 0 13 0 0 0 17110 24061 0 0 0 0 0 0 0 0 0
Icmp: InMsgs InErrors InDestUnreachs InTimeExcds InParmProbs InSrcQuenchs InRedirects InEchos InEchoReps InTimestamps InTimestampReps InAddrMasks InAddrMaskReps OutMsgs OutErrors OutDestUnreachs OutTimeExcds OutParmProbs OutSrcQuenchs OutRedirects OutEchos OutEchoReps OutTimestamps OutTimestampReps OutAddrMasks OutAddrMaskReps
Icmp: 34 0 10 0 0 0 0 0 24 0 0 0 0 34 0 10 0 0 0 0 24 0 0 0 0 0
IcmpMsg: InType0 InType3 OutType3 OutType8
IcmpMsg: 24 10 10 24
Tcp: RtoAlgorithm RtoMin RtoMax MaxConn ActiveOpens PassiveOpens AttemptFails EstabResets CurrEstab InSegs OutSegs RetransSegs InErrs OutRsts
Tcp: 1 200 120000 -1 6 6 2 2 4 16956 23979 2 0 3
Udp: InDatagrams NoPorts InErrors OutDatagrams RcvbufErrors SndbufErrors
Udp: 30 10 0 40 0 0
UdpLite: InDatagrams NoPorts InErrors OutDatagrams RcvbufErrors SndbufErrors
UdpLite: 0 0 0 0 0 0

snmp agent的ip/icmp/tcp/udp协议统计

/proc/net/sockstat

sockets: used 556
TCP: inuse 9 orphan 0 tw 0 alloc 10 mem 2
UDP: inuse 5 mem 0
UDPLITE: inuse 0
RAW: inuse 0
FRAG: inuse 0 memory 0

使用的tcp/udp/raw/pac/syc_cookies的数量

/proc/net/tcp

 sl  local_address rem_address   st tx_queue rx_queue tr tm->when retrnsmt   uid  timeout inode                                                     
   0: 00000000:10E1 00000000:0000 0A 00000000:00000000 00:00000000 00000000     0        0 63205 1 c91b0500 300 0 0 2 -1                             
   1: 00000000:006F 00000000:0000 0A 00000000:00000000 00:00000000 00000000     0        0 5253 1 ce47aa40 300 0 0 2 -1                              
   2: 00000000:0016 00000000:0000 0A 00000000:00000000 00:00000000 00000000     0        0 7799 1 ce4a3a80 300 0 0 2 -1                              
   3: 0100007F:0277 00000000:0000 0A 00000000:00000000 00:00000000 00000000     0        0 6509 1 ce47a0c0 300 0 0 2 -1                              
   4: 0100007F:0019 00000000:0000 0A 00000000:00000000 00:00000000 00000000     0        0 7392 1 ce47a580 300 0 0 2 -1                              
   5: C901A8C0:0016 9701A8C0:0B64 01 00000034:00000000 01:00000022 00000000     0        0 16290 4 c91b09c0 35 4 3 5 4                               
   6: 0100007F:10E1 0100007F:91DE 01 00000000:00000000 00:00000000 00000000     0        0 63427 1 c91b0040 21 4 29 3 -1                             
   7: C901A8C0:0016 9701A8C0:066B 01 00000000:00000000 02:000497D5 00000000     0        0 12401 2 ce4a35c0 31 4 16 5 4                              
   8: 0100007F:91DE 0100007F:10E1 01 00000000:00000000 00:00000000 00000000     0        0 63426 1 c90a1a00 22 4 30 3 -1               

TCP连接的套接口

/proc/net/udp

  sl  local_address rem_address   st tx_queue rx_queue tr tm->when retrnsmt   uid  timeout inode ref pointer drops             
   3: 00000000:9883 00000000:0000 07 00000000:00000000 00:00000000 00000000   104        0 6195 2 ce437700 0                   
  24: 00000000:0298 00000000:0000 07 00000000:00000000 00:00000000 00000000     0        0 5252 2 ce437b80 0                   
 105: 00000000:14E9 00000000:0000 07 00000000:00000000 00:00000000 00000000   104        0 6194 2 ce437940 0                   
 111: 00000000:006F 00000000:0000 07 00000000:00000000 00:00000000 00000000     0        0 5220 2 ce437dc0 0                   
 119: 00000000:0277 00000000:0000 07 00000000:00000000 00:00000000 00000000     0        0 6526 2 ce437040 0                   

UDP连接的套接口表

/proc/net/unix

c9113580: 00000003 00000000 00000000 0001 03 11719
c9113740: 00000003 00000000 00000000 0001 03 11717 /var/run/dbus/system_bus_socket
c9113900: 00000003 00000000 00000000 0001 03 11716
c9113c80: 00000003 00000000 00000000 0001 03 11711 /tmp/orbit-yaozhongkai/linc-c9d-0-6437df843b36c
c9113e40: 00000003 00000000 00000000 0001 03 11710
c9078040: 00000003 00000000 00000000 0001 03 11708 @/tmp/dbus-TT8HxW0iEY

UNIX域套接口的套接口表

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值