交换机以太通道中继线路的配置
怎么样配置交换机TRUNK(端口汇聚)教学提纲

怎么样配置交换机T R U N K(端口汇聚)怎么样配置交换机TRUNK(端口汇聚)“TRUNK”的三个意思不要混淆您知道三层交换机技术中常提到的TRUNK是什么意思么?在技术领域中把TRUNK翻译为中文是“主干、干线、中继线、长途线” ,不过一般不翻译,直接用原文。
而且这个词在不同场合也有不同的解释:1、在网络的分层结构和宽带的合理分配方面,TRUNK被解释为“端口汇聚”,是带宽扩展和链路备份的一个重要途径。
TRUNK把多个物理端口捆绑在一起当作一个逻辑端口使用,可以把多组端口的宽带叠加起来使用。
TRUNK技术可以实现TRUNK内部多条链路互为备份的功能,即当一条链路出现故障时,不影响其他链路的工作,同时多链路之间还能实现流量均衡,就像我们熟悉的打印机池和MODEM池一样。
2、在电信网络的语音级的线路中,Trunk指“主干网络、电话干线”,即两个交换局或交换机之间的连接电路或信道,它能够在两端之间进行转接,并提供必要的信令和终端设备。
3、但是在最普遍的路由与交换领域,VLAN的端口聚合也有的叫TRUNK,不过大多数都叫TRUNKING ,如CISCO公司。
所谓的TRUNKING是用来在不同的交换机之间进行连接,以保证在跨越多个交换机上建立的同一个VLAN 的成员能够相互通讯。
其中交换机之间互联用的端口就称为TRUNK端口。
与一般的交换机的级联不同,TRUNKING是基于OSI第二层摹<偕杳挥蠺RUNKING技术,如果你在2个交换机上分别划分了多个VLAN(VLAN也是基于Layer2的),那么分别在两个交换机上的VLAN10和VLAN20的各自的成员如果要互通,就需要在A交换机上设为VLAN10的端口中取一个和交换机B上设为VLAN10的某个端口作级联连接。
VLAN20也是这样。
那么如果交换机上划了10个VLAN就需要分别连10条线作级联,端口效率就太低了。
当交换机支持TRUNKING的时候,事情就简单了,只需要2个交换机之间有一条级联线,并将对应的端口设置为Trunk,这条线路就可以承载交换机上所有VLAN的信息。
网络互连设备的基本工作原理及配置

网桥 顺序 B2 的自 1 学习 表 2
PORT1 MAC1
PORT2
PORT3
帧扩散、帧丢弃、帧发到指定 PORT、其他 帧扩散
MAC4
帧发到指定PORT
3
• 接着,网桥B1从它的#2端口收下网桥B2转发而来的帧。网桥B1查其 自学习表可知,刚收下的帧应从#1端口转发出去。同时将源MAC地 址MAC4写到网桥B1的中,如表4所示。
交换机的地址学习能力
• 计算机打开电源后,安装在该系统中的网卡会定期发出空闲包或信号, 交换机即可据此得知它的存在以及其 MAC 地址,这就是所谓自动地址 学习. • 要注意交换机档次越低,交换机的缓存就越小,也就是说为保存 MAC 地 址所准备的空间也就越小,对应的就是它能记住的 MAC 地址数也就越 少. • 通常一台交换机都具有 1024 个 MAC 地址记忆空间,都能满足实际需 求.
• 交换机的主要功能 – 在发送节点和接收节点之间建立一条虚连接 – 转发数据帧 – 建立并维护交换表
• 交换机的主要特性 – 局域网交换技术操作在OSI的第二层 – 根据MAC地址进行帧转发、帧过滤 – 每个交换机端口独占带宽 系统带宽为端口带宽 × n (端口个数) – 内部可同时存在多个通信通道
• 全双工“(Full Duplex)状态:即可以同时接收和发送数据,数据流是双 向的 。 • 半双工:在任一时刻只能有一个方向的数据流,即处于"半双工"(Half Duplex)模式,
交换机的工作特点
拥有一条很高带宽的背板总线和内部交换矩阵 所有的端口都挂接在这条背板总线上 控制电路收到数据包以后,处理端口会查找内存中的地址 对照表以确定目的MAC地址的网卡(NIC)挂接在哪个端 口上,通过内部交换矩阵迅速将数据包传送到目的端口
交换机配置—交换机接口管理

交换机配置—交换机接口管理交换机借助对接口传输控制的配置,不但可以调整客户端接入的速度,同时也可以有效杜绝广播风暴对整个网络的冲击,从而保证网络的正常通信。
另外,又可以拒绝未被授权的计算机接入网络,或者限制某个接口接入计算机的数量,从而保证网络的接入安全,避免网络被个别用户滥用。
以太网交换机根据接口实现的功能分类,包括以下几种:●基于接口的VLAN(Port-Based VLANs)●交换接口(Switch Ports)●以太网通道接口组(Etherchannel Port Groups)●交换虚拟接口(Switch Virtual Interfaces)●被路由接口(Routed Ports)●连接接口(Connecting Interfaces)1.接口配置参数为了配置一个物理接口(或逻辑接口)属性,必须先进入接口配置模式,并且指定接口的Type、Slot和Port Number。
(1)Type参数Type是指10/100的Fast Ethernet(fastethernet or fa)或者Gigabit Ethernet(gigabitethernet or gi)。
(2)Slot参数Slot是交换机上的插槽号码,例如,在Catalyst3550上,插槽号码是0,而在Catalyst6509上则可能是1或者2。
(3)Port Numbe参数最后需要指定Port Numbe,即交换机上的接口号,接口号码总是以1开头,面对交换机正面从左开始,例如,gigabitethernet 0/1、gigabitethernet 0/2。
检查接口状态之前,首先要分清交换机槽号和接口号。
当指定特定接口时,其命令语法为:mod_num/port_num(模块号/接口号)。
例如,2/1表示指定位于模块2上的接口1。
通常情况下,模块的排序为从上到下,顶端为1;接口的排序从左至右,左侧为1。
在不清楚以上3个参数时,可用物理的方式检查交换机上的本地接口以确认物理接口。
USG 2000以太网链路接入,上下行设备为交换机(主备备份)

以太网链路接入,上下行设备为交换机(主备备份)介绍上下行设备为交换机,主备备份组网的双机热备配置。
组网需求USG作为安全设备被部署在业务节点上。
其中上下行设备均是交换机,USG_A、USG_B分别充当主用设备和备用设备,且均工作在路由模式下。
通过配置NAT功能,使内网用户可以通过公网地址访问Internet。
组网图如图1所示。
图1 以太网链路接入,上下行设备为交换机组网图网络规划如下:∙需要保护的网段地址为192.168.10.0/24,与USG的GigabitEthernet0/0/1接口相连,部署在Trust区域。
∙外部网络与USG的GigabitEthernet0/0/3接口相连,部署在Untrust区域。
其中,各安全区域对应的VRRP组虚拟IP地址如下:∙Trust区域对应的VRRP组1,虚拟IP地址为192.168.10.1/24。
∙Untrust区域对应的VRRP组2,虚拟IP地址为10.100.30.1/24。
网段为192.168.10.0/24的内网用户允许访问Internet的FTP服务器10.100.30.5,公网地址范围为10.100.30.8~10.100.30.9。
配置思路1.在主备设备上配置VRRP备份组,并配置备份组的虚拟IP地址。
2.在主备设备上配置HRP备份通道,并启动HRP。
3.配置NAT功能。
由于NAT地址池地址与VRRP备份组的虚拟IP地址在同一个网段,则需要将地址池绑定该VRRP备份组。
操作步骤1.完成USG_A上、下行接口的配置。
# 配置GigabitEthernet 0/0/1的IP地址。
<USG_A> system-view[USG_A] interface GigabitEthernet 0/0/1[USG_A-GigabitEthernet0/0/1] ip address 192.168.10.2 24[USG_A-GigabitEthernet0/0/1] quit# 配置GigabitEthernet 0/0/3的IP地址。
STP配置

