H3C交换机实战配置脚本

合集下载

H3C三层交换机DHCP配置实例(H3C网络设备)

H3C三层交换机DHCP配置实例(H3C网络设备)

DHCP 典型配置【需求】DHCP 的主要用途是:通过DHCP服务器的协助来控管各个客户机(执行中的用户端)上不可缺少的网络配置参数,包括DNS(Domain Name Service 域名服务),WINS (Windows Internet Name Service Windows互联网名字服务)等。

【组网图】RouterA配置脚本#sysname RouterA#radius scheme system#domain system#dhcp server ip-pool 1 /创建DHCP 地址池/network 192。

168。

0。

0 mask 255。

255.255。

0 /指定可以分配的地址段/gateway—list 192.168。

0。

1 /指定网关/dns—list 192。

168。

0.2 /指定DNS server地址/domain—name huawei-3com。

com /指定域名/#interface Ethernet0/0ip address 192.168.0.1 255.255。

255。

0 /配置网关地址/#interface Serial2/0link—protocol ppp#interface NULL0#dhcp server forbidden-ip 192。

168。

0。

1 192.168。

0。

2 /保留网关、DNS的地址/#user—interface con 0user-interface vty 0 4#return【验证】在PC上执行“ipconfig”,该PC已经通过DHCP自动获取IP地址、网关、域名信息。

C:\〉ipconfigWindows IP ConfigurationEthernet adapter 本地连接:Connection-specific DNS Suffix . : IP Address。

. 。

. 。

. . : 192.168.0。

h3c交换机配置命令

h3c交换机配置命令

H3C交换机配置命令1. 简介本文档将介绍H3C交换机常用的配置命令,包括基本配置、端口配置、VLAN 配置、静态路由配置等内容。

2. 基本配置命令2.1. 登录交换机在浏览器中输入交换机的管理界面IP地址,打开Web界面,输入用户名和密码进行登录。

2.2. 设置主机名[h3c]sysname Switch2.3. 配置管理员密码[Switch]super password level 3 simple 1234563. 端口配置命令3.1. 配置端口速率和双工模式[Switch]interface GigabitEthernet 1/0/1[Switch-GigabitEthernet1/0/1]speed-duplex 1000-full3.2. 配置端口描述[Switch]interface GigabitEthernet 1/0/1[Switch-GigabitEthernet1/0/1]description This is a test port.3.3. 配置端口VLAN成员关系[Switch]vlan 10[Switch-vlan10]port GigabitEthernet 1/0/1 untagged4. VLAN配置命令4.1. 创建VLAN[Switch]vlan 10[Switch-vlan10]name Sales4.2. 配置端口VLAN成员关系[Switch]interface GigabitEthernet 1/0/1[Switch-GigabitEthernet 1/0/1]port link-type access[Switch-GigabitEthernet 1/0/1]port default vlan 104.3. 配置端口TRUNK属性[Switch]interface GigabitEthernet 1/0/1[Switch-GigabitEthernet 1/0/1]port link-type trunk[Switch-GigabitEthernet 1/0/1]port trunk allow-pass vlan 10 to 205. 静态路由配置命令5.1. 配置静态路由[Switch]ip route-static 0.0.0.0 0.0.0.0 192.168.1.15.2. 配置静态路由的下一跳接口[Switch]interface GigabitEthernet 1/0/1[Switch-GigabitEthernet 1/0/1]ip address 192.168.1.2 255.255.255.06. 总结以上是H3C交换机常用的配置命令的简要介绍,包括基本配置、端口配置、VLAN配置和静态路由配置等内容。

华三交换机配置方法及操作案例

华三交换机配置方法及操作案例

