交换机中line-rate用于端口限速,主要用于出端口上;traffic-limit用于流限速,主要用于入端口上。由于其实现机制原因可能导致一些软件测速工具(如ftp和chariot等)测试交换机traffic-limit时数据不准确,而测试line-rate比较准确。
这是由于这些软件工具测试的都是有效数据流的吞吐量。在交换机内部,
line-rate是端口的出流量限制,有芯片内报文缓存,可以让流量稳定在设置的值,没有丢包,所以不会重传。traffic-limit是端口入流量限制,没有芯片内的报文缓存,一旦暴发流量超过限制,直接丢包,这样,基于TCP连接的应用就会重传,导致效率降低较多,从而从下载工具上看到得最终下载速率低于限速值。
一般在测试端口的限速是否准确时,都使用Smartbits、IXIA等专用测试仪器,排除重传干扰。

 

下面我们以traffic-limit对流量监管。

案例:对交换机eth0/10的流量进行监管。

拓扑图:

202621268.png

正常情况时:

配置:

[Quidway]dis cu

vlan 1

#

vlan 10

#

vlan 20

#

interface Vlan-interface1

#

interface Vlan-interface10

 ip address 192.168.10.254 255.255.255.0

#

interface Vlan-interface20

 ip address 192.168.20.254 255.255.255.0

#

i

interface Ethernet0/10

 port access vlan 10

 

interface Ethernet0/20

 port access vlan 20

测试:

202651705.png

 

监管时,

配置:

 

[Quidway]dis cu

acl number 3000

 rule 10 permit ip                        

#

vlan 1

#

vlan 10

#

vlan 20

#

interface Vlan-interface1

#

interface Vlan-interface10

 ip address 192.168.10.254 255.255.255.0

#

interface Vlan-interface20

 ip address 192.168.20.254 255.255.255.0

#

interface Ethernet0/10

 port access vlan 10

 traffic-limit inbound ip-group 3000 rule 10 1

#

interface Ethernet0/20

 port access vlan 20

测试:

202713911.png

 

 

 

端口镜像就是将一个端口或多个端口的数据复制到一个端口。

案例:由于ftp是以明文方式传递信息的,所以,我们要对ftp进行监控。

拓扑图:

202731338.png

配置:

<Quidway>dis cu 

acl number 3000

 rule 10 permit tcp destination-port eq ftp #配置防控列表对ftp进行监听

#

vlan 1

#

vlan 10

#

vlan 20

#

vlan 30

interface Vlan-interface10

 ip address 192.168.10.254 255.255.255.0

#

interface Vlan-interface20

 ip address 192.168.20.254 255.255.255.0

#

interface Vlan-interface30

 ip address 192.168.30.254 255.255.255.0

#

interface Ethernet0/10

 port access vlan 10

#

interface Ethernet0/20

 port access vlan 20

#

 packet-filter ip-group 3000 rule 10

interface Ethernet0/24

 port access vlan 30

mirrored-to ip-group 3000 rule 10 interface Ethernet0/10 #将镜像数据发往eth0/10

测试:

pc1上用抓包工具抓取数据报

   tshark -ni eth0 -R tcp.port eq 21

 

202748882.png

 

能够监听到不同网段的访问,并且能够抓取用户名和密码。