arptable和routetable比较类似的是都是存在内存中的一个表格
arptable: /proc/net/arp
routetable: /proc/net/route
下面对两个文件做简单的介绍:
[junjie2@ljj ~]$ cat /proc/net/arp
IP address HW type Flags HW address Mask Device
10.218.19.91 0x1 0x0 00:00:00:00:00:00 * eth0
10.218.19.1 0x1 0x2 00:1D:A1:A7:13:CC * eth0
10.218.19.23 0x1 0x0 00:00:00:00:00:00 * eth0
10.218.19.172 0x1 0x2 00:11:43:47:25:FE * eth0
10.218.19.81 0x1 0x0 00:00:00:00:00:00 * eth0
10.218.19.71 0x1 0x0 00:00:00:00:00:00 * eth0
IP address : 这个就不说了
HW type : 硬件类型 ,0x1 代表以太网卡
Flags : 0x0 表示未完成(imcomplete),看紧挨着的HW address发现硬件地址都是0,那是因为想找这台机器没有找到,所以Flags为0x0
HW address: 硬件地址了
Mask : IP地址的掩码
Device: 路由中对应的网卡
[junjie2@ljj ~]$ cat /proc/net/route
Iface Destination Gateway Flags RefCnt Use Metric Mask MTU Window IRTT
eth0 0013DA0A 00000000 0001 0 0 0 00FFFFFF 0 0 0
eth0 0000FEA9 00000000 0001 0 0 0 0000FFFF 0 0 0
eth0 00000000 0113DA0A 0003 0 0 0 00000000 0 0 0
[junjie2@ljj ~]$ route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.218.19.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
0.0.0.0 10.218.19.1 0.0.0.0 UG 0 0 0 eth0
[junjie2@ljj ~]$
Ref Number of references to this route. (Not used in the Linux kernel.)
Use Count of lookups for the route. Depending on the use of -F and -C this will be either route cache misses
(-F) or hits (-C).
Iface Interface to which packets for this route will be sent.