华三交换机配置方法及操作案例一、系统IP配置:[H3C]vlan20[H3C]management-vlan20[H3C]interfacevlan-interface 20 创建并进入管理VLAN[H3C]undointerface vlan-interface 20 删除管理VLAN接口[H3C-Vlan-interface20]ipaddress 192.168.1.2 255.255.255.0 配置管理VLAN接口静态IP地址(缺省为192.168.0.234)[H3C-Vlan-interface20]undoip address 删除IP 地址[H3C-Vlan-interface20]ipgateway192.168.1.1 指定缺省网关(默认无网关地址) [H3C-Vlan-interface20]undoip gateway[H3C-Vlan-interface20]shutdown 关闭接口[H3C-Vlan-interface20]undoshutdown 开启[H3C]displayip 显示管理VLAN接口IP的相关信息[H3C]displayinterface vlan-interface 20 查看管理VLAN的接口信息<H3C>debuggingip 开启IP调试功能<H3C>undodebugging ip二、DHCP客户端配置:[H3C-Vlan-interface20]ipaddress dhcp-alloc 管理VLAN接口通过DHCP方式获取IP地址[H3C-Vlan-interface20]undoip address dhcp-alloc 取消[H3C]displaydhcp 显示DHCP客户信息<H3C>debuggingdhcp-alloc 开启DHCP调试功能<H3C>undodebugging dhcp-alloc三、端口配置:[H3C]interfaceEthernet0/3[H3C-Ethernet0/3]shutdown[H3C-Ethernet0/3]speed100 速率,可为10,100,1000和auto(缺省)[H3C-Ethernet0/3]duplexfull 双工,可为half,full 和auto(缺省) 光口和汇聚后不能配置[H3C-Ethernet0/3]flow-control 开启流控,默认为关闭[H3C-Ethernet0/3]broadcast-suppression20 设置抑制广播百分比为20%,可取5,10,20,100,缺省为100,同时组播和未知单播也受此影响[H3C-Ethernet0/3]loopbackinternal 内环测试[H3C-Ethernet0/3]loopbackexternal 外环测试,需插接自环头,必须为全双工或者自协商模式[H3C-Ethernet0/3]portlink-type trunk 设置链路的类型为trunk,可为access(缺省),trunk[H3C-Ethernet0/3]porttrunk pvid vlan 20 设置20为该trunk的缺省VLAN,默认为1(trunk线路两端的PVID必须一致)[H3C-Ethernet0/3]portaccess vlan 20 将当前access端口加入指定的VLAN[H3C-Ethernet0/3]porttrunk permit vlan all 允许所有的VLAN通过当前的trunk端口,可多次使用该命令[H3C-Ethernet0/3]mdiauto 设置以太端口为自动监测,normal(缺省)为直通线,across为交叉线[H3C]link-aggregationEthernet 0/1 to Ethernet 0/4 将1-4口加入汇聚组,1为主端口,两端需要同时配置,设置了端口镜像以及端口隔离的端口无法汇聚[H3C]undolink-aggregation Ethernet 0/1 删除该汇聚组[H3C]link-aggregationmode egress 配置端口汇聚模式为根据目的MAC地址进行负荷分担,可选为 ingress,egress和both,缺省为both[H3C]monitor-portEthernet 0/2 将该端口设置为镜像端口,必须先设置镜像端口,删除时必须先删除被镜像端口,而且它们不能同在一个端口,该端口不能在汇聚组中,设置新镜像端口时,新取代旧,被镜像不变[H3C]mirroring-portEthernet 0/3 to Ethernet 0/4 both 将端口3和4设置为被镜像端口,both为同时监控接收和发送的报文,inbound表示仅监控接收的报文,outbound表示仅监控发送的报文[H3C]displaymirror[H3C]displayinterface Ethernet 0/3<H3C>resetcounters 清除所有端口的统计信息[H3C]displaylink-aggregation Ethernet 0/3 显示端口汇聚信息[H3C-Ethernet0/3]virtual-cable-test 诊断该端口的电路状况四、VLAN配置:[H3C]vlan2[H3C]undovlan all 删除除缺省VLAN外的所有VLAN,缺省VLAN不能被删除[H3C-vlan2]portEthernet 0/4 to Ethernet 0/7 将4到7号端口加入到VLAN2中,此命令只能用来加access端口,不能用来增加trunk或者hybrid端口[H3C-vlan2]port-isolateenable 打开VLAN内端口隔离特性,不能二层转发,默认不启用该功能[H3C-Ethernet0/4]port-isolateuplink-port vlan 2 设置4为VLAN2的隔离上行端口,用于转发二层数据,只能配置一个上行端口,若为trunk,则建议允许所有VLAN通过,隔离不能与汇聚同时配置[H3C]displayvlan all 显示所有VLAN的详细信息S1550E支持基于端口的VLAN,通过创建不同的user-group来实现,一个端口可以属于多个user-group,不属于同一个user-group的端口不能互相通信,最多支持50个user-group[H3C]user-group20 创建user-group 20,默认只存在user-group 1[H3C-UserGroup20]portEthernet 0/4 to Ethernet 0/7 将4到7号端口加入到VLAN20中,初始时都属于user-group1中[H3C]displayuser-group 20 显示user-group 20的相关信息五、系统管理:[H3C]mac-addressblackhole H-H-H vlan 1 在VLAN1中添加黑洞MAC[H3C]mac-addressstatic H-H-H interface Ethernet 0/1 vlan 1 在VLAN1中添加端口一的一个mac [H3C]mac-addresstimer aging 500 设置MAC地址表的老化时间为500s[H3C]displaymac-address[H3C]displayarp[H3C]mac-addressport-binding H-H-H interface Ethernet 0/1 vlan 1 配置端口邦定[H3C]displaymac-address port-binding[H3C]displaysaved-configuration[H3C]displaycurrent-configuration<H3C>save[H3C]restoredefault 恢复交换机出厂默认配置,恢复后需重启才能生效[H3C]displayversion<H3C>reboot[H3C]displaydevice[H3C]sysnamebigheap[H3C]info-centerenable 启用系统日志功能,缺省情况下启用[H3C]info-centerloghost ip 192.168.0.3 向指定日志主机(只能为UNIX或LINUX,不能为Windows)输出信息,需先开启日志功能,缺省关闭[H3C]info-centerloghost level 8 设置系统日志级别为8,默认为 5.级别说明:1.emergencies2.alerts 3.critical 4.errors 5.warnings 6.notifications rmational8.debugging<H3C>terminaldebugging 启用控制台对调试信息的显示,缺省控制台为禁用<H3C>terminallogging 启用控制台对日志信息的显示,缺省控制台为启用<H3C>terminaltrapping 启用控制台对告警信息的显示,缺省控制台为启用[H3C]displayinfo-center 显示系统日志的配置和缓冲区记录的信息[H3C]displaylogbuffer 显示日志缓冲区最近记录的指定数目的日志信息[H3C]displaytrapbuffer 显示告警缓冲区最近记录的指定数目的日志信息<H3C>resetlogbuffer 清除日志缓冲区的信息<H3C>resettrapbuffer 清除告警缓冲区的信息六、案例:某公司有一台三层交换机、两台二层交换机,给每个部门划分不用VLAN,但是VLAN要互联,三层到二层交换机为了防止单线故障使用链路聚合,vlan2为销售部,vlan3为财务部。

