3.显示过滤器(Display Filter)
在实际的使用中,IP流量监视器会快速显示大量信息,而这其中的大部分信息你可能并不关心。这时,你就可以使用显示过滤器来控制IP流量监视器的显示信息。
3.1.TCP过滤器(TCP Filters)
使用这个功能,你可以定义一些参数决定在IP流量监视器显示界面中显示的TCP连接。
![](http://file///C:/DOCUME~1/twf/LOCALS~1/Temp/msohtml1/01/clip_image002.jpg)
screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL Mouse wheel to zoom in/out';}" onmouseover="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open('http://file:///C:/DOCUME~1/twf/LOCALS~1/Temp/msohtml1/01/clip_image002.jpg');}" onmousewheel="return imgzoom(this);" alt="" />
3.1.1.定义一个新的过滤器(Defining a New Filter)
默认安装的IPTraf没有任何的过滤器,因此你需要定义自己的过滤器。选择TCP Display
Filters->Define new filter...菜单项,会弹出一个对话框让你输入一个简短的过滤器描述。输入完成之后,按回车,会弹出另外一个对话框,要求你输入源地址和目的地址、
子网掩码和服务端口。
![](http://file///C:/DOCUME~1/twf/LOCALS~1/Temp/msohtml1/01/clip_image004.jpg)
screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL Mouse wheel to zoom in/out';}" onmouseover="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open('http://file:///C:/DOCUME~1/twf/LOCALS~1/Temp/msohtml1/01/clip_image004.jpg');}" onmousewheel="return imgzoom(this);" alt="" />
网络地址可以是单一主机、网络以及整个网络地址空间,由子网掩码决定。例如:
单一主机 207.0.115.44:
IP 地址: 207.0.115.44
子网掩码: 255.255.255.255
属于网络202.47.132.x的所有主机:
IP地址: 202.47.132.0
子网掩码: 255.255.255.0
所有IP地址:
IP 地址: 0.0.0.0
子网掩码 0.0.0.0
Include(包括)/Exclude(排除)域决定是否在显示窗口中显示这类条目。
3.1.2.TCP过滤器应用示例
监视202.47.132.1和207.0.115.44之间的TCP连接
Host name/IP Address 202.47.132.2 207.0.115.44
Wildcard mask 255.255.255.255 255.255.255.255
Port 0 0
Include/Exclude I
监视主机207.0.115.44和网络202.47.32.0之间的TCP连接:
Host name/IP Address 207.0.115.44 202.47.132.0
Wildcard mask 255.255.255.255 255.255.255.0
Port 0 0
Include/Exclude I
监视所有的WEB连接:
Host name/IP Address 0.0.0.0
0.0.0.0
Wildcard mask 0.0.0.0 0.0.0.0
Port 80 0
Include/Exclude I
监视从任意地址到主机202.47.132.2的SMTP端口的流量:
Host name/IP Address 202.47.132.2 0.0.0.0
Wildcard mask 255.255.255.255 0.0.0.0
Port 25 0
Include/Exclude I
监视主机sunsite.unc.edu之间cebu.mozcom.com的流量:
Host name/IP Address sunsite.unc.edu cebu.mozcom.com
Wildcard mask 255.255.255.255 255.255.255.255
Port 0 0
Include/Exclude I
忽略网络140.66.5.x和任意地址之间的流量
Host name/IP Address 140.66.5.x 0.0.0.0
Wildcard mask 255.255.255.0 0.0.0.0
Port 0 0
Include/Exclude E
如果定义了过滤器,IPTraf的IP流量监视器将只显示过滤器指定连接的流量,其它一律不显示。这类似于防火墙的默认禁止策略。因此,如果你
想监视除了某个地址之外的所有连接,你只能首先定义一个排除类型的过滤器,{zh1}定义一个包括(include)类型的过滤器(所有的域全部是0)。
例如:我们想显示所有TCP连接上的网络流量,除了SMTP、WEB端口以及207.0.115.44的连接:
Host name/IP address 0.0.0.0
0.0.0.0
Wildcard mask 0.0.0.0 0.0.0.0
Port 25 0
Include/Exclude E
Host name/IP address 0.0.0.0 0.0.0.0
Wildcard mask 0.0.0.0 0.0.0.0
Port 80 0
Include/Exclude E
Host name/IP address 207.0.115.44 0.0.0.0
Wildcard mask 255.255.255.255 0.0.0.0
Port 0 0
Include/Exclude E
Host name/IP address 0.0.0.0 0.0.0.0
Wildcard mask 0.0.0.0 0.0.0.0
Port 0 0
Include/Exclude I
3.1.3.其它菜单项
过滤器定义完成之后,我们需要使用Applying a Filter菜单项使其生效;可以选择Editing a
Defined Filter菜单项,编辑现有的过滤器;选择Deleting a Defined Filter菜单项,删除一个过滤器;选择Detaching a Filter菜单项使一个过滤器失活。这都比较简单,在此就不多做赘述了。
3.2.其它协议过滤器
IPTraf还支持其它类型的过滤器。不过,除了UDP过滤器之外,其它协议过滤器都只是开关(是否显示这类协议)而已。UDP协议过滤器的设置和TCP过滤器的设置差不多,这里就不多做赘述了。