STP实验配置在上面的拓扑中有两个环,分别是A、B之间和B、C、D之间,STP默认是在VLAN1上打开的,所有我们先分别在A、B、C、D上查看:#show spanning-tree 我们可以发现目前根网桥是A,因为A的网桥ID最小,B的fa1/1接口和D的fa1/15接口被阻塞,分析一下为什么,并想一想根接口和指定接口分别是哪些。
一、STP基本配置:1、配置根网桥:a、在B上:(config)#spanning-tree vlan 1 root primary 配置B为VLAN1的根网桥b、在A上:(config)#spanning-tree vlan 1 root secondary 配置A为VLAN1的备份根网桥分别在A、B、C、D上查看:#show spanning-tree发现B已经成为VLAN1的根,优先级变为8192(2950交换机上会变为24576),A的优先级变为16384(2950交换机上会变为28672),现在阻塞接口是哪些,想一想。
2 、配置网桥优先级:在C上:(config)#spanning-tree vlan 1 priority 4096 配置C在VLAN 1中优先级为4096 分别在A、B、C、D上查看:#show spanning-tree发现C已经成为VLAN1新的根,优先级为4096(2950交换机上优先级是4096的倍数),在STP中谁的网桥ID最小谁就将成为根。
现在阻塞接口是哪些,想一想。
3、配置接口成本:现在由于C是根,所以我们通过show spanning-tree可以知道D的接口fa1/15是根接口,而fa1/9被阻塞了在D上:(config)#inter fa1/15(config- if)#spanning-tree vlan 1 cost 50 配置接口fa1/15在vlan 1中的成本为50在D上查看:#show spanning-tree发现D的接口fa1/15成本已经变为50(默认为19),根接口变成了fa1/9,而fa1/15被阻塞了,想想为什么4、配置接口优先级:现在由于C是根,所以我们通过show spanning-tree可以知道A的接口fa1/0是根接口,而fa1/1被阻塞了注意:在B上:(config)#inter fa1/1(config- if)#spanning-tree vlan 1 port-priority 64配置接口fa1/1在vlan 1中的优先级为64 在B上查看:#show spanning-tree 发现B的接口fa1/1优先级已经变为64(默认为128)在A上查看:#show spanning-tree 发现A的根接口变成了fa1/1,而fa1/0被阻塞了,想想为什么二、PVST配置:先重启交换机,然后创建VLAN,配置中继,A不打开1、B的配置:#vlan database 进入VLAN数据库(vlan )#vlan 2 创建vlan2(vlan )#vlan 3 创建vlan3(vlan )#vlan 4 创建vlan4(vlan )#exit 保存退出(config)#inter fa1/8(config- if)#switchport mode trunk 把接口fa1/8配为中继模式(config)#inter fa1/9(config- if)#switchport mode trunk 把接口fa1/9配为中继模式2、C的配置:#vlan database 进入VLAN数据库(vlan )#vlan 2 创建vlan2(vlan )#vlan 3 创建vlan3(vlan )#vlan 4 创建vlan4(vlan )#exit 保存退出(config)#inter fa1/8(config- if)#switchport mode trunk 把接口fa1/8配为中继(config)#inter fa1/15(config- if)#switchport mode trunk 把接口fa1/15配为中继3、D的配置:#vlan database 进入VLAN数据库(vlan )#vlan 2 创建vlan2(vlan )#vlan 3 创建vlan3(vlan )#vlan 4 创建vlan4(vlan )#exit 保存退出(config)#inter fa1/9(config- if)#switchport mode trunk 把接口fa1/9配为中继模式(config)#inter fa1/15(config- if)#switchport mode trunk 把接口fa1/15配为中继模式现在分别在B、C、D上把VLAN2、3、4的STP打开:(config)#spanning-tree vlan 2(config)#spanning-tree vlan 3(config)#spanning-tree vlan 4分别在B、C、D上查看:#show spanning-tree现在VLAN1、2、3、4中,B是根网桥,阻塞接口都是交换机D的fa1/15,那么C 的所有流量都从fa1/8走,D的所有流量都从fa1/9走,没有做到负载均衡。
交换机端口聚合的基本配置