H3C华为交换机配置命令

H3C华为交换机配置命令

华为交换机基础命令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)# description description-string基于CLI的交换机的端口描述:switch(enable)set port name module/number description-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}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 enableswitch(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 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]端口镜像配置『配置环境参数』1.PC1和PC2的IP地址分别为10.10.1.1/24、10.10.1.2/24『组网需求』2数据配置步骤『S2000EI、S2000C系列交换机端口镜像配置流程』mirroring-port用来定义镜像端口,monitor-port用来定义监控端口。

华三交换机配置方法及操作案例

华三交换机配置方法及操作案例

华三交换机配置方法及操作案例一、系统IP配置:[H3C]vlan20[H3C]management-vlan20[H3C]interfacevlan-interface 20 创建并进入管理VLAN[H3C]undointerface vlan-interface 20 删除管理VLAN接口[H3C-Vlan-interface20]ipaddress 192.168.1.2 255.255.255.0 配置管理VLAN接口静态IP地址(缺省为192.168.0.234)[H3C-Vlan-interface20]undoip address 删除IP 地址[H3C-Vlan-interface20]ipgateway192.168.1.1 指定缺省网关(默认无网关地址) [H3C-Vlan-interface20]undoip gateway[H3C-Vlan-interface20]shutdown 关闭接口[H3C-Vlan-interface20]undoshutdown 开启[H3C]displayip 显示管理VLAN接口IP的相关信息[H3C]displayinterface vlan-interface 20 查看管理VLAN的接口信息<H3C>debuggingip 开启IP调试功能<H3C>undodebugging ip二、DHCP客户端配置:[H3C-Vlan-interface20]ipaddress dhcp-alloc 管理VLAN接口通过DHCP方式获取IP地址[H3C-Vlan-interface20]undoip address dhcp-alloc 取消[H3C]displaydhcp 显示DHCP客户信息<H3C>debuggingdhcp-alloc 开启DHCP调试功能<H3C>undodebugging dhcp-alloc三、端口配置:[H3C]interfaceEthernet0/3[H3C-Ethernet0/3]shutdown[H3C-Ethernet0/3]speed100 速率,可为10,100,1000和auto(缺省)[H3C-Ethernet0/3]duplexfull 双工,可为half,full 和auto(缺省) 光口和汇聚后不能配置[H3C-Ethernet0/3]flow-control 开启流控,默认为关闭[H3C-Ethernet0/3]broadcast-suppression20 设置抑制广播百分比为20%,可取5,10,20,100,缺省为100,同时组播和未知单播也受此影响[H3C-Ethernet0/3]loopbackinternal 内环测试[H3C-Ethernet0/3]loopbackexternal 外环测试,需插接自环头,必须为全双工或者自协商模式[H3C-Ethernet0/3]portlink-type trunk 设置链路的类型为trunk,可为access(缺省),trunk[H3C-Ethernet0/3]porttrunk pvid vlan 20 设置20为该trunk的缺省VLAN,默认为1(trunk线路两端的PVID必须一致)[H3C-Ethernet0/3]portaccess vlan 20 将当前access端口加入指定的VLAN[H3C-Ethernet0/3]porttrunk permit vlan all 允许所有的VLAN通过当前的trunk端口,可多次使用该命令[H3C-Ethernet0/3]mdiauto 设置以太端口为自动监测,normal(缺省)为直通线,across为交叉线[H3C]link-aggregationEthernet 0/1 to Ethernet 0/4 将1-4口加入汇聚组,1为主端口,两端需要同时配置,设置了端口镜像以及端口隔离的端口无法汇聚[H3C]undolink-aggregation Ethernet 0/1 删除该汇聚组[H3C]link-aggregationmode egress 配置端口汇聚模式为根据目的MAC地址进行负荷分担,可选为 ingress,egress和both,缺省为both[H3C]monitor-portEthernet 0/2 将该端口设置为镜像端口,必须先设置镜像端口,删除时必须先删除被镜像端口,而且它们不能同在一个端口,该端口不能在汇聚组中,设置新镜像端口时,新取代旧,被镜像不变[H3C]mirroring-portEthernet 0/3 to Ethernet 0/4 both 将端口3和4设置为被镜像端口,both为同时监控接收和发送的报文,inbound表示仅监控接收的报文,outbound表示仅监控发送的报文[H3C]displaymirror[H3C]displayinterface Ethernet 0/3<H3C>resetcounters 清除所有端口的统计信息[H3C]displaylink-aggregation Ethernet 0/3 显示端口汇聚信息[H3C-Ethernet0/3]virtual-cable-test 诊断该端口的电路状况四、VLAN配置:[H3C]vlan2[H3C]undovlan all 删除除缺省VLAN外的所有VLAN,缺省VLAN不能被删除[H3C-vlan2]portEthernet 0/4 to Ethernet 0/7 将4到7号端口加入到VLAN2中,此命令只能用来加access端口,不能用来增加trunk或者hybrid端口[H3C-vlan2]port-isolateenable 打开VLAN内端口隔离特性,不能二层转发,默认不启用该功能[H3C-Ethernet0/4]port-isolateuplink-port vlan 2 设置4为VLAN2的隔离上行端口,用于转发二层数据,只能配置一个上行端口,若为trunk,则建议允许所有VLAN通过,隔离不能与汇聚同时配置[H3C]displayvlan all 显示所有VLAN的详细信息S1550E支持基于端口的VLAN,通过创建不同的user-group来实现,一个端口可以属于多个user-group,不属于同一个user-group的端口不能互相通信,最多支持50个user-group[H3C]user-group20 创建user-group 20,默认只存在user-group 1[H3C-UserGroup20]portEthernet 0/4 to Ethernet 0/7 将4到7号端口加入到VLAN20中,初始时都属于user-group1中[H3C]displayuser-group 20 显示user-group 20的相关信息五、系统管理:[H3C]mac-addressblackhole H-H-H vlan 1 在VLAN1中添加黑洞MAC[H3C]mac-addressstatic H-H-H interface Ethernet 0/1 vlan 1 在VLAN1中添加端口一的一个mac [H3C]mac-addresstimer aging 500 设置MAC地址表的老化时间为500s[H3C]displaymac-address[H3C]displayarp[H3C]mac-addressport-binding H-H-H interface Ethernet 0/1 vlan 1 配置端口邦定[H3C]displaymac-address port-binding[H3C]displaysaved-configuration[H3C]displaycurrent-configuration<H3C>save[H3C]restoredefault 恢复交换机出厂默认配置,恢复后需重启才能生效[H3C]displayversion<H3C>reboot[H3C]displaydevice[H3C]sysnamebigheap[H3C]info-centerenable 启用系统日志功能,缺省情况下启用[H3C]info-centerloghost ip 192.168.0.3 向指定日志主机(只能为UNIX或LINUX,不能为Windows)输出信息,需先开启日志功能,缺省关闭[H3C]info-centerloghost level 8 设置系统日志级别为8,默认为 5.级别说明:1.emergencies2.alerts 3.critical 4.errors 5.warnings 6.notifications rmational8.debugging<H3C>terminaldebugging 启用控制台对调试信息的显示,缺省控制台为禁用<H3C>terminallogging 启用控制台对日志信息的显示,缺省控制台为启用<H3C>terminaltrapping 启用控制台对告警信息的显示,缺省控制台为启用[H3C]displayinfo-center 显示系统日志的配置和缓冲区记录的信息[H3C]displaylogbuffer 显示日志缓冲区最近记录的指定数目的日志信息[H3C]displaytrapbuffer 显示告警缓冲区最近记录的指定数目的日志信息<H3C>resetlogbuffer 清除日志缓冲区的信息<H3C>resettrapbuffer 清除告警缓冲区的信息六、案例:某公司有一台三层交换机、两台二层交换机,给每个部门划分不用VLAN,但是VLAN要互联,三层到二层交换机为了防止单线故障使用链路聚合,vlan2为销售部,vlan3为财务部。

