1功能需求及组网说明
三层交换机典型应用配置实例 「配置环境参数」
1. Switch A为三层交换机
2. PC1连接到Switch A的以太网端口E0/1,属于VLAN10 3. PC2连接到Switch A的以太网端口E0/2,属于VLAN20 4. Route A连接到Switch A的以太网端口E0/24口,属于VLAN100
5. Switch A的VLAN接口10的IP地址为10.1.1.1/24,VLAN接口20的IP地址为20.1.1.1/24,分别作为PC1和PC2的网关。
6. Switch A与Route A所连接的VLAN100的IP地址为192.168.1.1/24.Route A连Switch A的Eth0接口地址为192.168.1.2/24 「组网需求」
PC1和PC2可以通过Switch A进行互通,PC1各PC2可以通过Route A上外网。(这里假设Route A的IP及NAT等功能都配置OK,所以只给出Route A在此应用的关键配置。)
2数据配置步骤
「在Switch A上创建VLAN及VLAN接口静态IP地址配置」 创建VLAN接口,并配置IP地址。 1. 创建(进入)VLAN10 [Switch A]vlan 10
2. 将E0/1加入到VLAN10 [Switch A-vlan10]port Ethernet 0/1 3. 创建(进入)VLAN接口10 [Switch A]interface Vlan-interface 10 4. 为VLAN接口10配置IP地址
[Switch A-Vlan-interface10]ip address 10.1.1.1 255.255.255.0 5. 创建(进入)VLAN20 [Switch A]vlan 20
6. 将E0/2加入到VLAN20 [Switch A-vlan20]port Ethernet 0/2 7. 创建(进入)VLAN接口20 [Switch A]interface Vlan-interface 20 8. 为VLAN接口20配置IP地址
[Switch A-Vlan-interface20]ip address 20.1.1.1 255.255.255.0 9. 创建(进入)VLAN100 [Switch A]vlan 100
10. 将E0/24加入到VLAN100 [Switch A-vlan100port Ethernet 0/24 11. 创建(进入)VLAN接口100 [Switch A]interface Vlan-interface 100 12. 为VLAN接口100配置IP地址
[Switch A-Vlan-interface100]ip address 192.168.1.2 255.255.255.0 「Switch A路由设置」
13. 设置交换机的默认路由的下跳到Route A [Switch A]ip route 0.0.0.0 0.0.0.0 192.168.1.1 「Route A路由设置」
14. 在Route A上设置到Switch A的回程路由 [Route A]ip route 10.1.1.0 255.255.255.0 192.168.1.2 [Route A]ip route 20.1.1.0 255.255.255.0 192.168.1.2 「补充说明」
交换机的VLAN虚接口承载在物理端口之上,即某VLAN所包含的物理端口UP之后,该VLAN虚接口才会UP.
对于三层交换机,可以为多个VLAN接口配置IP地址,而且默认情况下各个VLAN接口之间可以访问;对于二层交换机来说,为VLAN接口配置的IP地址只能用于管理。 更多请看Cisco与华为技术网(Vlan9.com)三层交换、交换机与路由器密码恢复、交换机选购专题,或进入论坛讨论。
1.在基于IOS的交换机上设置主机名/系统名: switch(config)# hostname hostname
在基于CLI的交换机上设置主机名/系统名: switch(enable) set system name name-string 2.在基于IOS的交换机上设置登录口令: switch(config)# enable password level 1 password
在基于CLI的交换机上设置登录口令: switch(enable) set password switch(enable) set enalbepass
3.在基于IOS的交换机上设置远程访问: switch(config)# interface vlan 1
switch(config-if)# ip address ip-address netmask switch(config-if)# ip default-gateway ip-address 在基于CLI的交换机上设置远程访问:
switch(enable) set interface sc0 ip-address netmask broadcast-address switch(enable) set interface sc0 vlan switch(enable) set ip route default gateway
4.在基于IOS的交换机上启用和浏览CDP信息: switch(config-if)# cdp enable switch(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)# description description-string 基于CLI的交换机的端口描述:
switch(enable)set port name module/number description-string
6.在基于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 database
switch(vlan)# vlan vlan-num name vla
switch(vlan)# exit switch# configure teriminal
switch(config)# interface interface module/number switch(config-if)# switchport mode access switch(config-if)# switchport access vlan vlan-num switch(config-if)# end
在基于CLI的交换机上配置静态VLAN: switch(enable) set vlan vlan-num [name name] switch(enable) set vlan vlan-num mod-num/port-list
9. 在基于IOS的交换机上配置VLAN中继线: switch(config)# interface interface mod/port switch(config-if)# switchport mode trunk
switch(config-if)# switchport trunk encapsulation {isl|dotlq} switch(config-if)# switchport trunk allowed vlan remove vlan-list switch(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 database
switch(vlan)# vtp domain domain-name
在基于CLI的交换机上配置VTP管理域: switch(enable) set vtp [domain domain-name]
11.在基于IOS的交换机上配置VTP 模式: switch# vlan database
switch(vlan)# vtp domain domain-name switch(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 database switch(vlan)# vtp v2-mode
在基于CLI的交换机上配置VTP版本: switch(enable) set vtp v2 enable
13. 在基于IOS的交换机上启动VTP剪裁: switch# vlan database switch(vlan)# vtp pruning
在基于CL I 的交换机上启动VTP剪裁: switch(enable) set vtp pruning enable
14.在基于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 cost
switch(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}priority
switch(enable) set spantree portvlanpri {module/port}priority [vlans]
17. 在基于IOS的交换机上修改STP时钟:
switch(config)# spanning-tree [vlan vlan-list] hello-time seconds switch(config)# spanning-tree [vlan vlan-list] forward-time seconds ` switch(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
21. 为了从一条中继链路上删除VLAN,可使用下列命令: switch(enable) clear trunk module/port vlan-range
22. 用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-num
26. 在创建好TrBRF VLAN之后,就可以给它分配交换机端口.对于以太网交换,可以采用如下命令给VLAN分配端口:
switch(enable) set vlan vlan-num mod-num/port-num
27. 命令show spantree显示一个交换机端口的STP状态.
28. 配置一个ELAN的LES和BUS,可以使用下列命令: ATM (config)# interface atm number.subint multioint ATM(config-subif)# lane serber-bus ethernet elan-name
29. 配置LECS:
ATM(config)# lane database database-name
ATM(lane-config-databade)# name elan1-name server-atm-address les1-nsap-address ATM(lane-config-databade)# name elan2-name server-atm-address les2-nsap-address
ATM(lane-config-databade)# name …
30. 创建完数据库后,必须在主接口上启动LECS.命令如下:
ATM(config)# interface atm number
ATM(config-if)# lane config database database-name ATM(config-if)# lane config auto-config-atm-address
31. 将每个LEC配置到一个不同的ATM子接口上.命令如下: ATM(config)# interface atm number.subint multipoint ATM(config)# lane client ethernet vlan-num elan-num
32. 用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 terminal
router(config)# interface media module/port router(config-if)# description description-string router(config-if)# ip address ip-addr subnet-mask router(config-if)# no shutdown
38. 用中继链路来建立与VLAN的连接: router(config)# interface module/port.subinterface router(config-ig)# encapsulation[isl|dotlq] vlan-number router(config-if)# ip address ip-address subnet-mask
39. 用LANE 来建立与VLAN的连接: router(config)# interface atm module/port router(config-if)# no ip address router(config-if)# atm pvc 1 0 5 qsaal router(config-if)# atm pvc 2 0 16 ilni
router(config-if)# interface atm module/port.subinterface multipoint router(config-if)# ip address ip-address subnet-mask router(config-if)# lane client ethernet elan-num
router(config-if)# interface atm module/port.subinterface multipoint router(config-if)# ip address ip-address subnet-name router(config-if)# lane client ethernet elan-name router(config-if)# …
40. 为了在路由处理器上进行动态路由配置,可以用下列IOS命令来进行: router(config)# ip routing
router(config)# router ip-routing-protocol router(config-router)# network ip-network-number router(config-router)# network ip-network-number H3C防火墙常用配置命令
2009-10-19 11:21 配置防火墙网页登陆
1. 配置防火墙缺省允许报文通过。
[H3C] firewall packet-filter default permit
2. 为防火墙的以太网接口(以Ethernet0/0为例)配置IP地址,并将接口加入到安全区域。
[H3C] interface Ethernet0/0
[H3C-Ethernet0/0] ip address 192.168.0.1 255.255.255.0 [H3C-Ethernet0/0] quit [H3C] firewall zone trust
[H3C-zone-trust] add interface Ethernet0/0 [H3C-zone-trust]quit
3. 为PC配置IP地址。
假设PC的IP地址为192.168.0.2。 4. 使用Ping命令验证网络连接性。
5.添加登录用户
为使用户可以通过Web登录,并且有权限对防火墙进行管理,必须为用户添加登录帐户并且赋予其权限。
例如:建立一个帐户名和密码都为admin,帐户类型为telnet,权限等级为3的管理员用户。
[H3C] local-user admin
[H3C-luser-admin] password simple admin [H3C-luser-admin] service-type telnet [H3C-luser-admin] level 3
在PC上启动浏览器(建议使用IE5.0及以上版本),在地址栏中输入IP地址“192.168.0.1”后回车,即
可进入防火墙Web登录页面,使用之前创建的admin帐户登录防火墙,单击
以通过“Language”下拉框选择界面语言
内部主机通过域名区分并访问对应的内部服务器组网应用 1)配置easy ip(不用配地址池,直接通过接口地址做转换) nat outbound acl-number
2)DNS MAP
nat dns-map domain-name global-addr global-port [ tcp | udp ] 实例:
# 在Ethernet0/0/0 接口上配置FTP 及WWW内部服务器。 [H3C] interface ethernet0/0/0
[H3C-Ethernet0/0/0] ip address 1.1.1.1 255.0.0.0 [H3C-Ethernet0/0/0] nat outbound 2000
[H3C-Ethernet0/0/0] nat server protocol tcp global 1.1.1.1 www inside 10.0.0.2 www
[H3C-Ethernet0/0/0] nat server protocol tcp global 1.1.1.1 ftp inside 10.0.0.3 ftp
[H3C-Ethernet0/0/0] quit
# 配置访问控制列表,允许10.0.0.0/8 网段访问Internet。 [H3C] acl number 2000
[H3C-acl-basic-2000] rule 0 permit source 10.0.0.0 0.0.0.255 [H3C-acl-basic-2000] rule 1 deny # 配置ethernet1/0/0。
[H3C] interface ethernet1/0/0
[H3C-Ethernet1/0/0] ip address 10.0.0.1 255.0.0.0
此时外部主机可以通过域名www.zc.com 和ftp.zc.com 访问其对应的内部服务器。
加上如下配置后,内部主机也可以通过域名www.zc.com 和ftp.zc.com 访问其对应
的内部服务器。
# 配置域名与外部地址、端口号、协议类型之间的映射。 [H3C] nat dns-map www.zc.com 1.1.1.1 80 tcp [H3C] nat dns-map ftp.zc.com 1.1.1.1 21 tcp
H3C各种型号交换机端口镜像配置方法总结
作者:深圳教育在线 来源:szedu.net 更新日期:2009-2-25
一、端口镜像概念:
Port Mirror(端口镜像)是用于进行网络性能监测。可以这样理解:在端口A 和端口B 之间建立镜像关系,这样,通过端口A 传输的数据将同时复制到端口B ,以便于在端口B 上连接的分析仪或者分析软件进行性能分析或故障判断。
二、端口镜像配置 『环境配置参数』
1. PC1接在交换机E0/1端口,IP地址1.1.1.1/24 2. PC2接在交换机E0/2端口,IP地址2.2.2.2/24 3. E0/24为交换机上行端口
4. Server接在交换机E0/8端口,该端口作为镜像端口 『组网需求』
1. 通过交换机端口镜像的功能使用server对两台pc的业务报文进行监控。 2. 按照镜像的不同方式进行配置: 1) 基于端口的镜像 2) 基于流的镜像
2 数据配置步骤
『端口镜像的数据流程』
基于端口的镜像是把被镜像端口的进出数据报文完全拷贝一份到镜像端口,这样来进行流量观测或者故障定位。 【3026等交换机镜像】
S2008/S2016/S2026/S2403H/S3026等交换机支持的都是基于端口的镜像,有两种方法: 方法一
1. 配置镜像(观测)端口 [SwitchA]monitor-port e0/8 2. 配置被镜像端口
[SwitchA]port mirror Ethernet 0/1 to Ethernet 0/2 方法二
1. 可以一次性定义镜像和被镜像端口
[SwitchA]port mirror Ethernet 0/1 to Ethernet 0/2 observing-port Ethernet 0/8 【8016交换机端口镜像配置】
1. 假设8016交换机镜像端口为E1/0/15,被镜像端口为E1/0/0,设置端口1/0/15为端口镜像的观测端口。
[SwitchA] port monitor ethernet 1/0/15
2. 设置端口1/0/0为被镜像端口,对其输入输出数据都进行镜像。 [SwitchA] port mirroring ethernet 1/0/0 both ethernet 1/0/15 也可以通过两个不同的端口,对输入和输出的数据分别镜像 1. 设置E1/0/15和E2/0/0为镜像(观测)端口 [SwitchA] port monitor ethernet 1/0/15
2. 设置端口1/0/0为被镜像端口,分别使用E1/0/15和E2/0/0对输入和输出数据进行镜像。
[SwitchA] port mirroring gigabitethernet 1/0/0 ingress ethernet 1/0/15 [SwitchA] port mirroring gigabitethernet 1/0/0 egress ethernet 2/0/0 『基于流镜像的数据流程』
基于流镜像的交换机针对某些流进行镜像,每个连接都有两个方向的数据流,对于交换机来说这两个数据流是要分开镜像的。 【3500/3026E/3026F/3050】 〖基于三层流的镜像〗 1. 定义一条扩展访问控制列表 [SwitchA]acl num 100
2. 定义一条规则报文源地址为1.1.1.1/32去往所有目的地址 [SwitchA-acl-adv-101]rule 0 permit ip source 1.1.1.1 0 destination any 3. 定义一条规则报文源地址为所有源地址目的地址为1.1.1.1/32 [SwitchA-acl-adv-101]rule 1 permit ip source any destination 1.1.1.1 0 4. 将符合上述ACL规则的报文镜像到E0/8端口 [SwitchA]mirrored-to ip-group 100 interface e0/8 〖基于二层流的镜像〗 1. 定义一个ACL [SwitchA]acl num 200
2. 定义一个规则从E0/1发送至其它所有端口的数据包
[SwitchA]rule 0 permit ingress interface Ethernet0/1 egress interface Ethernet0/2 3. 定义一个规则从其它所有端口到E0/1端口的数据包
[SwitchA]rule 1 permit ingress interface Ethernet0/2 egress interface Ethernet0/1 4. 将符合上述ACL的数据包镜像到E0/8
[SwitchA]mirrored-to link-group 200 interface e0/8 【5516/6506/6503/6506R】
目前该三款产品支持对入端口流量进行镜像 1. 定义镜像端口
[SwitchA]monitor-port Ethernet 3/0/2 2. 定义被镜像端口
[SwitchA]mirroring-port Ethernet 3/0/1 inbound 【补充说明】
1. 镜像一般都可以实现高速率端口镜像低速率端口,例如1000M端口可以镜像100M端口,反之则无法实现
2. 8016支持跨单板端口镜像端口镜像配置 『环境配置参数』
1. PC1接在交换机E0/1端口,IP地址1.1.1.1/24 2. PC2接在交换机E0/2端口,IP地址2.2.2.2/24 3. E0/24为交换机上行端口
4. Server接在交换机E0/8端口,该端口作为镜像端口 『组网需求』
1. 通过交换机端口镜像的功能使用server对两台pc的业务报文进行监控。 2. 按照镜像的不同方式进行配置: 1) 基于端口的镜像 2) 基于流的镜像 2 数据配置步骤
『端口镜像的数据流程』
基于端口的镜像是把被镜像端口的进出数据报文完全拷贝一份到镜像端口,这样来进行
流量观测或者故障定位。 【3026等交换机镜像】
S2008/S2016/S2026/S2403H/S3026等交换机支持的都是基于端口的镜像,有两种方法: 方法一
1. 配置镜像(观测)端口 [SwitchA]monitor-port e0/8 2. 配置被镜像端口
[SwitchA]port mirror Ethernet 0/1 to Ethernet 0/2 方法二
1. 可以一次性定义镜像和被镜像端口
[SwitchA]port mirror Ethernet 0/1 to Ethernet 0/2 observing-port Ethernet 0/8 【8016交换机端口镜像配置】
1. 假设8016交换机镜像端口为E1/0/15,被镜像端口为E1/0/0,设置端口1/0/15为端口镜像的观测端口。
[SwitchA] port monitor ethernet 1/0/15
2. 设置端口1/0/0为被镜像端口,对其输入输出数据都进行镜像。 [SwitchA] port mirroring ethernet 1/0/0 both ethernet 1/0/15 也可以通过两个不同的端口,对输入和输出的数据分别镜像 1. 设置E1/0/15和E2/0/0为镜像(观测)端口 [SwitchA] port monitor ethernet 1/0/15
2. 设置端口1/0/0为被镜像端口,分别使用E1/0/15和E2/0/0对输入和输出数据进行镜像。 [SwitchA] port mirroring gigabitethernet 1/0/0 ingress ethernet 1/0/15 [SwitchA] port mirroring gigabitethernet 1/0/0 egress ethernet 2/0/0
『基于流镜像的数据流程』
基于流镜像的交换机针对某些流进行镜像,每个连接都有两个方向的数据流,对于交换机来说这两个数据流是要分开镜像的。 【3500/3026E/3026F/3050】 〖基于三层流的镜像〗 1. 定义一条扩展访问控制列表 [SwitchA]acl num 100
2. 定义一条规则报文源地址为1.1.1.1/32去往所有目的地址 [SwitchA-acl-adv-101]rule 0 permit ip source 1.1.1.1 0 destination any 3. 定义一条规则报文源地址为所有源地址目的地址为1.1.1.1/32 [SwitchA-acl-adv-101]rule 1 permit ip source any destination 1.1.1.1 0 4. 将符合上述ACL规则的报文镜像到E0/8端口 [SwitchA]mirrored-to ip-group 100 interface e0/8 〖基于二层流的镜像〗 1. 定义一个ACL [SwitchA]acl num 200
2. 定义一个规则从E0/1发送至其它所有端口的数据包
[SwitchA]rule 0 permit ingress interface Ethernet0/1 egress interface Ethernet0/2 3. 定义一个规则从其它所有端口到E0/1端口的数据包
[SwitchA]rule 1 permit ingress interface Ethernet0/2 egress interface Ethernet0/1 4. 将符合上述ACL的数据包镜像到E0/8 [SwitchA]mirrored-to link-group 200 interface e0/8 【5516/6506/6503/6506R】
目前该三款产品支持对入端口流量进行镜像 1. 定义镜像端口
[SwitchA]monitor-port Ethernet 3/0/2 2. 定义被镜像端口
[SwitchA]mirroring-port Ethernet 3/0/1 inbound
因篇幅问题不能全部显示,请点此查看更多更全内容