Cisco及华为网络技术论坛

HOS的端口配置和镜像


来源: 作者: 出处:Vlan9.com 2007-07-01 进入论坛
  • 关 键 词:
  • snmp

一、端口配置的基本命令

配置端口基本参数的常用命令如下:

config port
使能或关闭指定的端口
config port auto
配置端口的自适应模式
config port description
配置端口的端口描述
config port speed
配置端口的速率
config port mode
配置千兆电口的主从模式
config port duplex
配置端口的双工模式
config port flowcontrol
config port flowrate
配置端口的收发包速率
config port learn
config port snmp trap
配置端口的link trap功能
loopback port
配置端口自环测试

 

1.1.1  配置案例

案例描述
关闭端口3和4的自适应功能,并设置端口的速度为10Mbps,双工模式为半双工,同时使能端口的地址学习功能。
配置步骤

步骤1
关闭端口3和4的自适应功能
 
Harbour(config)#config port 3,4 auto off
步骤2
设置端口3和4的速度为10Mbps
 
Harbour(config)#config port 3,4 speed 10
步骤3
设置端口3和4的双工模式为半双工
 
Harbour(config)#config port 3,4 duplex half
步骤4
使能端口的地址学习功能
 
Harbour(config)#config port 3,4 learn on
步骤5
查看端口3的配置情况
 
Harbour(config)#show port 3
-------------------------------------------------------------
                 Port:3's Configuration Information
 
Link State       : Up              Port State       : Enabled  
Port Type        : 100BaseT        Speed            : 10       
Autonegotiation  : Disabled        Duplex           : Half      
Flowcontrol      : Disabled        Learn State      : Enabled  
 
Port VLAN ID     : 2047           
Port VLAN Name   : default        
Port Summary     : normal                         
-------------------------------------------------------------

 

二、端口镜象

1.1.1  概述

端口镜像通过将一个或多个端口的数据复制到指定的端口上来实现网络流量分析和错误诊断。端口镜像基于如下规则:
n       在一个设备中,只能将一个端口作为镜像的目标端口。
n       可以将多个端口镜像到一个端口。
n       可以分别设置镜像端口的发包或者收包。
 

1.1.2  配置案例

配置镜像目标端口为5,镜像源端口为6-12的发送包,镜像源端口25-30的接收包。
配置步骤

步骤1
配置镜像目标端口为5
 
Harbour(config)#config mirrror 1 to 5
步骤2
镜像源端口为6-12的发送包
 
Harbour(config)#config mirroring 1 add port 6-12 egress
步骤3
镜像源端口25-30的接收包
 
Harbour(config)#config mirroring 1 add port 25-30 ingress
步骤4
显示端口镜像信息
 
Harbour(config)#show mirroring
Mirroring information:
The port which mirror to    : 5
The ports which egress traffic mirror from : 6 7 8 9 10 11 12
The ports which ingress traffic mirror from : 25 26 27 28 29 30

注:端口镜像最好是监听端口和被监听端口最好是在一个芯片组,如何判别主要看产品外观,没有隔开的端口就是一个芯片组,比如一般24口设备都分成了二或者三段。

进入论坛讨论。

阅读前一章:MAC地址转发表(FDB)

阅读后一章:HOS中的日志管理
vlan9_logo
相关专题

论坛精华
阅读排行榜
最新技术文档
热门关键字导读