H3C交换机配置实例范文

H3C交换机配置实例范文

H3C交换机配置实例在中国交换机市场,H3C自2003年公司成立以来,已累计出货上百万台,以太网交换机端口数占全球的市场份额%,在交换机领域内综合技术实力和市场份额排名均达到业界第一。

下面小编准备了关于H3C交换机配置的例子,提供给大家参考!配置H3C交换机实例,设置安全策略版。

1.能够通过WEB登录,并且设置安全策略。

通过源IP 地址对WEB登录录用户进行控制。

2.使用SSH+密码认证证(基本SSH配置方法法)H3C交换机配置实实例。

H3C交换机S S S H配置完全攻略。

[同同时也是telnet]3.更改交换机名称称,时间,管理IP配置置IP网管等基本配置。

基础配置改时间启启动ssh 修改co m m口密码关闭一些没用用的服务配置实例:------------------------------------------------------------------------syssys n n ame 交换机名字management-vlan 1in t erface Vl a a n-interfa c c e 1ip ad d d ress IP地址ip r oute 网关dis cur#i n n terface A u u x1/0/0 默认undo ip h t tp shutdo w w nlocal-u s s er 用户ser v v ice-type t elnet lev e e l 3passw o o rd simple密码===使用S S SH+密码认证(基本本SSH配置方法)H33C交换机配置实例。

public-key local cre a a te rsapu b b lic-key l o o cal creat e e dsauser-interface vty 0 4a u u thenticat i on-mode s c c hemeprot o o col inbou n n d ssh===local-user用户passwo r d cipher 密密码service-type ssh l evel 3ss h h user 对应用户户authenti c c ation-typ e e password通过源IP地地址对WEB登录用户户进行控制,仅允许I P 地址为的WE B B用户通过http:// 最划算团购网HTTP方式访问交换换机。

H3C路由器交换机配置命令

H3C路由器交换机配置命令