交换机的端口聚合概念
1.3 端口的聚合优势: 端口的基本配置主要包括stp、qos、vlan、端口属性等相关配置。其中stp配置包括:端口
的stp使能/关闭、与端口相连的链路属性(如点对点或非点对点)、stp优先级、路径开销、报文 发送速率限制、是否环路保护、是否根保护、是否为边缘端口。qos配置包括:流量限速、优先 级标记、默认的802.1p优先级、带宽保证、拥塞避免、流重定向、流量统计等。vlan配置包括: 端口上允许通过的vlan、端口默认vlan id。端口属性配置包括:端口的链路类型,如trunk、 hybrid、access属性、绑定侦测组配置。一台s9500系列路由交换机最多可以配置920个汇聚组, 其中1~31为手工或者静态聚合组;32~64为预留组号;65~192为routed trunk;193~920 为动态聚合组。系统中存在mpls vpn单板时,只支持7个负载分担聚合组,没有mpls vpn单板时, 可以支持31组负载分担组,对于fe单板(采用ex芯片),只支持7个负载分担聚合组。目前 s9500还支持跨接口板聚合,跨接口板与本板的聚合是一样的。
致力于提供IT专业 全教学生命周期解决方案
三、AutoCAD绘制楼梯详图(步骤)
楼梯剖面详图的绘制: 1.设置绘图环境; 2.绘制定位轴线、室外地坪线、楼面位
置线、梯段位置线等; 3.绘制墙体、楼板、梯段等构件; 4.绘制门、窗并补充细节; 5.标注; 6.打印出图.
致力于提供IT专业 全教学生命周期解决方案
端口汇聚是将多个端口聚合在一起形成1个汇聚组,以实现出负荷在各成员端口中的分担, 同时也提供了更高的连接可靠性。端口汇聚可以分为手工汇聚、动态lacp汇聚和静态lacp汇聚。 同一个汇聚组中端口的基本配置应该保持一致,即如果某端口为trunk端口,则其他端口也配置 为trunk端口;如该端口的链路类型改为access端口,则其他端口的链路类型也改为access端口。
[原创]三层交换机配置命令以及中文解释
![[原创]三层交换机配置命令以及中文解释](https://img.taocdn.com/s3/m/77abe05db207e87101f69e3143323968011cf4f3.png)
三层交换机配置命令以及中文解释基本配置S> enable 进入特权模式S# configure terminal 进入全局配置模式S(config)# hostname name 改变交换机名称S(config)# enable password level level_# password 设置用户口令(level_#=1)或特权口令(level_#=15)S(config)# line console 0 进入控制台接口S(config-line)# password console_password 接上一条命令,设置控制台口令S(config)# line vty 0 15 进入虚拟终端S(config-line)# password telnet_password 接上一条命令,设置Telnet口令S(config-line)# login 允许Telnet登录S(config)# enable password|secret privilege_password 配置特权口令(加密或不加密)S(config)# interface ethernet|fastethernet|gigabitethernet slot_#/port_# 进入接口子配置模式S(config-if)# [no] shutdown 关闭或启用该接口(默认启用)S(config)# ip address IP_address sunbet_mask 指定IP地址S(config)# ip default-gateway router's_IP_address 指定哪台路由器地址为默认网关S# show running-config 查看当前的配置S# copy running-config startup-config 将RAM中的当前配置保存到NVRAM中S> show interface [type slot_#/port_#] 查看所有或指定接口的信息S> show ip 显示交换机的IP配置(只在1900系列上可用)S> show version 查看设备信息S# show ip interface brief 验证IP配置S(config-if)# speed 10|100|auto 设置接口速率S(config-if)# duplex auto|full|half 设置接口双工模式S> show mac-address-table 查看CAM表S# clear mac-address-table 清除CAM表中的动态条目1900(config)# mac-address-table permanent MAC_address type [slot_#/]port_# 在CAM表中创建静态条目2950(config)# mac-address-table static MAC_address vlan VLAN_# interface type [slot_#/] port_# 在CAM表中创建静态条目1900(config)# mac-address-table restricted static MAC_address source_port list_of_allowed_interface 设置静态端口安全措施1900(config-if)# port secure 启用粘性学习1900(config-if)# port secure max-mac-count value 设置粘性学习特性能够学到的地址数量(默认132,取值范围是1-132)1900(config)# address-violation suspend|ignore|disable 改变安全选项1900> show mac-address-table security 验证端口安全措施2950(config)# switchport mode access 定义接口为主机端口而不是中继端口2950(config)# switchport port-security 启用端口安全措施2950(config)# switchport port-security maximum value 指定可与此接口相关的设备的最大数量2950(config)# switchport port-security violationprotect|restrict|shutdown 指定出现安全违规时应该发生的事2950(config)# switchport port-security mac-addressMAC_address 指定允许与此接口相关的确切的MAC地址2950(config)# switchport port-security mac-address sticky 启用粘性学习特性2950(config)# show port interface type [slot_#/] port_# 验证接口配置2950(config-if) description name 设置接口描述信息2950# show buffers 查看系统缓存的大小1900# copy nvram tftp:// IP_address_of_TFTP_server/ file_name 将配置文件备份到TFTP服务器上1900# copy tftp:// IP_address_of_TFTP_server/ file_name nvram 从TFTP服务器上恢复配置到NVRAM1900# delete nvram 删除配置文件2950# erase startup-config 删除配置文件3550# show tcam qos TCAM_ID statistics 查看TCAM剩余容量4000> enable 进入特权模式4000>(enable) set password 设置用户模式密码4000>(enable) set enablepass 设置授权密码4000>(enable) set interface sc0 IP_address mask 配置IP地址4000>(enable) set port enable|disable slot_#/port_# 启用/禁用接口4000>(enable) show port [slot_#/port_#] 显示接口信息4000>(enable) set port name slot_#/port_# name 设置交换机接口描述信息4000>(enable) set port speed slot_#/port_# 4|10|16|100|auto 设置交换机接口速率4000>(enable) set port duplex slot_#/port_# full|half 设置交换机接口双工模式4000>(enable) clear config all 删除NVRAM中的配置信息4000>(enable) erase all 删除FLASH中的内容4000>(enable) show flash 显示FLASH中的内容4000>(enable) show cam [count]dynamic|static|permanent|system [vlan_#] 显示CAM表VLAN 1900(config)# vtp domain VTP_domain_name 定义交换机域名1900(config)# vtp server|client|transparent 定义交换机VTP模式(默认服务器)1900(config)# vtp password VTP_password 配置VTP口令1900(config)# vtp pruning enable|disable 启用/禁用修剪(默认启用)1900(config)# vtp trap enable 启用SNMP陷阱(默认启用)1900# show vtp 验证VTP配置2950# vtp database 访问VLAN和VTP配置(以下均是在IOS12.1前用,12.1后全是在全局配置模式下)2950(vlan)# vtp domain VTP_domain_name 定义交换机域名2950(vlan)# vtp server|client|transparent 定义交换机VTP模式(默认服务器)2950(vlan)# vtp password VTP_password 配置VTP口令2950(vlan)# vtp pruning 启用/禁用修剪(默认启用)2950(config)# snmp-server enable traps vtp 启用SNMP陷阱(默认启用)2950# show vtp status 检查VTP配置2950# show vtp counters 显示与VTP消息发送与接收相关的VTP统计信息1900(config-if)# trunk on|off|desirable|auto 指定中继类型1900# show trunk A|B 验证接口中继(A是fa0/26,B是fa0/27)2950(config-if)# switchport mode trunk|dynamicdesirable|dynamic auto|nonegotiate 指定中继类型(默认自动协商)2950(config-if)# switchport trunk native|allowed|pruning vlan VLAN_# 配置中继2950(config-if)# switchport trunk pruning vlan remove VLAN_# 清除不希望消减的VLAN2950# show interfaces [type 0/port_#] switchport|trunk 验证接口中继1900(config)# vlan VLAN_# [name VLAN_name] 创建VLAN1900(config-if)# vlan-membership static VLAN_# 将该接口静态地分配给一个VLAN1900# show vlan 验证VLAN1900# show vlan-membership 查看VLAN成员关系1900# show spantree [VLAN_#] 查看VLAN的STP信息2950# vlan database 进入VLAN数据库(ISO12.1前用)2950(vlan)# vlan VLAN_# [name VLAN_name] 创建VLAN2950(config)# vlan VLAN_# 进入VLAN数据库(ISO12.1后用)2950(config-vlan)# name VLAN_name 创建VLAN2950(config-if)# switchport mode access 指定连接是接入链路连接2950(config-if)# switchport access vlan VLAN_# 指定VLAN是接入链路连接4000>(enable) set vlan VLAN_# name VLAN_name 配置VLAN4000>(enable) set vlan VLAN_# slot_#/port_#-port_# 为VLAN分配端口4000>(enable) set trunk slot_#/port_#[on|off|desirable|auto|nonegotiate] [VLAN_#][isl|dot1q|dot10|lane|negotiate] 配置中继4000>(enable) clear trunk slot_#/port_# VLAN_# 删除VLAN 4000>(enable) show trunk slot_#/port_# 验证中继端口4000>(enable) set vtp v2 enable 配置VTPv24000>(enable) set vtp [domain name] [modeclient|server|transparent] [passwd password] [pruning enable|disable] [v2 enable|disable] 设置VTP4000>(enable) show vtp domain 验证VTP域的信息4000>(enable) show vtp statistics 显示发出或收到的VTP通告信息的摘要内容4000>(enable) set vtp pruneeligible VLAN_# 设置VTP消减4000>(enable) clear vtp pruneeligible VLAN_# 清除不希望消减的VLANSTP 4000>(enable) set spantree enable|disable VLAN_# 启用/禁用STP(默认启用)2950(config)# [no] spanning-tree vlan VLAN_# 启用/禁用STP(默认启用)4000>(enable) show spantree [VLAN_#] 验证STP状态2950# show spanning-tree 验证STP状态4000>(enable) set spantree root [secondary] VLAN_# [dia network_diameter] [hello hello_time] 设置主根节点桥、备份节点桥、最大桥数量(2-7)、持续时间(1-10,默认2)4000>(enable) set spantree portcost slot_#/port_# cost_# 设置端口开销2950(config-if)# spanning-tree cost cost_# 设置端口开销4000>(enable) set spantree portpri slot_#/port_# priority_# 设置端口优先级4000>(enable) set spantree portvlanpri slot_#/port_#priority_# [VLAN_#] 改变VLAN的优先级设置2950(config-if)# spanning-tree vlan VLAN_# port-priority priority_# 设置端口优先级4000>(enable) set spantree fwddelay delay_# [VLAN_#] 设置从侦听状态到学习状态再到转发状态的时间间隔(默认15秒,取值范围是4-30秒)4000>(enable) set spantree hello interval_time [VLAN_#] 设置根节点交换机发送BPDU的时间间隔(默认2秒,取值范围是1-10秒)4000>(enable) set spantree maxage agingtime [VLAN_#] 设置交换机持有BPDU的时间(默认20秒,取值范围是6-40秒)2950(config)# spanning-tree vlan VLAN_# forward-time forward_time 设置从侦听状态到学习状态再到转发状态的时间间隔(默认15秒,取值范围是4-30秒)2950(config)# spanning-tree vlan VLAN_# hello-time hello_time 设置根节点交换机发送BPDU的时间间隔(默认2秒,取值范围是1-10秒)2950(config)# spanning-tree vlan VLAN_# max-age maxage 设置交换机持有BPDU的时间(默认20秒,取值范围是6-40秒)4000>(enable) set port channel slot_#/port_# on 建立以太通道集合4000>(enable) show port capabilities slot_#/port_# 查看端口的配置4000>(enable) show port channel 验证以太通道集合的配置2950(config-if)# channel-group group_number modeauto|desirable|on 建立以太通道集合2950# show etherchannelgroup_number|brief|detail|load-balance|port|port-channel|su mmary 验证以太通道集合的配置4000>(enable) set spantree portfast slot_#/port_# enable 配置PortFast2950(config-if)# spanning-tree portfast 配置PortFast4000>(enable) set spantree uplinkfast enable|disable [rate station_update_rate] [all-protocols off|on] 启用/禁用UplinkFast4000>(enable) show spantree uplinkfast 验证UplinkFast配置2950(config)# spanning-tree uplinkfast [max_update_rate] 启用/禁用UplinkFast2950# show spanning-tree uplinkfast 验证UplinkFast配置4000>(enable) set spantree backbonefast enable|disable 启用/禁用BackboneFast4000>(enable) show spantree backbonefast 验证BackboneFast配置2950(config)# spanning-tree backbonefast 启用BackboneFast虚拟网间路由2600(config)# interface type slot_#/port_#.subint_number 配置子接口2600(config-subif)# encapsulation dot1q|isl|sde|tr-isl VLAN_# 配置封装类型4000>(enable) show module 查看交换机的硬件配置4000>(enable) session module_# 访问L3SML3SM(config-if)# mac-address mac_address 分配MAC地址MLS 2600(config)# mls rp ip 启动MLS2600(config-if)# mls rp vtp-domain domain_name 分配路由器接口到VTP域中2600(config-if)# mls rp vlan-id VLAN_# 向接口分配VLAN2600(config-if)# mls rp management-interface 指定该接口为管理接口2600# show mls rp 提供全局MLS信息2600# show mls rp interface type slot_#/port_# 提供指定接口的MLS信息2600# show mls rp vtp-domain domain_name 提供VTP域的MLS信息6500>(enable) set mls enable 在MLS-SE上启动MLS6500>(enable) set mls include rp_ip_address 告诉交换机哪一个IP地址是正确的6500>(enable) show mls include 显示外部路由处理器的IP地址列表6500>(enable) set mls flow[destination|destination-source|full] 告诉MLS交换机要缓存候选数据包的哪些信息6500>(enable) show mls entry 显示第三层缓存表6500>(enable) set mls agingtime aging_time 改变缓存的衰老时间(默认256秒,取值范围是8-2032秒中的8的倍数值)6500>(enable) set mls agingtime fast fast_aging_timepkt_threshold 改变快速衰老周期和数据包门限值6500>(enable) show mls ip 验证MLS-SE的配置6500>(enable) clear mls entry [destination IP_address] [source IP_address] [flow protocol] [source_port] [destination_port] [all] 删除所有或指定MLS缓存记录3550(config)# ip routing 启动IP路由3550(config)# ip cef 启动CEF3550(config-if)# no switchport 将第二层接口转换为第三层接口3550(config-if)# ip route-cache cef 在接口上启动CEF3550# show ip cef 验证CEF组播3640(config)# ip multicast-routing 启动路由器上的组播服务3640(config-if)# ip pim dense-mode 将接口设置为PIM密集模式3640(config-if)# ip pim sparse-mode 将接口设置为PIM稀疏模式3640(config-if)# ip pim sparsed-dense-mode 将接口设置为PIM 稀疏-密集模式3640(config)# ip pim rp-address IP_address group_ACL_# [override] 手工配置RP3640(config)# ip pim send-rp-announce type slot_#/port_# scope ttl_value group-list ACL_# 通告RP组的分配3640(config)# ip pim send-rp-discovery scope ttl_value 配置RP映射代理3640(config-if)# ip multicast ttl-threshold ttl_value 设置TTL门限值3640(config-if)# ip igmp join-group group_address 加入组播组3640# show ip mroute 查看组播信息3640# ping 验证RP之间或其他组播路由器之间的连接3640# mtrace source_IP_address [destination_IP_address] [group] 组播traceroute3640(config-if)# ip cgmp 配置CGMP路由器4000>(enable) set cgmp enable 启动CGMP4000>(enable) show cgmp statistics 查看CGMP统计信息4000>(enable) show multicast group cgmp 查看交换机了解到的组播组信息4000>(enable) set cgmp leave enable 检查由客户端产生的IGMPv2的离开信息4000>(enable) set igmp enable 启动IGMP4000>(enable) ip igmp snooping 启动IGMP探听4000>(enable) set igmp fastleave enable 启动快速离开过程4000>(enable) show igmp statistics 显示交换机上IGMP探听的状态信息QoS 2950(config)# wrr-queue cos-map queue_ID cos_value 建立队列2950(config)# wrr-queue bandwidth bandwidth_value 设置队列门限2950(config)# class-maps name 定义对信息传输分类时的匹配标准2950(config-cmap)# match access-group ACL_# 识别被分类的信息传输2950(config)# policy-map name 确定为接入信息传输所设置的分类标准2950(config-pmap)# class name2950(config-pmap-c)# set ip dscp number2950(config-if)# service-policy input name 对该接口应用策略3550(config)# mls qos 启动QoS3550(config-if)# auto qos voip 在接口上启动自动服务质量3550(config)# priority-list priority_queue_# protocol protocol high|medium|normal|low [list ACL_#] 为优先级队列定义信息流3550(config)# priority-list priority_queue_# queue-limit limit_# 定义特定优先级队列的最大队列空间3550(config-if)# priority-group priority_queue_# 向特定输出接口分配优先级队列3550(config)# queue-list queue_list_# interface typeslot_#/port_# queue_number 为一个特定的定制队列定义信息流3550(config)# queue-list queue_list_# queue queue_number byte-count size_in_bytes [limit number_of_queue] 为特定的定制队列定义队列的最大空间3550(config-if)# custom-queue-list custom_queue_number 为特定的输出接口分配优先级队列4840(config)# ip slb serverfarm serverfarm_name 配置SLB冗余4840(config-slb-sfarm)# real IP_address [port_#] 指定虚拟IP 地址4840(config-slb-sfarm)# inservice 启动服务器4840(config)# virtual IP_address [network_mask] tcp|udp [port_number|wsp|wsp-wtp|wsp-wtls|wsp-wtp-wtls] [service service_name] 建立虚拟服务器IP地址。
华三路由器交换机配置命令

路由器:1、进入SETUP模式Router#setup2、时间设置router#clock set hh:mm:ss date moth year3、 router>show historyRouter>terminal history size lines4、 router#show version5、 router#show running-config6、 router#show starup-config7、 router(config)#hostname name 主机命名8、 router(config)#banner motd # message # 开机时的固定显示信息9、 router(config)#enable password password 特权模式明文密码10、 router(config)#no enable password11、 router(config)#enable secret password 特权模式加密密码12、 router(config)#no enable secret13、 router(config)#service password-encryption特权模式把明文密码加密密码,但没enable secret安全可以反解14、 router(config)#line console控制台密码15、 router(config-line)#login16、 router(config-line)#password password17、 router(config-line)#exec-timeout mm ss 禁止控制台会话自动退出18、 router(config-line)#logging synchronous重显被打乱的控制台输入router(config)#no ip domain-lookup 禁止域名解析19、 router(config)#line vty 0 4虚拟终端密码20、 router(config-line)#login21、 router(config-line)#password password22、 router(config)#interface type number(slot/port)端口设置23、 router(config-if)#ip address ip summast24、 router(config-if)#clock rate 64000(时钟频率单位为bps,只在DCE端设置)25、 router(config-if)#bandwith 64(带宽设置,单位为KB)26、 router(config-if)#no shutdown(shutdown)27、 router(config-if )#media-type type(10base) 为以太网端口选择适当的介质类型28、 router(config-if )#ctrl+z保存退出到特权模式29、 router#30、 router>用户模式enable进入router#特权模式config terminal进入router(config)#全局配置模式31、Interface Router(config-if)#端口设置Subinterface Router(config-subif)# 子端口设置Controller Router(config-controller)# 控制口设置Line Router(config-line)# 虚拟口设置Router Router(config-router)# 路由设置IPX router Router(config-ipx-router)#IPX路由设置32、 router#show interface33、 router#show interface Ethernet 034、 router#show interface serial 035、 router#show running-config36、 router#show starup-config37、 router#show flash38、 router#show controller39、 router#show controller interface type40、 router#show running-configrouter#copy running-config starup-configrouter#copy running-config tftprouter#copy starup-config tftprouter#copy flash tftprouter#copy tftp star-configrouter#copy tftp flash--------------------------------------------------------------------------------端口状态Serial1 is up, line protocol is up正常工作Serial1 is up, line protocol is down连接问题Serial1 is down, line protocol is down端口问题Serial1 is administratively down, line protocol is down人为关闭配置寄存器的值1、关闭路由器的电源重新启动按住ctrl+break键入进2、>3、>o/r 0×2142(跳过nvarm启动恢复密码)4、>I5、当系统提示是否进入setup模式时,按N6、 router>7、 router>enable8、 router#9、进入修改后(包括密码、寄存器的值:0×2100为rom monitor启动、0×2101为setup 模式启动、0×2102为10、 router#copy running-config starup-config11、 router#reload12、也可以在router#setup进入setup模式静态路由协议设置router(config)#ip route network submask(要到达的网络号掩码)ip address(下一跳或出口ip地址)router(config)#ip route 0.0.0.0 s0(出口端口或下一跳IP地址)rip设置router(config)#router riprouter(config-router)#network network-numberrouter#show ip protocol查看RIP信息router#show ip route 查看路由表router#debug ip rip查看RIP更新信息router(config-router)#passive-interface e0(阻止发出作息)router(config-router)#ip rip receive version 1 2接收1、2RIP版本信息igrp设置router(config)#router igrp as numberrouter(config-router)#network network numberrouter#show ip route 查看路由表router#debug ip igrp events 查看IGRP路由更新大概信息router#debug ip igrp transaction 查看IGRP路由更新详细信息Router(config-router)#variance multiplier 控制 IGRP load balancingRouter(config-router)#traffic-share {balanced | min}控制load-balanced traffic 的分布eigrp设置router(config)#router eigrp as numberrouter(config-router)#network network numberrouter(config)#no auto-summry 关闭自动汇总router(config)# auto-summry 打开自动汇总(默认是打开的)router#show ip route eigrp 显示当前的路由表里的EIGRP条目router#show ip protocol 显示活动的路由协议进程的参数和当前的状态router#show ip eigrp neighbors 显示被EIGRP发现的邻居router#show ip eigrp traffic 显示发出和收到的IP EIGRP 包的数量router#show ip eigrp topology 显示IP EIGRP的拓扑表Router#debug ip eigrpospf设置1. Router(config)#router ospf process-idRouter(config-router)#network address(可以是网络号也可以是Ip地址 mask(通配掩码)area area-idRouter(config-if)# ip ospf priority numbe 配置OSPF的优先级Router#show ip protocols 验证OSPF的配置Router#show ip route 显示路由器学到的所有路由Router#show ip ospf interface type number 显示 area-ID 和邻接信息Router#show ip ospf neighbor 基于每接口显示OSPF邻居信息Router#debug ip ospf eventsRouter#debug ip ospf packet2. Router(config)# interface loopback number(lookback回路配置)Router(config-if)# ip address ip-address subnet-maskRouter(config-if)# ip ospf cost cost-numbe 修改OSPF 的Cost数值Router(config-if)# ip ospf authentication-key key 配置明文口令Router(config-if)# ip ospf messge-digest-key keyid md5 key 配置MD5口令(keyid和key必须配对一致,两邻居才可以通信)Router(config-route)# area area-id authentication [message-digest]message-digest为可选项,使用后路由器只传送口令消息的摘要(或散列)配置OSPF区域的验证:3. Router(config-if)# ip ospf hello-interval seconds 配置hello间隔:Router(config-if)# ip ospf dead-interval seconds配置down机判断间隔--------------------------------------------------------------------------------访问列表1.标准访问列表(standard access lists):只使用源IP地址来做过滤决定Router(config)#access-list 10 deny 172.16.40.0 0.0.0.255Router(config)#access-list 10 permit anyRouter(config)#int e1Router(config-if)#ip access-group 10 out使用IP标准ACL来控制VTY线路的访问.Router(config)#access-list 50 permit 172.16.10.3Router(config)#line vty 0 4Router(config-line)#access-class 50 in删除IP标准ACLRouter(config-line)#no ip access-class 50 inRouter(config)#no access-list 502.扩展访问列表(extended access lists):它比较源IP地址和目标IP地址,层3的协议字段,层4端口号来做过滤决定Router(config)#access-list 110 deny tcp any host 172.16.30.5 eq 21Router(config)#access-list 110 deny tcp any host 172.16.30.5 eq 23Router(config)#access-list 110 permit ip any anyRouter(config)#int e1Router(config-if)#ip access-group 110 out3.虚拟通道访问router(config)#access-list 12 permit 192.89.55.0 0.0.0.255router(config)#line vty 0 4outer(config-line)#access-class 12 in3.show ip interface:只显示IP访问列表信息4.show ip interface:显示所有接口的信息和配置的ACL信息5.show ip interface [接口号]:显示具体某个接口的信息和配置的ACL信息6.show running-config:显示DRAM信息和ACL信息,以及接口对ACL的应用信息. 交换机配置交换机上设置登陆口令Switch(config)# enable password level level passwordSwitch(config)# no enable password level level passwordhostname1900/2900(config)#hostname hostnameIP Address1900(config)#ip address {ip address} {mask}1900(config)#ip address 10.5.5.11 255.255.255.02950(config#interface vlan 12950(config-if)#ip address {ip_address} {mask}2950(config)#interface vlan 12950(config-if)#ip address 10.5.5.11 255.255.255.0default gateway1900/2950(config)#ip default-gateway {ip address}1900/2950(config)#ip default-gateway 172.20.137.1查看交换机的IP地址1900#show ipIP address: 10.5.5.11Subnet mask: 255.255.255.0Default gateway: 10.5.5.3Management VLAN: 12950#show interface vlan 1Vlan1 is up, line protocol is upHardware is Cat5k Virtual Ethernet, address is 0010.f6a9.9800 (bia 0010.f6a9.9800) Internet address is 172.16.80.79/24Broadcast address is 255.255.255.255设置双工选项1900(config)#interface e0/11900(config-if)#duplex {auto | full |full-flow-control | half}2950(config)#interface fe0/12950(config-if)#duplex {auto | full | half}设置端口速度:switch(config-if)# speed {10|100|auto}查勘双工选项Switch#show interfaces fastethernet0/3查看MAC地址表1900/2950#show mac-address-table配置永久MAC地址1900(config)#mac-address-table permanent {mac-address type module/port}1900(config)#mac-address-table permanent 2222.2222.2222 ethernet 0/31900#show mac-address-table2950(config)#mac-address-table static mac_addr {vlan vlan_id} [interface int1 [int2 ... int15]]--------------------------------------------------------------------------------配置受限静态MAC地址1900(config)#mac-address-table restricted static {mac-address type module/port src-if-list}1900(config)#mac-address-table restricted static 1111.1111.1111 e0/4 e0/11900#show mac-address-table2950(config)#mac-address-table secure mac-addr interface [vlan vlan-id]2950(config)#mac-address-table secure 0003.3333.3333 fa 0/1 vlan 12950#show mac-address-table配置端口安全性1900(config-if)#port secure max-mac-count count1900(config)#interface e0/41900(config-if)#port secure1900(config-if)#port secure max-mac-count 11900(config)#address-violation {suspend | disable | ignore1900# show mac-address-table security2950(config-if)#port security max-mac-count count2950(config)#interface fa0/12950(config-if)#port security2950(config-if)#port security max-mac-count 102950(config-if)#port security action {shutdown | trap} 2950#show mac-address-table secure2950#show port-security管理配置文件1900#copy nvram tftp://host/dst_file1900#copy tftp://host/src_file nvram1950#copy nvram tftp://10.1.1.1/wgswd.cfg2950#copy startup-config tftp://host/dst_file清除 NVRAM1900#delete nvram2950#erase startup-configvlan配置1900 VLAN建立1900下,使用vlan [vlan#] name [name] [vlan#]命令, 如下: >en#config t(config)#hostname 19001900(config)#vlan 2 name sales1900(config)#vlan 3 name marketing1900(config)#vlan 4 name mis1900(config)#exit端口分配1900(config)#int e0/21900(config-if)#vlan-membership static 21900(config)#int e0/41900(config-if)#vlan-membership static 31900(config)#int e0/51900(config-if)#vlan-membership static 41900(config-if)#exit1900(config)#exitVLAN验证1900#sh vlan2900 VLAN建立在2950下创建VLAN,在特权模式下使用vlan database命令2950#vlan database2950(vlan)#vlan 2 name MarketingVLAN 2 modified:Name: Marketing2950(vlan)#vlan 3 name AccountingVLAN 3 added:Name: Accounting2950(vlan)#applyAPPLY complete2950(vlan)#Ctrl+C2950#端口分配2950下的端口配置,使用switchport access vlan [vlan#]命令, 2950(config-if)#int f0/22950(config-if)#switchport access vlan 22950(config-if)#int f0/32950(config-if)#switchport access vlan 32950(config-if)#int f0/42950(config-if)#switchport access vlan 42950(config-if)#exit2950(config)#exit验证配置信息,如下:2950#sh vlan或2950#sh vlan brieftrunk配置1900 trunk配置1900(config)#int f0/261900(config-if)#trunk on2950下在接口配置模式,使用switchport命令,如下:2950(config)#int f0/122950(config-if)#switchport mode trunk2950(config-if)# switchport trunk encapsulation {isl|dot1q}2950(config-if)#^Z将某VLAN从中继中删除2950(config-if)# switchport trunk allowed vlan remove vlan-list添加某个VLAN到中继线路2950(config-if)# switchport trunk allowed vlan add vlan-listConfiguring Inter-VLAN Routing给连接1900的trunk端口配置,使用encapsulation isl [vlan#]命令,如下:2600Router(config)#int f0/0.12600Router(config-subif)#encapsulation isl [vlan#]2600Router(config-subif)#ip add ip add submask给连接2950的这样配置,如下:2600Router(config)#int f0/0.12600Router(config-subif)#encapsulation dot1q [vlan#]2600Router(config-subif)#ip add ip add submask--------------------------------------------------------------------------------VTP配置1900(config)#vtp server1900(config)#vtp domain noco1900(config)#vtp password noko在特权模式下使用show vtp命令验证,如下:1900#sh vtpVTP version: 1Configuration revision: 0Maximum VLANs supported locally: 1005Number of existing VLANs: 5VTP domain name: nocoVTP password: nokoVTP operating mode: Server2950如下:2950(config)#vtp mode server2950(config)#vtp domain noco验证信息,如下:2950#sh vtp ?counters VTP statisticsstatus VTP domain status2950#sh vtp statusNAT配置配置静态转换Router(config)#ip nat inside source static local-ip global-ipRouter(config-if)#ip nat insideRouter(config-if)#ip nat outside配置动态地址转换Router(config)#ip nat pool name start-ip end-ip {netmask netmask | prefix-length prefix-length}Router(config)#access-list access-list-number permit source [source-wildcard]Router(config)#ip nat inside source listaccess-list-number pool name配置OverloadingRouter(config)#access-list access-list-number permitsource source-wildcardRouter(config)#ip nat inside source listaccess-list-number interface interface overload清除NAT Translation TableRouter#clear ip nat translation * 清除所有的动态地址转换条目Router#clear ip nat translation inside global-iplocal-ip [outside local-ip global-ip] 清除一个简单的动态地址转换条目(内、外)Router#clear ip nat translation outsidelocal-ip global-ip清除一个简单的动态地址转换(外)Router#clear ip nat translation protocol inside global-ipglobal-port local-ip local-port [outside local-iplocal-port global-ip global-port] 清除一个扩展动态地址转换条目Show命令输出信息Router#show ip nat translations------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------交换机:1.在基于IOS的交换机上设置主机名/系统名:switch(config)# hostname hostname在基于CLI的交换机上设置主机名/系统名:switch(enable) set system name name-string2.在基于IOS的交换机上设置登录口令:switch(config)# enable password level 1 password在基于CLI的交换机上设置登录口令:switch(enable) set passwordswitch(enable) set enalbepass3.在基于IOS的交换机上设置远程访问:switch(config)# interface vlan 1switch(config-if)# ip address ip-address netmaskswitch(config-if)# ip default-gateway ip-address在基于CLI的交换机上设置远程访问:switch(enable) set interface sc0 ip-address netmask broadcast-addressswitch(enable) set interface sc0 vlanswitch(enable) set ip route default gateway4.在基于IOS的交换机上启用和浏览CDP信息:switch(config-if)# cdp enableswitch(config-if)# no cdp enable为了查看Cisco邻接设备的CDP通告信息:switch# show cdp interface [type modle/port]switch# show cdp neighbors [type module/port] [detail]在基于CLI的交换机上启用和浏览CDP信息:switch(enable) set cdp {enable|disable} module/port为了查看Cisco邻接设备的CDP通告信息:switch(enable) show cdp neighbors[module/port] [vlan|duplex|capabilities|detail] 5.基于IOS的交换机的端口描述:switch(config-if)# de脚本ion de脚本ion-string基于CLI的交换机的端口描述:switch(enable)set port name module/number de脚本ion-string6.在基于IOS的交换机上设置端口速度:switch(config-if)# speed{10|100|auto}在基于CLI的交换机上设置端口速度:switch(enable) set port speed moudle/number {10|100|auto}switch(enable) set port speed moudle/number {4|16|auto}7.在基于IOS的交换机上设置以太网的链路模式:switch(config-if)# duplex {auto|full|half}在基于CLI的交换机上设置以太网的链路模式:switch(enable) set port duplex module/number {full|half}8.在基于IOS的交换机上配置静态VLAN:switch# vlan databaseswitch(vlan)# vlan vlan-num name vlaswitch(vlan)# exitswitch# configure teriminalswitch(config)# interface interface module/numberswitch(config-if)# switchport mode accessswitch(config-if)# switchport access vlan vlan-numswitch(config-if)# end在基于CLI的交换机上配置静态VLAN:switch(enable) set vlan vlan-num [name name]switch(enable) set vlan vlan-num mod-num/port-list9. 在基于IOS的交换机上配置VLAN中继线:switch(config)# interface interface mod/portswitch(config-if)# switchport mode trunkswitch(config-if)# switchport trunk encapsulation {isl|dotlq}switch(config-if)# switchport trunk allowed vlan remove vlan-listswitch(config-if)# switchport trunk allowed vlan add vlan-list在基于CLI的交换机上配置VLAN中继线:switch(enable) set trunk module/port [on|off|desirable|auto|nonegotiate]Vlan-range [isl|dotlq|dotl0|lane|negotiate]--------------------------------------------------------------------------------10.在基于IOS的交换机上配置VTP管理域:switch# vlan databaseswitch(vlan)# vtp domain domain-name在基于CLI的交换机上配置VTP管理域:switch(enable) set vtp [domain domain-name]11.在基于IOS的交换机上配置VTP 模式:switch# vlan databaseswitch(vlan)# vtp domain domain-nameswitch(vlan)# vtp {sever|cilent|transparent}switch(vlan)# vtp password password在基于CLI的交换机上配置VTP 模式:switch(enable) set vtp [domain domain-name] [mode{ sever|cilent|transparent }][password password]12. 在基于IOS的交换机上配置VTP版本:switch# vlan databaseswitch(vlan)# vtp v2-mode在基于CLI的交换机上配置VTP版本:switch(enable) set vtp v2 enable13. 在基于IOS的交换机上启动VTP剪裁:switch# vlan databaseswitch(vlan)# vtp pruning在基于CL I 的交换机上启动VTP剪裁:switch(enable) set vtp pruning enable14.在基于IOS的交换机上配置以太信道:switch(config-if)# port group group-number [distribution {source|destination}] 在基于CLI的交换机上配置以太信道:switch(enable) set port channel moudle/port-range mode{on|off|desirable|auto}--------------------------------------------------------------------------------15.在基于IOS的交换机上调整根路径成本:switch(config-if)# spanning-tree [vlan vlan-list] cost cost在基于CLI的交换机上调整根路径成本:switch(enable) set spantree portcost moudle/port costswitch(enable) set spantree portvlancost moudle/port [cost cost][vlan-list]16.在基于IOS的交换机上调整端口ID:switch(config-if)# spanning-tree[vlan vlan-list]port-priority port-priority在基于CLI的交换机上调整端口ID:switch(enable) set spantree portpri {mldule/port}priorityswitch(enable) set spantree portvlanpri {module/port}priority [vlans]17. 在基于IOS的交换机上修改STP时钟:switch(config)# spanning-tree [vlan vlan-list] hello-time secondsswitch(config)# spanning-tree [vlan vlan-list] forward-time secondsswitch(config)# spanning-tree [vlan vlan-list] max-age seconds在基于CLI的交换机上修改STP时钟:switch(enable) set spantree hello interval[vlan]switch(enable) set spantree fwddelay delay [vlan]switch(enable) set spantree maxage agingtiame[vlan]18. 在基于IOS的交换机端口上启用或禁用Port Fast 特征:switch(config-if)#spanning-tree portfast在基于CLI的交换机端口上启用或禁用Port Fast 特征:switch(enable) set spantree portfast {module/port}{enable|disable}19. 在基于IOS的交换机端口上启用或禁用UplinkFast 特征:switch(config)# spanning-tree uplinkfast [max-update-rate pkts-per-second]在基于CLI的交换机端口上启用或禁用UplinkFast 特征:switch(enable) set spantree uplinkfast {enable|disable}[rate update-rate] [all-protocols off|on]--------------------------------------------------------------------------------20. 为了将交换机配置成一个集群的命令交换机,首先要给管理接口分配一个IP地址,然后使用下列命令: switch(config)# cluster enable cluster-name cv21. 为了从一条中继链路上删除VLAN,可使用下列命令:switch(enable) clear trunk module/port vlan-range22. 用show vtp domain 显示管理域的VTP参数.23. 用show vtp statistics显示管理域的VTP参数.24. 在Catalyst交换机上定义TrBRF的命令如下:switch(enable) set vlan vlan-name [name name] type trbrf bridge bridge-num[stp {ieee|ibm}]--------------------------------------------------------------------------------25. 在Catalyst交换机上定义TrCRF的命令如下:switch (enable) set vlan vlan-num [name name] type trcrf{ring hex-ring-num|decring decimal-ring-num} parent vlan-num26. 在创建好TrBRF VLAN之后,就可以给它分配交换机端口.对于以太网交换,可以采用如下命令给VLAN分配端口:switch(enable) set vlan vlan-num mod-num/port-num27. 命令show spantree显示一个交换机端口的STP状态.28. 配置一个ELAN的LES和BUS,可以使用下列命令:ATM (config)# interface atm number.subint multiointATM(config-subif)# lane serber-bus ethernet elan-name29. 配置LECS:ATM(config)# lane database database-nameATM(lane-config-databade)# name elan1-name server-atm-address les1-nsap-addressATM(lane-config-databade)# name elan2-name server-atm-address les2-nsap-addressATM(lane-config-databade)# name …--------------------------------------------------------------------------------30. 创建完数据库后,必须在主接口上启动LECS.命令如下:ATM(config)# interface atm numberATM(config-if)# lane config database database-nameATM(config-if)# lane config auto-config-atm-address31. 将每个LEC配置到一个不同的ATM子接口上.命令如下:ATM(config)# interface atm number.subint multipointATM(config)# lane client ethernet vlan-num elan-num32. 用show lane server 显示LES的状态.33. 用show lane bus显示bus的状态.34. 用show lane database显示LECS数据库可内容.35. 用show lane client显示LEC的状态.36. 用show module显示已安装的模块列表.37. 用物理接口建立与VLAN的连接:router# configure terminalrouter(config)# interface media module/portrouter(config-if)# de脚本ion de脚本ion-stringrouter(config-if)# ip address ip-addr subnet-maskrouter(config-if)# no shutdown38. 用中继链路来建立与VLAN的连接:router(config)# interface module/port.subinterfacerouter(config-ig)# encapsulation[isl|dotlq] vlan-numberrouter(config-if)# ip address ip-address subnet-mask39. 用LANE 来建立与VLAN的连接:router(config)# interface atm module/portrouter(config-if)# no ip addressrouter(config-if)# atm pvc 1 0 5 qsaalrouter(config-if)# atm pvc 2 0 16 ilnirouter(config-if)# interface atm module/port.subinterface multipoint router(config-if)# ip address ip-address subnet-maskrouter(config-if)# lane client ethernet elan-numrouter(config-if)# interface atm module/port.subinterface multipointrouter(config-if)# ip address ip-address subnet-namerouter(config-if)# lane client ethernet elan-namerouter(config-if)# …--------------------------------------------------------------------------------40. 为了在路由处理器上进行动态路由配置,可以用下列IOS命令来进行:router(config)# ip routingrouter(config)# router ip-routing-protocolrouter(config-router)# network ip-network-numberrouter(config-router)# network ip-network-number ()41. 配置默认路由:switch(enable) set ip route default gateway42. 为一个路由处理器分配VLANID,可在接口模式下使用下列命令:router(config)# interface interface numberrouter(config-if)# mls rp vlan-id vlan-id-num43. 在路由处理器启用MLSP:router(config)# mls rp ip44. 为了把一个外置的路由处理器接口和交换机安置在同一个VTP域中:router(config)# interface interface numberrouter(config-if)# mls rp vtp-domain domain-name45. 查看指定的VTP域的信息:router# show mls rp vtp-domain vtp domain name46. 要确定RSM或路由器上的管理接口,可以在接口模式下输入下列命令:router(config-if)#mls rp management-interface47. 要检验MLS-RP的配置情况:router# show mls rp48. 检验特定接口上的MLS配置:router# show mls rp interface interface number49. 为了在MLS-SE上设置流掩码而又不想在任一个路由处理器接口上设置访问列表:set mls flow [destination|destination-source|full]50. 为使MLS和输入访问列表可以兼容,可以在全局模式下使用下列命令:router(config)# mls rp ip input-acl--------------------------------------------------------------------------------51. 当某个交换机的第3层交换失效时,可在交换机的特权模式下输入下列命令:switch(enable) set mls enable52. 若想改变老化时间的值,可在特权模式下输入以下命令:switch(enable) set mls agingtime agingtime53. 设置快速老化:switch(enable) set mls agingtime fast fastagingtime pkt_threshold54. 确定那些MLS-RP和MLS-SE参与了MLS,可先显示交换机引用列表中的内容再确定:switch(enable) show mls include55. 显示MLS高速缓存记录:switch(enable) show mls entry56. 用命令show in arp显示ARP高速缓存区的内容。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
!
!
no aaa new-model
memory-size iomem 5
!
!
ip cef
!
!
no ip domain lookup
!
!
!
!
!
interface Port-channel1
!
interface FastEthernet0/0
!
interface FastEthernet0/1
2950A(config-if-range)#exit//返回全局配置模式
2950A(config)#end//退出
2950A#show running-config//查看配置情况
Building configuration...
Current configuration : 1079 bytes
2950B(config-line)#exit//返回特权模式
2950B(config)#end//返回全局配置模式
//创建vlan
2950B#vlan database//进入VLAN数据库
2950B(vlan)#vlan 10//创建VLAN10
VLAN 10 added:
Name: VLAN0010
实验一
一.实验拓扑图
二.实验要求
1、在两台2950交换机上创立VLAN10、VLAN20、VLAN30和VLAN40。
2、把两个交换机上的interface f0/21分配给VLAN10,interface f0/22分配给VLAN20,interface f0/23分配给VLAN30,interface f0/24分配给VLAN40。
2950B(config-if)#switchport trunk encapsulation dot1q//配置封装协议
2950B(config-if)#no shutdown//开启接口
2950B(config-if)#exit//退出
//做以太通道中继线路
2950B(config)#int range fa0/1–2//进入fa0/1和fa0/ 2接口
2950B(config-if)#switchport access vlan 10//把fa0/21加入VLAN10
2950B(config-if)#no shutdown//开启接口
2950B(config-if)#exit//退出
2950B(config)#int fa0/22//进入fa0/22接口
2950B(config-if)#no shutdown//开启接口
2950B(config-if)#exit//退出
//做干道
2950B(config)#int fa0/5//进入fa0/5接口
2950B(config-if)#switchport mode trunk//配置接口模式为trunk
2950A(config-if)#switchport trunk encapsulation dot1q//配置封装协议
2950A(config-if)#no shutdown//开启接口
2950A(config-if)#exit//退出
//做以太通道中继线路
2950A(config)#int range fa0/1–2//进入fa0/1和fa0/2接口
2950A(vlan)#vlan 10//创建VLAN10
VL0
2950A(vlan)#vlan 20//创建VLAN20
VLAN 20 added:
Name: VLAN0020
2950A(vlan)#vlan 30//创建VLAN30
VLAN 30 added:
2950B(vlan)#vlan 20//创建VLAN20
VLAN 20 added:
Name: VLAN0020
2950B(vlan)#vlan 30//创建VLAN30
VLAN 30 added:
Name: VLAN0030
2950B(vlan)#vlan 40//创建VLAN40
VLAN 40 added:
2950B(config)#no ip dolo//关闭域名解析功能
2950B(config)#line con 0//进入控制线0
2950B(config-line)#logg syn//光标同步
2950B(config-line)#exec-time 0 0//对Console口进行空闲超时时间的配置
2950A(config-if)#no shutdown//开启接口
2950A(config-if)#exit//退出
//做干道
2950A(config)#int fa0/5//进入fa0/5接口
2950A(config-if)#switchport mode trunk//配置接口模式为trunk
四.实验配置
2950交换机的配置:
Switch>en//进入特权模式
Switch#configt//进入全局配置模式
Switch(config)#hostname2950A//设置主机名为2950A
2950A(config)#no ip dolo//关闭域名解析功能
2950A(config)#line con 0//进入控制线0
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname 2950A
!
boot-start-marker
Name: VLAN0040
2950B(vlan)#exit//退出
APPLY completed.
Exiting....
//把端口划分到vlan里
2950B#conf t//进入端口配置模式
2950B(config)#int fa0/21//进入fa0/21接口
2950B(config-if)#switchport mode access//配置接口模式为access
2950B(config-if)#exit//退出
2950B(config)#int fa0/24//进入fa0/24接口
2950B(config-if)#switchport mode access//配置接口模式为access
2950B(config-if)#switchport access vlan 40//把fa0/22加入VLAN40
2950A(config-if-range)#channel-group 1 mode on//配置二层的端口汇聚
Creating a port-channel interface Port-channel1//创建以太通道的接口
2950A(config-if-range)#no shutdown//开启接口
2950A(config-if)#no shutdown//开启接口
2950A(config-if)#exit//退出
2950A(config)#int fa0/24//进入fa0/24接口
2950A(config-if)#switchport mode access//配置接口模式为access
2950A(config-if)#switchport access vlan 40//把fa0/24加入VLAN40
2950B(config)#int fa0/23//进入fa0/23接口
2950B(config-if)#switchport mode access//配置接口模式为access
2950B(config-if)#switchport access vlan 30//把fa0/22加入VLAN30
2950B(config-if)#no shutdown//开启接口
2950B(config-if-range)#channel-group 1 mode on//配置二层的端口汇聚
service timestamps log datetime msec
no service password-encryption
!
hostname 2950A
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
2950A(config-if)#no shutdown//开启接口
2950A(config-if)#exit//退出
2950A(config)#int fa0/23//进入fa0/23接口
2950A(config-if)#switchport mode access//配置接口模式为access
2950A(config-if)#switchport access vlan 30//把fa0/23加入VLAN30
2950A(config)#int fa0/21//进入fa0/21接口
2950A(config-if)#switchport mode access//配置接口模式为access
2950A(config-if)#switchport access vlan 10//把fa0/21加入VLAN10
2950A(config-if)#no shutdown//开启接口
2950A(config-if)#exit//退出
2950A(config)#int fa0/22//进入fa0/22接口
2950A(config-if)#switchport mode access//配置接口模式为access