H3C路由器交换机配置命令H3C路由器交换机配置命令大全H3C路由器交换机怎么配置?配置命令有哪些?下面一起来看看最新H3C路由器交换机配置命令详解吧!交换机命令[Quidway]super password ;修改特权用户密码[Quidway]sysname ;交换机命名[Quidway]interface ethernet 0/1 ;进入接口视图[Quidway]interface vlan x ;进入接口视图[Quidway-Vlan-interfacex]ip address 10.65.1.1 255.255.0.0 ;配置VLAN的IP地址[Quidway]ip route-static 0.0.0.0 0.0.0.0 10.65.1.2 ;静态路由=网关[Quidway]user-interface vty 0 4 ;进入虚拟终端[S3026-ui-vty0-4]authentication-mode password ;设置口令模式[S3026-ui-vty0-4]set authentication-mode password simple 222 ;设置口令[S3026-ui-vty0-4]user privilege level 3 ;用户级别[Quidway-Ethernet0/1]duplex {half|full|auto} ;配置端口工作状态[Quidway-Ethernet0/1]speed {10|100|auto} ;配置端口工作速率[Quidway-Ethernet0/1]flow-control ;配置端口流控[Quidway-Ethernet0/1]mdi {across|auto|normal} ;配置端口平接扭接[Quidway-Ethernet0/1]port link-type {trunk|access|hybrid} ;设置端口工作模式[Quidway-Ethernet0/1]undo shutdown ;激活端口[Quidway-Ethernet0/2]quit ;退出系统视图[Quidway]vlan 3 ;创建VLAN[Quidway-vlan3]port ethernet 0/1 to ethernet 0/4 ;在VLAN中增加端口[Quidway-Ethernet0/2]port access vlan 3 ;当前端口加入到VLAN[Quidway-Ethernet0/2]port trunk permit vlan {ID|All} ;设trunk允许的VLAN[Quidway-Ethernet0/2]port trunk pvid vlan 3 ;设置trunk端口的PVID[Quidway]monitor-port ;指定镜像端口[Quidway]port mirror ;指定被镜像端口[Quidway]port mirror int_list observing-port int_type int_num ;指定镜像和被镜像[Quidway]description string ;指定VLAN描述字符[Quidway]description ;删除VLAN描述字符[Quidway]display vlan [vlan_id] ;查看VLAN设置[Quidway]stp {enable|disable} ;设置生成树,默认关闭[Quidway]stp priority 4096 ;设置交换机的优先级[Quidway]stp root {primary|secondary} ;设置为根或根的备份[Quidway-Ethernet0/1]stp cost 200 ;设置交换机端口的花费[SwitchA-vlanx]isolate-user-vlan enable ;设置主vlan[SwitchA]Isolate-user-vlan secondary ;设置主vlan 包括的'子vlan[Quidway-Ethernet0/2]port hybrid pvid vlan ;设置vlan的pvid[Quidway-Ethernet0/2]port hybrid pvid ;删除vlan的pvid[Quidway-Ethernet0/2]port hybrid vlan vlan_id_list untagged ;设置无标识的vlan如果包的vlan id与PVId一致,则去掉vlan信息. 默认PVID=1。

华为H3C交换机配置命令

华为H3C交换机配置命令

华为H3C交换机配置命令华为H3C交换机配置命令华为交换机之间只能有一条通路,使得信息集中在一条通信链路上,不能进行动态分配,以平衡负载。

下面是店铺整理的关于华为H3C交换机配置命令,希望大家认真阅读!一、配置软件和硬件1、配置(Console)电缆连接配置电缆是一根8芯屏蔽电缆,一端是压接的RJ-45连接器,插入交换机的Console口里;另一端则同时带有一个DB-9(孔)和DB-25(孔)连接器2、配置软件及设置使用系统自带的“超级终端”,运行“hypertrm”程序,设置终端参数参数要求:波特率为9600,数据位为8,奇偶校验为无,停止位为1,流量控制为无,选择终端仿真为VT100。

二、常用命令1、用户模式:交换机启动后在控制台直接按回车就进入用户模式(远程管理telnet 交换机ip时需要口令)。

--帮助quit ――退出当前模式返回上一级ping ip-address --测试网络连通性telnet ip-address --从交换机登陆其它设备super --从用户模式进入特权模式2、特权模式:进入特权模式一般需要口令,可以防止非法登陆交换机display current --显示当前运行的`配置save --保存当前运行的配置reboot --重启交换机display mac ――显示mac地址表display inteface ethernet 0/1 ――查看以太网口状态system-view --从特权模式进入全局模式3、全局模式:更改配置a.进入以太网口配置模式及相关配置[switchone]interface ethernet 0/1[switchone-Ethernet0/1]shutdown/undo shutdown 关闭/打开接口[switchone-Ethernet0/1]port link-type access/trunk 接口类型设为untagged端口(默认)/tagged端口(用于上行口和级联口) access端口发出和接收的帧不带vlan标记,即untagged端口trunk端口发出和接收的帧一般要带vlan标记,即tagged端口设为tagged口后,还要做以下操作:[switchone-Ethernet0/1]port trunk permit vlan 225 to 250 这条命令是允许有vlan标记225到250的帧上传b.进入vlan配置模式(为了便于操作,不用在接口模式下配置access,而在vlan模式下进行相关操作)[switchone]vlan 225[switchone-vlan225] port Ethernet 1/1 将ethernet 1/1加入vlan225c.设置super口令[switchone]super password simple 2403h 特权口令为2403h。

华三交换机配置脚本

华三交换机配置脚本
port link-type access
port default vlan 10 100
port-isolate enable
interface Ethernet0/0/13
undo port trunk permit vlan 1
port link-type access
port default vlan 10 100
undo port trunk permit vlan 1
port link-type access
port default vlan 10 100
port-isolate enable
interface Ethernet0/0/36
undo port trunk permit vlan 1
port-isolate enable
interface Ethernet0/0/14
undo port trunk permit vlan 1
port link-type access
port default vlan 10 100
port-isolate enable
interface Ethernet0/0/15
port link-type access
port default vlan 10 100
port-isolate enable
interface Ethernet0/0/37
undo port trunk permit vlan 1
port link-type access
port default vlan 10 100
port-isolate enable

H3C核心交换机配置命令实例

H3C核心交换机配置命令实例
port link-mode bridge
port access vlan 101
#
interface GigabitEthernet0/0/26
port link-mode bridge
port access vlan 101
#
interface GigabitEthernet0/0/27
shutdown
#
interface GigabitEthernet0/0/9
port link-mode bridge
#
interface GigabitEthernet0/0/10
port link-mode bridge
port link-type trunk
port trunk permit vlan all
port link-mode bridge
port access vlan 101
#
interface GigabitEthernet0/0/22
port link-mode bridge
port access vlan 101
#
interface GigabitEthernet0/0/23
#
interface GigabitEthernet0/0/11
port link-mode bridge
#
interface GigabitEthernet0/0/12
port link-mode bridge
#
interface GigabitEthernet0/0/13
port link-mode bridge
user-interface vty 0 4

H3C三层交换机OSPF路由协议(H3C网络设备)

H3C三层交换机OSPF路由协议(H3C网络设备)

OSPF路由协议OSPF的根本配置【需求】两台PC所在网段,通过两台使用OSPF协议的路由器实现互连互通。

【组网图】RouterA配置脚本#sysname RouterA#router id 1.1.1.1 /配置router id和loopback0地址一致/#radius scheme system#domain system#interface Ethernet0/0#interface Serial0/0link-protocol ppp#interface NULL0#interface LoopBack0#ospf 1 /启动ospf路由协议/area 0.0.0.0 /创立区域0/network 1.1.1.1 0.0.0.0 /接口loop 0使能OSPF/network 10.1.1.0 0.0.0.255 /接口e0/0使能OSPF/network 20.1.1.0 0.0.0.3 /接口s0/0使能OSPF/【验证】RouterA和RouterB可以通过OSPF学习到对方路由信息,并可以ping通对方网段。

RouterA路由表:[RouterA]disp ip routing-tableRouting Table: public netDestination/Mask Protocol Pre Cost Nexthop Interface1.1.1.1/32 DIRECT 0 0 127.0.0.1 InLoopBack01.1.1.2/32 OSPF 10 1563 20.1.1.2 Serial0/0 10.1.1.0/24 DIRECT 0 0 10.1.1.1 Ethernet0/0 10.1.1.1/32 DIRECT 0 0 127.0.0.1 InLoopBack0 20.1.1.0/30 DIRECT 0 0 20.1.1.1 Serial0/0 20.1.1.1/32 DIRECT 0 0 127.0.0.1 InLoopBack0 20.1.1.2/32 DIRECT 0 0 20.1.1.2 Serial0/0 30.1.1.0/24 OSPF 10 1563 20.1.1.2 Serial0/0 127.0.0.0/8 DIRECT 0 0 127.0.0.1 InLoopBack0 127.0.0.1/32 DIRECT 0 0 127.0.0.1 InLoopB【验证】RouterA和RouterB可以通过OSPF学习到对方路由信息,并可以ping通对方网段。

h3c划分vlan的实战配置命令

h3c划分vlan的实战配置命令

基本配置命令实验目的:掌握交换机基本操作掌握交换机端口安全配置实验需求:配置交换机主机名,密码,网关等。

在交换机fa0/3口上面配置接口安全,规定最大学习MAC地址数量为10,其余丢弃。

实验步骤:步骤一:基本配置主机名,密码等基本配置与路由器相同,在此不做过多讲解。

Switch(config)#ip default-gateway 192.168.1.1 //设置网关地址为192.168.1.1(不设置不能通过IP访问交换机)Switch(config)#interface vlan 1 Switch(config-if)#ip address 192.168.1.2 255.255.255.0 Switch(config-if)#no shutdown //设置交换机管理IP地址为192.168.1.2 Switch(config)#int fa0/1 Switch(config-if)#duplex full Switch(config-if)#speed 100 //手工设置交换机双工模式以及速度步骤二:设置交换机端口安全Switch(config)#int fa0/3 Switch(config-if)#switchport mode access //必须先将交换机接口设置为接入接口Switch(config-if)#switchport port-security //在端口上启用端口安全性 Switch(config-if)#switchport port-security maximum 10 //将接口学习的最大MAC地址数量设置为10,设置可连接到安全端口的最大地址数, Switch(config-if)#switchport port-security violation protect//将超过最大地址数量的数据帧的动作为丢弃Switch(config-if)#switchport port-security mac-addressmac-address//指定可连接安全端口的 MAC 地址交换机常见查看命令: show flash: show mac-address-table show post 显示 IP 地址配置 show interface vlan number查看交换机flash内容产看交换机MAC地址表查看交换机开机自检信息显示交换机的默认网关 show ip default显示接口信息 show interfaces以表格形式显示有关端口的信息 show interface status交换机恢复出厂设置及其基本配置一、实验目的1、了解交换机的文件管理;2、了解什么时候需要将交换机恢复成出厂设置;3、了解交换机恢复出厂设置的方法;4、了解交换机的一些基本配置命令。

H3C三层交换机配置实例(完整资料).doc

H3C三层交换机配置实例(完整资料).doc

【最新整理,下载后即可编辑】H3C三层交换机配置实例1 网络拓扑图 (1)2 配置要求 (1)3划分VLAN并描述 (2)3.1进入系统视图 (2)3.2 创建VLAN并描述 (2)4 给VLAN设置网关 (3)4.1 VLAN1的IP地址设置 (3)4.2 VLAN100的网关设置 (3)4.3 VLAN101的网关设置 (4)4.4 VLAN102的网关设置 (4)4.5 VLAN103的网关设置 (4)5 给VLAN指定端口,设置端口类型 (5)5.1 VLAN100指定端口 (5)5.2 VLAN102指定端口 (5)5.3 VLAN1/101/103指定端口 (6)6 配置路由协议 (7)6.1 默认路由 (7)6.2配置流分类 (7)6.3 定义行为 (7)6.4 应用QOS策略 (8)6.5 接口配置QOS策略 (8)1 网络拓扑图图1-1 网络拓扑图2 配置要求用户1网络:172.16.1.0/24 至出口1网络:172.16.100.0/24用户2网络:192.168.1.0/24 至出口2网络:192.168.100.0/24实现功能:用户1通过互联网出口1,用户2通过互联网出口2。

3划分VLAN并描述3.1进入系统视图<H3C>system-view //进入系统视图图3-1 系统视图3.2 创建VLAN并描述[H3C]vlan 1 //本交换机使用[H3C-vlan1]description Manager //描述为“Manager”[H3C-vlan1]quit[H3C]vlan 100 //划分vlan100[H3C-vlan100]description VLAN 100 //描述为“VLAN 100”[H3C-vlan100]quit[H3C]vlan 101 //划分vlan101[H3C-vlan101]description VLAN 101 //描述为“VLAN 101”[H3C-vlan101]quit[H3C]vlan 102 //划分vlan102[H3C-vlan102]description VLAN 102 //描述为“VLAN 102”[H3C-vlan102]quit[H3C]vlan 103 //划分vlan103[H3C-vlan103]description VLAN 103 //描述为“VLAN 103”[H3C-vlan103]quit[H3C]图3-2 划分VLAN及描述4 给VLAN设置网关4.1 VLAN1的IP地址设置把VLAN1的IP地址设置为192.168.0.254,子网掩码为255.255.255.0,用于本地使用。

H3C交换机开局配置

H3C交换机开局配置

H3C交换机开局配置详述一、配置交换机光端口、开通光链路配置命令<H3C>sys[H3C]interface GigabitEthernet1/1/1 #进入GigabitEthernet1/1/1接口#[H3C- GigabitEthernet1/1/1]speed 1000 #配置GigabitEthernet1/1/1接口速率#[H3C- GigabitEthernet1/1/1]duplex full #配置GigabitEthernet1/1/1工作模式为全双工#[H3C- GigabitEthernet1/1/1]port link-type trunk#配置GigabitEthernet1/1/1接口模式为trunk#[H3C- GigabitEthernet1/1/1]port trunk permit vlan 100#配置允许Vlan 100通过GigabitEthernet1/1/1#[H3C- GigabitEthernet1/1/1]]undo port trunk permit vlan 1#取消Vlan 1通过GigabitEthernet1/1/1#此段命令行即为配置交换机互联光端口,通常互联光端口为GigabitEthernet1/1/1,若为其他端口,则需根据实际情况调整端口号。

如H3C S5500系列,光端口通常为GigabitEthernet 1/0/25。

注意:本段配置命令从用户模式(尖括号符号)开始,在其他模式或接口下也可通过输入interface GigabitEthernet1/1/1进入相应端口,但为配置流程清晰,建议使用ctrl+z组合键或者quit 命名退出至用户模式(尖括号符号),重新输入上述命令完成配置。

二、配置Scheme认证的Telnet登录I 配置过程1. 认证方式为Scheme时Telnet登录方式的配置ii. 配置举例1. 组网需求当前用户通过Console口(AUX用户界面)登录到交换机,且用户级别为管理级(3级)。

H3C交换机简单配置案例

H3C交换机简单配置案例

H3C交换机简单配置案例相关推荐H3C交换机简单配置案例 H3C交换机配置命令有哪些?怎么配置呢?下⾯yjbys为⼤家分享最新交换机配置命令及案例分析,这⾥使⽤的H3C交换机是H126A,仅仅只做了最基本的配置以满⾜使⽤。

配置中可以通过display current-configura命令来显⽰当前使⽤的配置内容。

# 配置VLAN 1 system-view System View:return to User View with Ctrl+Z. [Sysname]vlan 1 [Sysname-vlan1]quit [Sysname]management-vlan1 [Sysname]interfaceVlan-interface 1 [Sysname-Vlan-interface1]ip address 10.0.1.201 255.255.255.0 # 显⽰VLAN 接⼝1 的相关信息。

display ip interface Vlan-interface 1 # 创建VLAN(H3C不⽀持cisco的VTP,所以只能添加静态VLAN) system-view System View:return to User View with Ctrl+Z. [H3C_TEST]vlan 99 [H3C_TEST-vlan99]nameseicoffice [H3C_TEST-vlan99]quit # 把交换机的端端⼝划分到相应的Vlan中 [H3C_TEST]interfaceethernet1/0/2//进⼊端⼝模式 [H3C_TEST-Ethernet1/0/2]portlink-type access //设置端⼝的类型为access [H3C_TEST-Ethernet1/0/2]portaccess vlan 99//把当前端⼝划到vlan 99 [H3C_TEST]vlan 99 [H3C_TEST-vlan99]portethernet1/0/1 to ethernet1/0/24//把以及⽹端⼝1/0/1到1/0/24划到vlan99 [H3C_TEST-vlan99]quit [H3C_TEST-GigabitEthernet1/2/1]porttrunk permit vlan 1 99 // {ID|All} 设置trunk端⼝允许通过的VLAN ------------------------------------ # 配置本地⽤户 system-view System View:return to User View with Ctrl+Z. [Sysname]local-userh3c New local useradded. [Sysname-luser-h3c]service-typetelnet level 3 [Sysname-luser-h3c]passwordsimple h3c # 配置欢迎信息 [H3C_TEST]headerlogin %Welcome to login h3c!% # 配置⽤户认证⽅式telnet(vty 0-4) [H3C_TEST]user-interfacevty 0 4 [H3C_TEST-ui-vty0-4]authentication-modescheme [H3C_TEST-ui-vty0-4]protocolinbound telnet [H3C_TEST-ui-vty0-4]superauthentication-mode super-password [H3C_TEST-ui-vty0-4]quit [H3C_TEST]superpassword level 3 simple h3c //⽤户登陆后提升权限的密码 # 配置Radius策略 [H3C_TEST]radiusscheme radius1 New Radius scheme [H3C_TEST-radius-radius1]primaryauthentication 10.0.1.253 1645 [H3C_TEST-radius-radius1]primaryaccounting 10.0.1.253 1646 [H3C_TEST-radius-radius1]secondaryauthentication 127.0.0.1 1645 [H3C_TEST-radius-radius1]secondaryaccounting 127.0.0.1 1646 [H3C_TEST-radius-radius1]timer5 [H3C_TEST-radius-radius1]keyauthentication h3c [H3C_TEST-radius-radius1]keyaccounting h3c [H3C_TEST-radius-radius1]server-typeextended [H3C_TEST-radius-radius1]user-name-formatwithout-domain # 配置域 [H3C_TEST]domainh3c [H3C_TEST-isp-h3c]authenticationradius-scheme radius1 local [H3C_TEST-isp-h3c]schemeradius-scheme radius1 local [H3C_TEST]domaindefault enable h3c # 配置在远程认证失败时,本地认证的key [H3C_TEST]local-servernas-ip 127.0.0.1 key h3c H3C交换机路由器telnet和console⼝登录配置 2009年11⽉09⽇星期⼀ 10:00 级别说明 Level 名称 命令 0 参观 ping、tracert、telnet 1 监控 display、debugging 2 配置 所有配置命令(管理级的命令除外) 3 管理 ⽂件系统命令、FTP命令、TFTP命令、XMODEM命令 telnet仅⽤密码登录,管理员权限 [Router]user-interfacevty 0 4[Router-ui-vty0-4]user privilege level 3[Router-ui-vty0-4]setauthentication password simple abc telnet仅⽤密码登录,⾮管理员权限 [Router]superpassword level 3 simple super [Router]user-interfacevty 0 4[Router-ui-vty0-4]user privilege level 1[Router-ui-vty0-4]setauthentication password simple abc telnet使⽤路由器上配置的⽤户名密码登录,管理员权限 [Router]local-useradmin password simple admin[Router]local-user admin service-typetelnet[Router]local-user admin level 3 [Router]user-interfacevty 0 4[Router-ui-vty0-4]authentication-mode local telnet使⽤路由器上配置的⽤户名密码登录,⾮管理员权限。

华三路由器交换机配置命令

华三路由器交换机配置命令

路由器: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配置1900trunk配置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-list Configuring 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-address switch(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 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 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-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 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 multipoint router(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. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

H3C交换机实战配置脚本
1、修改主机名
[H3C]sysname hnyx
2、创建管理及业务VLAN
[hnyx]vlan 31
[hnyx]vlan 101 to 107
3、进入上行接口,将接口改成trunk模式
[hnyx]interface Ethernet 1/0/1
[hnyx-Ethernet1/0/1]port link-type trunk
4、配置上行trunk接口允许通过的VLAN范围(管理VLAN+业务VLAN)[hnyx-Ethernet1/0/1]port trunk permit vlan 31 101 to 107
5、分别进入下行接口,将接口类型改为ACCESS并划分到相应的VLAN [hnyx]interface Ethernet 1/0/2
[hnyx-Ethernet1/0/2]port access vlan 101
6、创建管理接口并配置相应的IP地址
[hnyx]management-vlan 31 //将VLAN31指定为管理VLAN
[hnyx]interface Vlan-interface 31
[hnyx-Vlan-interface31]ip address 172.16.31.11 24
7、配置交换机网关
[hnyx]ip route-static 0.0.0.0 0.0.0.0 172.16.31.1
8、开启telnet服务
[hnyx]telnet server enable
9、将登录的认证方式改为本地用户名加密码认证
[hnyx]user-interface vty 0 4
[hnyx-ui-vty0-4]authentication-mode scheme
10、创建本地用户名及密码
[hnyx]local-user admin
[hnyx-luser-admin]password simple hnyx
[hnyx-luser-admin]service-type telnet
11、配置进入系统视图的密码(切换权限认证密码)
[hnyx]super password simple yxhn
12、保存配置
<hnyx>save。

相关文档
最新文档