锐捷交换机、路由器常用命令
锐捷路由器命令全集

锐捷路由器命令全集锐捷路由器命令全集一、基本配置命令1.登录命令1.1.登录路由器:login1.2.切换用户:su [用户名]1.3.修改用户密码:passwd2.接口配置命令2.1.查看接口信息:show interface2.2.配置接口IP地质:ip address [接口名称] [IP地质] [子网掩码]2.3.启用/禁用接口:shutdown / no shutdown [接口名称]2.4.配置接口描述:description [接口名称] [描述]3.静态路由配置命令3.1.添加静态路由:ip route [目标网络地质] [子网掩码] [下一跳地质]3.2.删除静态路由:no ip route [目标网络地质] [子网掩码] [下一跳地质]3.3.查看静态路由表:show ip route static4.动态路由配置命令4.1.启用/禁用动态路由:router ospf [进程号] / no router ospf [进程号]4.2.配置OSPF路由:network [网络地质] [子网掩码] area [区域号]4.3.查看OSPF邻居状态:show ip ospf neighbor5.NAT配置命令5.1.配置静态NAT:ip nat inside source static [内部地质] [外部地质]5.2.配置动态NAT:ip nat inside source list [访问控制列表] [外部地质池] overload5.3.查看NAT转换表:show ip nat translations6.VLAN配置命令6.1.创建VLAN:vlan database / vlan [VLAN号] name [VLAN名称]6.2.将接口加入VLAN:interface [接口名称] /switchport mode trunk / switchport mode access / switchport access vlan [VLAN号]6.3.查看VLAN配置信息:show vlan brief7.安全配置命令7.1.配置登录密码:enable password [密码]7.2.配置Telnet/SSH登录:line vty 0 [最小号] [最大号] / transport input telnet / transport input ssh7.3.配置访问控制列表:access-list [序号] permit [源地质] [目标地质] [协议]7.4.应用访问控制列表:interface [接口名称] / ip access-group [序号] in / out8.系统管理命令8.1.查看系统信息:show version8.2.配置系统时钟:clock set [时间]8.3.保存配置:write memory二、附件:无三、法律名词及注释:1.IP地质:Internet Protocol Address,互联网协议地质,用于唯一标识网络上的设备。
锐捷路由器配置命令大全

锐捷路由器配置命令大全>Enable 进入特权模式#Exit 返回上一级操作模式#del flash:config.text 删除配置文件(交换机及1700系列路由器) #erase startup-config 删除配置文件(2500系列路由器)#write memory 或copy running-config startup-config 保存配置#Configure terminal 进入全局配置模式(config)# hostname routerA 配置设备名称为routerA(config)#banner motd & 配置每日提示信息 &为终止符(config)# enable secret star 或者:enable password star设置路由器的特权模式密码为star;secret 指密码以非明文显示,password指密码以明文显示查看信息#show running-config 查看当前生效的配置信息#show interface fastethernet 0/3 查看F0/3端口信息#show interface serial 1/2 查看S1/2端口信息#show ip interface brief 查看端口信息#show version 查看版本信息#show running-config 查看当前生效的配置信息#show controllers serial 1/2 查看该端口信息 , 用于R2501#show ip route 查看路由表信息#show access-lists 1 查看标准访问控制列表1的配置信息远程登陆(telnet)(config)# line vty 0 4 进入线路0~4的配置模式,4为连续线路最后一位的编号,线路为0~4(conifg-line)#login(config-line)#password star 配置远程登陆密码为star(config-line)#end 返回上层端口的基本配置(config)#Interface fastethernet 0/3 进入F0/3的端口配置模式(config)#interface range fa 0/1-2 进入F01至F0/2的端口配置模式(config-if)#speed 10 配置端口速率为10M,可选10,100,auto (config-if)#duplex full 配置端口为全双工模式,可选full(全双工),half(半双式),auto(自适应)(config-if)#no shutdown 开启该端口(config)# interface serial 1/2 进入端口S1/2的配置模式(config-if)# ip address 1.1.1.1 255.255.255.0 配置端口IP及掩码(config-if)# clock rate 64000 配置时钟频率(单位为K , 仅用于DCE端)(config-if)# bandwidth 512 配置端口带宽速率为512KB(单位为KB)(config-if)# no shutdown 开启该端口(config-if)#encapsulation PPP 定义封装类型为PPP,可选项:Frame-relay 帧中继Hdlc 高级数据链路控制协议lapb X.25的二层协议PPP PPP点到点协议X25 X.25协议路由协议(config)# ip route 172.16.1.0 255.255.255.0 172.16.2.1 配置静态路由注:172.16.1.0 255.255.255.0 为目标网络的网络号及子网掩码172.16.2.1 为下一跳的地址,也可用接口表示,如ip route 172.16.1.0 255.255.255.0 serial 1/2(172.16.2.0所接的端口) (config)# router rip 开启RIP协议进程(config-router)# network 172.16.1.0 申明本设备的直连网段信息(config-router)# version 2 开启RIP V2,可选为version 1(RIPV1)、version 2(RIPV2)(config-router)# no auto-summary 关闭路由信息的自动汇总功能(只有在RIPV2支持)(config)# router ospf 开启OSPF路由协议进程(针对1762,无需使用进程ID)(config)# router ospf 1 开启OSPF路由协议进程(针对2501,需要加OSPF进程ID)(config-router)# network 192.168.1.0 0.0.0.255 area 0申明直连网段信息,并分配区域号(area0为骨干区域)注意:如果是Rip Version1,那么在不连续的子网中,需要为中间网段的两个路由器都配置子接口RA(config)#int serial0RA(config-if)#ip address 172.16.2.1 255.255.255.0 secondary RB(config)#int serial0RB(config-if)#ip address 172.16.2.2 255.255.255.0 secondaryPAP路由器Ra为被验证方、Rb为验证方;两路由器用V.35线连接(串口线),分别配置各端口的IP及时钟频率后:Rb(config)# username Ra password 0 star 验证方配置被验证方的用户名,密码Rb(config)# intterface serial 1/2 进入S1/2端口Rb(config-if)# encapsulation ppp 定义封装类型为PPPRb(config-if)# ppp authentication pap PPP启用PAP认证方式Ra(config)# itnterface serial 1/2 进入S1/2端口Ra(config-if)# encapsulation ppp 定义封装类型为PPPRa(config-if)# ppp pap sent-username Ra password 0 star 设置用户名为ra 密码为star,用于发送到验证方进行验证#debug ppp authentication 可选命令:观察PAP验证过程(如果没看到验证消息,则将端口shutdown,然后再no shutdown,即可看到验证过程的相关信息)CHAP路由器Ra、 Rb, 两路由器用V.35线连接(串口线),分别配置各端口的IP及时钟频率后:被验证方配置:Ra(config)# username Rb password 0 star 以对方的主机名作为用户名,密码和对方的路由器一致Ra(config)# interface serial 1/2 进入S1/2端口Ra(config-if)# encapsulation PPP 定义封装类型为PPP验证方配置:Rb(config)# username Ra password 0 star 以对方的主机名作为用户名,密码和对方的路由器一致Rb(config)# interface serial 1/2 进入S1/2端口Rb(config-if)# encapsulation PPP 定义封装类型为PPPRb(config-if)# ppp authentication chap PPP启用CHAP方式验证PAP与CHAP的区别:1. PAP:被验证方发送用户名、密码到验证方进行身份验证,所以需要在端口模式下设置Ra(config)#ppp pap sent-username Ra password 0 star;验证方需要定义用户和密码配对数据库记录,所以要定义命令:Rb(config)# username Ra password 0 star2. Chap:CHAP由验证方主动发起挑战,由被验证方应答进行验证(三次握手),所以验证方要配置命令:Rb(config-if)# ppp authentication chap。
锐捷交换机路由器常用配置操作

1.1通过TELNET方式来配置设备提问:如何通过telnet方式来配置设备?答复:步骤一:配置VLAN1的IP地址S5750>en ----进入特权形式S5750#conf ----进入全局配置形式S5750(config)#int vlan 1 ----进入vlan 1接口S5750(config-if)#ip address 192.168.0.230 255.255.255.0----为vlan 1接口上设置管理ip S5750(config-if)#exit ----退回到全局配置形式步骤二:配置telnet密码S5750(config)#line vty 0 4 ----进入telnet密码配置形式S5750(config-line)#login ---启用需输入密码才能telnet成功S5750(config-line)#password rscstar ----将telnet密码设置为rscstarS5750(config-line)#exit ----回到全局配置形式S5750(config)# enable secret level 15 0 rscstar----配置进入特权形式的密码为rscstar 1.2更改IOS命令的特权等级提问:如何只允许dixy这个用户使用与ARP相关的命令?答复:S5750(config)#username dixy password dixy ----设置dixy用户名和密码S5750(config)#username dixy privilege 10 ----dixy帐户的权限为10S5750(config)#privilege exec level 10 show arp----权限10可以使用show arp命令S5750(config)#privilege config all level 10 arp----权限10可以使用所有arp打头的命令S5750(config)#line vty 0 4 ----配置telnet登陆用户S5750(config-line)#no passwordS5750(config-line)#login local设备时钟设置提问:如何设置设备时钟?答复:S5750#clock set 12:45:55 11 25 2021----设置时间为2021年11月25日12点45分55秒S5750#clock update-calendar ----设置日历更新S5750(config)#clock timezone CN 8 22 ----时间名字为中国,东8区22分2.1 交换机vlan和trunk的配置提问:如何在交换机上划分vlan,配置trunk接口?答复:步骤一:给交换机配置IP地址S2724G#confS2724G(config)#int vlan 1----给VLAN 1配置IP地址S2724G(config-if)#no shutdown ----激活该VLAN接口S2724G(config-if)#exitS2724G(config)#ip default-gateway 192.168.0.1 ---指定交换机的网关地址步骤二:创立VLANS2724G#confS2724G(config)#vlan 10 ----创立VLAN 10S2724G(config-vlan)#exitS2724G(config)# vlan 20 ----创立VLAN 20S2724G(config-vlan)#exit步骤三:把相应接口指定到相应的VLAN中S2724G(config)#int gi 0/10S2724G(config-if)#switch access vlan 10 ----把交换机的第10端口划到VLAN 10中S2724G(config-if)#exitS2724G(config)#int gi 0/20S2724G(config-if)#switch access vlan 20 ----把交换机的第20端口划到VLAN 20中S2724G(config-if)#exitS2724G(config)#int gi 0/24S2724G(config-if)#switch mode trunk ----设置24口为Trunk形式〔与三层交换机的连接口S2724G(config-if)#步骤四:保存配置S2724G(config-if)#endS2724G#write2.2 turnk接口修剪配置提问:如何让trunk接口只允许局部vlan通过?答复:Switch(config)#int fa 0/24Switch (config-if)#switch mode trunkSwitch (config-if)#switchport trunk allowed vlan remove 10,20,30-40----不允许VLAN10,20,30-40通过Trunk口2.3 PVLAN配置提问:如何实现几组用户之间的隔离,但同时又都能访问公用效劳?答复:步骤一:创立隔离VLANS2724G#confS2724G(config)#vlan 3 ----创立VLAN3S2724G(config-vlan)#private-vlan community ----将VLAN3设为隔离VLAN S2724G(config)#vlan 4 ----创立VLAN4S2724G(config-vlan)#private-vlan community ----将VLAN4设为隔离VLAN S2724G(config-vlan)#exit ----退回到特权形式步骤二:创立主VLANS2724G(config)#vlan 2 ----进入VLAN2S2724G(config-vlan)#private-vlan primary ----VLAN2为主VLAN步骤三:将隔离VLAN加到到主VLAN中VLANS2724G(config-vlan)#private-vlan association add 3-4----将VLAN3和VLAN4参加到公用VLAN中,VLAN3和VLAN4的用户可以访问公用接口步骤四:将实际的物理接口与VLAN相对应S2724G(config)#interface GigabitEthernet 0/1----进入接口1,该接口连接效劳器或者上联设备S2724G(config-if)#switchport mode private-vlan promiscuous----接口形式为混杂形式S2724G(config-if)#switchport private-vlan mapping 2 add 3-4----将VLAN3和VLAN4映射到VLAN2上S2724G(config)#int gi 0/10 ----进入接口10S2724G(config-if)#switchport mode private-vlan hostS2724G(config-if)#switchport private-vlan host-association 2 3----该接口划分入VLAN3 S2724G(config)#int gi 0/20 ----进入接口20S2724G(config-if)#switchport mode private-vlan hostS2724G(config-if)#switchport private-vlan host-association 24----该接口划分入VLAN4步骤五:完成VLAN的映射S2724G(config)#int vlan 2 ----进入VLAN2的SVI接口S2724G(config-if)#ip address 192.168.2.1 255.255.255.0----配置VLAN2的ip地址S2724G(config-if)#private-vlan mapping add 3-4----将VLAN3和VLAN4参加到VLAN2中注释:1. S20、S21不支持私有VLAN,可以通过保护端口实现类似功能2. S3250、S3750和S5750同时支持保护端口和私有VLAN3. S3760不支持私有VLAN和保护端口2.4 端口会聚配置提问:如何将交换机的端口捆绑起来使用?答复:S5750#confS5750(config)#interface range gigabitEthernet 0/1 – 4 ----同时进入1到4号接口S5750(config-if)#port-group 1 ----设置为聚合口1S5750(config)#interface aggregateport 1 ----进入聚合端口1注意:配置为AP口的接口将丧失之前所有的属性,以后关于接口的操作只能在AP1口上面进展2.5 生成树配置提问:如何配置交换机的生成树?答复:步骤一:根桥的设置switch_A#conf tswitch_A(config)#spanning-tree ---默认形式为MSTPswitch_A(config)#spanning-tree mst configurationswitch_A(config)#spanning-tree mst 10 priority 4096 ---设置为根桥步骤二:非根桥的设置switch_B#conf tswitch_B(config)#spanning-tree ---默认形式为MSTPswitch_B(config)#spanning-tree mst configurationswitch_B(config)#int f0/1 ---PC的接入端口switch_B(config)#spanning-tree bpduguard enableswitch_B(config)#spanning-tree portfast2.6 端口镜像设置提问:如何配置交换机的端口镜像?答复:switch#conf tswitch#(config)#switch (config)# monitor session 1 source interface gigabitEthernet 3/1 both---监控源口为g3/1 switch (config)# monitor session 1 destination interface gigabitEthernet 3/8 switch ---监控目的口为g3/8,并开启交换功能注意:S2026交换机镜像目的端口无法当做普通接口使用3.1 交换机地址绑定〔address-bind〕功能提问:如何对用户ip+mac进展两元素绑定?答复:S5750#confS5750(config)# address-bind 192.168.0.101 0016.d390.6cc5----绑定ip地址为192.168.0.101 MAC地址为的主机让其使用网络S5750(config)# address-bind uplink GigabitEthernet 0/1----将g0/1口设置为上联口,也就是交换机通过g0/1的接口连接到路由器或是出口设备,假如接口选择错误会导致整网不通S5750(config)# address-bind install ----使能address-bind功能S5750(config)#end ----退回特权形式S5750# wr ----保存配置注释:1. 假如修改ip或是MAC地址该主机那么无法使用网络,可以按照此命令添加多条,添加的条数跟交换机的硬件资源有关2. S21交换机的address-bind功能是防止Ip冲突,只有在交换机上绑定的才进展ip和M AC的匹配,假如下边用户设置的ip地址在交换机中没绑定,交换机不对该数据包做控制,直接转发。
锐捷路由器命令大全

锐捷路由器命令大全Enable 进入特权模式#Ex IT返回上一级操作模式#del flash:config.text 删除配置文件(交换机及1700系列路由器)#erase startup-config 删除配置文件(2500系列路由器)#write memory 或copy running-config startup-config 保存配置#Configure terminal 进入全局配置模式(config)# hostname routerA 配置设备名称为routerA(config)#banner motd & 配置每日提示信息&为终止符(config)# enable secret star 或者:enable password star设置路由器的特权模式密码为star;secret 指密码以非明文显示,password 指密码以明文显示查看信息#show running-config 查看当前生效的配置信息#show interface fastethernet 0/3 查看F0/3端口信息#show interface serial 1/2 查看S1/2端口信息#show ip interface brief 查看端口信息#show version 查看版本信息#show running-config 查看当前生效的配置信息#show controllers serial 1/2 查看该端口信息 , 用于R2501#show ip route 查看路由表信息#show access-lists 1 查看标准访问控制列表1的配置信息远程登陆(telnet)(config)# line vty 0 4 进入线路0~4的配置模式,4为连续线路最后一位的编号,线路为0~4(conifg-line)#login(config-line)#password star 配置远程登陆密码为star(config-line)#end 返回上层端口的基本配置(config)#Interface fastethernet 0/3 进入F0/3的端口配置模式(config)#interface range fa 0/1-2 进入F01至F0/2的端口配置模式(config-if)#speed 10 配置端口速率为10M,可选10,100,auto(config-if)#duplex full 配置端口为全双工模式,可选full(全双工),half(半双式),auto(自适应)(config-if)#no shutdown 开启该端口(config)# interface serial 1/2 进入端口S1/2的配置模式(config-if)# ip address 1.1.1.1 255.255.255.0 配置端口IP及掩码(config-if)# clock rate 64000 配置时钟频率(单位为K , 仅用于DCE 端)(config-if)# bandwidth 512 配置端口带宽速率为512KB(单位为KB) (config-if)# no shutdown 开启该端口(config-if)#encapsulation PPP 定义封装类型为PPP,可选项:Frame-relay 帧中继Hdlc 高级数据链路控制协议lapb X.25的二层协议PPP PPP点到点协议X25 X.25协议路由协议(config)# ip route 172.16.1.0 255.255.255.0 172.16.2.1 配置静态路由注:172.16.1.0 255.255.255.0 为目标网络的网络号及子网掩码172.16.2.1 为下一跳的地址,也可用接口表示,如ip route 172.16.1.0 255.255.255.0 serial 1/2(172.16.2.0所接的端口)(config)# router rip 开启RIP协议进程(config-router)# network 172.16.1.0 申明本设备的直连网段信息(config-router)# version 2 开启RIP V2,可选为version 1(RIPV1)、version 2(RIPV2)(config-router)# no auto-summary 关闭路由信息的自动汇总功能(只有在RIPV2支持)(config)# router ospf 开启OSPF路由协议进程(针对1762,无需使用进程ID)(config)# router ospf 1 开启OSPF路由协议进程(针对2501,需要加OSPF进程ID)(config-router)# network 192.168.1.0 0.0.0.255 area 0申明直连网段信息,并分配区域号(area0为骨干区域)注意:如果是Rip Version1,那么在不连续的子网中,需要为中间网段的两个路由器都配置子接口!!!RA(config)#int serial0RA(config-if)#ip address 172.16.2.1 255.255.255.0 secondaryRB(config)#int serial0RB(config-if)#ip address 172.16.2.2 255.255.255.0 secondaryPAP路由器Ra为被验证方、 Rb为验证方;两路由器用V.35线连接(串口线),分别配置各端口的IP及时钟频率后:Rb(config)# username Ra password 0 star 验证方配置被验证方的用户名,密码Rb(config)# intterface serial 1/2 进入S1/2端口Rb(config-if)# encapsulation ppp 定义封装类型为PPPRb(config-if)# ppp authentication pap PPP启用PAP认证方式Ra(config)# itnterface serial 1/2 进入S1/2端口Ra(config-if)# encapsulation ppp 定义封装类型为PPPRa(config-if)# ppp pap sent-username Ra password 0 star 设置用户名为ra 密码为star,用于发送到验证方进行验证#debug ppp authentication 可选命令:观察PAP验证过程(如果没看到验证消息,则将端口shutdown,然后再no shutdown,即可看到验证过程的相关信息)CHAP路由器Ra、 Rb, 两路由器用V.35线连接(串口线),分别配置各端口的IP 及时钟频率后:被验证方配置:Ra(config)# username Rb password 0 star 以对方的主机名作为用户名,密码和对方的路由器一致Ra(config)# interface serial 1/2 进入S1/2端口Ra(config-if)# encapsulation PPP 定义封装类型为PPP验证方配置:Rb(config)# username Ra password 0 star 以对方的主机名作为用户名,密码和对方的路由器一致Rb(config)# interface serial 1/2 进入S1/2端口Rb(config-if)# encapsulation PPP 定义封装类型为PPPRb(config-if)# ppp authentication chap PPP启用CHAP方式验证PAP与CHAP的区别:1. PAP:被验证方发送用户名、密码到验证方进行身份验证,所以需要在端口模式下设置Ra(config)#ppp pap sent-username Ra password 0 star;验证方需要定义用户和密码配对数据库记录,所以要定义命令:Rb(config)# username Ra password 0 star2. Chap:CHAP由验证方主动发起挑战,由被验证方应答进行验证(三次握手),所以验证方要配置命令:Rb(config-if)# ppp authentication chap。
(完整版)锐捷交换机命令大全

【第一部分】交换机支持的命令:1.交换机基本状态:switch: ;ROM状态,路由器是rommon>hostname> ;用户模式hostname# ;特权模式hostname(config)# ;全局配置模式hostname(config-if)# ;接口状态2.交换机口令设置:switch>enable ;进入特权模式switch#config terminal ;进入全局配置模式switch(config)#hostname;设置交换机的主机名switch(config)#enable secret xxx ;设置特权加密口令switch(config)#enable password xxa ;设置特权非密口令switch(config)#line console 0 ;进入控制台口switch(config-line)#line vty 0 4 ;进入虚拟终端switch(config-line)#login ;允许登录switch(config-line)#password xx ;设置登录口令xxswitch#exit ;返回命令3.交换机VLAN设置:switch#vlan database ;进入VLAN设置switch(vlan)#vlan 2 ;建VLAN 2switch(vlan)#no vlan 2 ;删vlan 2switch(config)#int f0/1 ;进入端口1switch(config-if)#switchport access vlan 2 ;当前端口加入vlan 2 switch(config-if)#switchport mode trunk ;设置为干线switch(config-if)#switchport trunk allowed vlan 1,2 ;设置允许的vlan switch(config-if)#switchport trunk encap dot1q ;设置vlan 中继switch(config)#vtp domain;设置发vtp域名switch(config)#vtp password;设置发vtp密码switch(config)#vtp mode server ;设置发vtp模式switch(config)#vtp mode client ;设置发vtp模式4.交换机设置IP地址:switch(config)#interface vlan 1 ;进入vlan 1switch(config-if)#ip address;设置IP地址switch(config)#ip default-gateway;设置默认网关switch#dir flash: ;查看闪存5.交换机显示命令:switch#write ;保存配置信息switch#show vtp ;查看vtp配置信息switch#show run ;查看当前配置信息switch#show vlan ;查看vlan配置信息switch#show interface ;查看端口信息switch#show int f0/0 ;查看指定端口信息【第二部分】路由器支持的命令:1.路由器显示命令:router#show run ;显示配置信息router#show interface ;显示接口信息router#show ip route ;显示路由信息router#show cdp nei ;显示邻居信息router#reload ;重新起动2.路由器口令设置:router>enable ;进入特权模式router#config terminal ;进入全局配置模式router(config)#hostname;设置交换机的主机名router(config)#enable secret xxx ;设置特权加密口令router(config)#enable password xxb ;设置特权非密口令router(config)#line console 0 ;进入控制台口router(config-line)#line vty 0 4 ;进入虚拟终端router(config-line)#login ;要求口令验证router(config-line)#password xx ;设置登录口令xx router(config)#(Ctrl+z) ;返回特权模式router#exit ;返回命令3.路由器配置:router(config)#int s0/0 ;进入Serail接口router(config-if)#no shutdown ;激活当前接口router(config-if)#clock rate 64000 ;设置同步时钟router(config-if)#ip address;设置IP地址router(config-if)#ip address second ;设置第二个IProuter(config-if)#int f0/0.1 ;进入子接口router(config-subif.1)#ip address;设置子接口IProuter(config-subif.1)#encapsulation dot1q;绑定vlan中继协议router(config)#config-register 0x2142 ;跳过配置文件router(config)#config-register 0x2102 ;正常使用配置文件router#reload ;重新引导4.路由器文件操作:router#copy running-config startup-config ;保存配置router#copy running-config tftp ;保存配置到tftprouter#copy startup-config tftp ;开机配置存到tftprouter#copy tftp flash: ;下传文件到flashrouter#copy tftp startup-config;下载配置文件ROM状态:Ctrl+Break ;进入ROM监控状态rommon>confreg 0x2142 ;跳过配置文件rommon>confreg 0x2102 ;恢复配置文件rommon>reset;重新引导rommon>copy xmodem: flash: ;从console传输文件rommon>IP_ADDRESS=10.65.1.2 ;设置路由器IP rommon>IP_SUBNET_MASK=255.255.0.0 ;设置路由器掩码rommon>TFTP_SERVER=10.65.1.1 ;指定TFTP服务器IP rommon>TFTP_FILE=c2600.bin ;指定下载的文件rommon>tftpdnld ;从tftp下载rommon>dir flash: ;查看闪存内容rommon>boot ;引导IOS5.静态路由:ip route;命令格式router(config)#ip route 2.0.0.0 255.0.0.0 1.1.1.2 ;静态路由举例router(config)#ip route 0.0.0.0 0.0.0.0 1.1.1.2 ;默认路由举例6.动态路由:router(config)#ip routing ;启动路由转发router(config)#router rip ;启动RIP路由协议。
锐捷路由器配置命令大全

锐捷路由器配置命令大全1、网络设置1.1 WAN口配置用于配置WAN口连接的参数,包括IP地质、子网掩码、网关、DNS服务器等。
配置命令示例:set interface wan0 address 192.168.1.100/24set interface wan0 gateway 192.168.1.1set interface wan0 primary-dns 8.8.8.8:::1.2 LAN口配置用于配置LAN口连接的参数,包括IP地质、子网掩码、DHCP 服务器等。
配置命令示例:set interface lan1 address 192.168:0.1/24set interface lan1 dhcp enable:::1.3 VLAN配置用于配置VLAN,将不同的LAN口划分成不同的虚拟网络。
配置命令示例:set vlan vlan1 ports allset vlan vlan2 ports lan1,lan2:::2、安全设置2.1 密码设置用于设置路由器登录密码和特权密码。
配置命令示例:set system login user admin password encrypted 123456 set system login enable-password encrypted 654321:::2.2 ACL配置用于设置访问控制列表,限制某些IP地质或端口的访问。
配置命令示例:set access-list 1 permit ip 192.168:0:0/24 anyset access-list 2 deny tcp any any eq 22:::3、路由配置3.1 静态路由用于设置静态路由,手动指定下一跳地质。
配置命令示例:set static-route 0:0:0:0/0 next-hop 192.168.1.1:::3.2 动态路由用于配置动态路由协议,如RIP、OSPF、BGP等。
锐捷交换机、路由器设备配置指令

锐捷交换机、路由器设备配置指令一、交换机RG-S3760-B配置指令RG-S3760-2#conf t设置链路聚合RG-S3760-2(config)#int range fa0/23-24RG-S3760-2(config-if-range)#port-group 1RG-S3760-2(config-if-range)#exitRG-S3760-2(config)#int aggregateport 1RG-S3760-2(config-if-AggregatePort 1)#sw mo trRG-S3760-2(config-if-AggregatePort 1)#exit创建Vlan10-40RG-S3760-2(config)#vlan 10RG-S3760-2(config-vlan)#vlan 20RG-S3760-2(config-vlan)#vlan 30RG-S3760-2(config-vlan)#vlan 40RG-S3760-2(config-vlan)#exit给Vlan30、40分配端口RG-S3760-2(config)#int range fa0/4-10RG-S3760-2(config-if-range)#sw mo acRG-S3760-2(config-if-range)#sw ac vlan 30RG-S3760-2(config-if-range)#no shutdownRG-S3760-2(config-if-range)#exitRG-S3760-2(config)#int range fa0/11-16RG-S3760-2(config-if-range)#sw mo acRG-S3760-2(config-if-range)#sw ac vlan 40RG-S3760-2(config-if-range)#exit二、交换机RG-S3760-A配置指令RG-S3760-1#conf tRG-S3760-1#ip routing设置链路聚合RG-S3760-1(config)#int range fa0/23-24RG-S3760-1(config-if-range)#port-group 1RG-S3760-1(config-if-range)#no shutdownRG-S3760-1(config-if-range)#exitRG-S3760-1(config)#int aggregateport 1RG-S3760-1(config-if-AggregatePort 1)#sw mo trRG-S3760-1(config-if-AggregatePort 1)#exit创建Vlan10-40RG-S3760-1(config)#vlan 10RG-S3760-1(config-vlan)#vlan 20RG-S3760-1(config-vlan)#vlan 30RG-S3760-1(config-vlan)#vlan 40给Vlan10、20分配端口RG-S3760-1(config)#int range fa0/4-10RG-S3760-1(config-if-range)#sw mo acRG-S3760-1(config-if-range)#sw ac vlan 10RG-S3760-1(config-if-range)#exitRG-S3760-1(config)#int range fa0/11-16RG-S3760-1(config-if-range)#sw mo acRG-S3760-1(config-if-range)#sw ac vlan 20RG-S3760-1(config-if-range)#exit给Vlan10-40配置管理 IPRG-S3760-1(config)#int vlan 10RG-S3760-1(config-if-VLAN 10)#ip address 172.16.10.254 255.255.255.0RG-S3760-1(config-if-VLAN 10)#no shutdownRG-S3760-1(config-if-VLAN 10)#exitRG-S3760-1(config)#int vlan 20RG-S3760-1(config-if-VLAN 20)#ip address 172.16.20.254 255.255.255.0RG-S3760-1(config-if-VLAN 20)#no shutdownRG-S3760-1(config-if-VLAN 20)#exitRG-S3760-1(config)#int vlan 30RG-S3760-1(config-if-VLAN 30)#ip address 172.16.30.253 255.255.255.0RG-S3760-1(config-if-VLAN 30)#no shutdownRG-S3760-1(config-if-VLAN 30)#exitRG-S3760-1(config)#int vlan 40RG-S3760-1(config-if-VLAN 40)#ip address 172.16.40.253 255.255.255.0RG-S3760-1(config-if-VLAN 40)#no shutdownRG-S3760-1(config-if-VLAN 40)#exit设置三层路由接口IPRG-S3760-1(config)#int fa0/1RG-S3760-1(config-if-FastEthernet 0/1)#no switchportRG-S3760-1(config-if-FastEthernet 0/1)#ip address 192.168.1.2 255.255.255.252 RG-S3760-1(config-if-FastEthernet 0/1)#no shutdownRG-S3760-1(config-if-FastEthernet 0/1)#exit设置动态路由、默认路由RG-S3760-1(config)#router ripRG-S3760-1(config-router)#version 2RG-S3760-1(config-router)#no auto-summaryRG-S3760-1(config-router)#network 192.168.1.0RG-S3760-1(config-router)#network 172.16.10.0RG-S3760-1(config-router)#network 172.16.20.0RG-S3760-1(config-router)#network 172.16.30.0RG-S3760-1(config-router)#network 172.16.40.0RG-S3760-1(config-router)#exitRG-S3760-1(config)#ip route 0.0.0.0 0.0.0.0 fa0/1RG-S3760-1(config)#end三、路由器RSR20-A配置指令Red-Giant#conf tRed-Giant(config)#hostname RSR20-ARSR20-A(config)#int fa1/0RSR20-A(config-if)#ip address 192.168.1.1 255.255.255.252 RSR20-A(config-if)#no shutdownRSR20-A(config-if)#exit设置电信IPRSR20-A(config)#int s1/2RSR20-A(config-if)#ip address 119.1.1.1 255.255.255.252 RSR20-A(config-if)#no shutdownRSR20-A(config-if)#exit设置动态路由、默认路由RSR20-A(config)#router ripRSR20-A(config-router)#version 2RSR20-A(config-router)#no auto-summaryRSR20-A(config-router)#network 192.168.1.0RSR20-A(config)#ip route 0.0.0.0 0.0.0.0 s1/2配置NATRSR20-A(config)#int fa1/0RSR20-A(config-if)#ip nat insideRSR20-A(config-if)#exitRSR20-A(config)#int s1RSR20-A(config-if)#ip nat outsideRSR20-A(config-if)#exitRSR20-A(config)#access-list 10 permit 172.16.10.0 0.0.0.255 RSR20-A(config)#access-list 10 permit 172.16.20.0 0.0.0.255 RSR20-A(config)#access-list 10 permit 172.16.30.0 0.0.0.255 RSR20-A(config)#access-list 10 permit 172.16.40.0 0.0.0.255RSR20-A(config)#ip nat pool net10 119.1.1.1 119.1.1.1 netmask 255.255.255.252 RSR20-A(config)#ip nat inside source list 10 pool net10 overload创建ACL,禁止172.16.20.0网去访问外网RSR20-A(config)#access-list 20 deny 172.16.20.0 0.0.0.255RSR20-A(config)#access-list 20 permit anyRSR20-A(config)#int fa1/0RSR20-A(config-if)#ip access-group 20 inRSR20-A(config-if)#exit四、路由器Internet配置指令R2600_2#conf tR2600_2 (config)#hostname Internet设置Internet路由器IPInternet (config)#int s1/2Internet (config-if)#ip address 119.1.1.2 255.255.255.252Internet (config-if)#clock rate 9600Internet (config-if)#no shutdownInternet (config-if)#exit设置Web服务器网关地址Internet 2(config)#int fa1/0Internet (config-if)#ip address 192.168.6.254 255.255.255.0Internet (config-if)#no shutdownInternet (config-if)#exit。
锐捷路由器的配置(交换机、路由器配置步骤简要说明)

锐捷路由器的配置一、路由器基本配置命令/*由远程终端登录路由器*/Red-Giant>enable——由用户模式进入特权模式Password:******——输入密码Red-Giant#configure——由特权模式进入全局配置模式Configuring from terminal, memory, or network [terminal]? t——输入t继续Red-Giant(config)#hostname Router——修改路由器名称/*配置接口IP地址*/Router(config)#interface fastethernet 0——进入以太网口0接口模式Router(config-if)#ip address 192.168.1.1 255.255.255.0——为其配置IP地址Router(config-if)#no shutdown——启用配置Router(config-if)#exit——退至配置模式Router(config)#interface fastethernet 1——进入以太网口0接口模式Router(config-if)#ip address 192.168.2.1 255.255.255.0——为其配置IP地址Router(config-if)#no shutdown——启用配置Router(config-if)#exit——退至配置模式Router(config)#interface serial 0——进入Serial 0接口模式Router(config-if)#ip address 192.168.3.1 255.255.255.0——为其配置IP地址Router(config-if)#no shutdown——启用配置Router(config-if)#exit——退至配置模式Router(config)#interface serial 1——进入Serial 1接口模式Router(config-if)#ip address 192.168.4.1 255.255.255.0——为其配置IP地址Router(config-if)#no shutdown——启用配置Router(config-if)#end——退至特权模式Router#write——保存配置信息Router(config)#interface loopback 0——新建Loopback 0Router(config-if)#ip add 10.10.1.1 255.255.255.0——为其配置IP地址Router(config-if)#int loopback 1——新建Loopback 1Router(config-if)#ip add 10.10.2.1 255.255.255.0——为其配置IP地址Router(config-if)#end——退至特权模式/*查看路由器相关配置信息*/Router#show ip interface brief——查看配置状态Router#show version——显示路由器版本信息Router#show ip interface fastethernet 0——查看以太网口0接口配置状态Router#show running-config——显示当前运行的配置参数Router#show startup-config——显示NVRAM中中配置参数的副本Router#copy running-config startup-config——将当前运行的配置参数复制到NVRAM Router#erase startup-config——清空NVRAM中的配置参数Router#reload——重新启动路由器/*配置console登陆密码*/Router(config)#line console 0Router(config-line)#loginRouter(config-line)#password star/*配置VTY登陆密码*/Router(config)#line vty 0 4Router(config-line)#loginRouter(config-line)#password star/*配置特权模式登录密码*/Router(config)#enable password star——配置明文密码Router(config)#enable secret star——配置的密码不能与password密码相同二、路由器密码丢失的处理方法01、关闭路由器,重新登录超级终端,按默认方法设置;02、启动路由器,不停地按Ctrl+Pause Break,直至出现Boot:提示符,输入Setup-Reg;Boot:Setup-Reg03、出现如下提示信息,按“Y”回车确认:Do you wish to change the configuration?y/n[n]:04、出现提示如下信息,按“Y”回车确认:Enable“bypass the system configure file”y/n[n]:05、出现提示如下信息,按“N”回车确认:Enable“debug mode?”y/n[n]:06、出现提示如下信息,按“N”回车确认:Enable“user break/abort enabled?”y/n[n]:07、出现提示如下信息,按“N”回车确认:Change console speed?y/n[n]:08、出现提示如下信息,按“N”回车确认:Do you wish to change the configuration?y/n[n]:09、出现提示符“Boot:”,输入Reset;Boot:reset10、出现提示如下信息,按“N”回车确认:Would you like to enter the initial configuration dialog?[Yes]:此时密码及路由器信息被清除,你就可以顺利进入路由器了……可以归纳为“Setup-Reg,两个Y五个N,Reset”。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
Switch(config)#exit
Switch#
进入接口配置模式
Switch(config)#interface fastethernet 0/1
Switch(config-if)#exit
Switch(config)#
从子模式下直接返回特权模式
Switch(config-vlan)# end
把接口 0/10加入VLAN10
Switch# configure terminal
Switch(config)# interface fastethernet 0/10
Switch(config-if)# switchport mode access
RIP路由协议的版本
RIPv1
有类路由协议,不支持VLSM
以广播的形式发送更新报文
不支持认证
RIPv2
无类路由协议,支持VLSM
以组播的形式发送更新报文
支持明文和MD5的认证
配置RIP协议
配置步骤
1、开启RIP路由协议进程
Router(config)#router rip
2、申请本路由器参与RIP协议的直连网段信息
S*0.0.0.0/0 [1/0] via 10.5.5.5
静态路由配置命令
配置静态路由用命令ip route
router(config)#ip route [网络编号] [子网掩码] [转发路由器的IP地址/本地接口]
例:ip route 192.168.10.0 255.255.255.0 serial 1/2
(“0”或“4096”的倍数、共16个、缺省32768)
恢复到缺省值
Switch(config)# no spanning-tree priority
配置交换机端口的优先级
Switch(config)#interface interface-type interface-number
Switch(config-if)#spanning-tree port-priority number
第二步:配置远程登录密码
RouterA(config)# line vty 0 4 !进入路由器线路配置模式
RouterA(config-line)# login !配置远程登录
RouterA(config-line)# password star !设置路由器远程登录密码为 “star”
RouterA(config-line)#end
配置STP、RSTP
Spanning Tree 的缺省配置:
关闭STP
STP Priority 是32768
STP port Priority 是128
STP port cost 根据端口速率自动判断
Hello Time 2秒
Forward-delay Time 15秒
Max-age Time 20秒
查看路由信息
router#show ip route
Codes: C - connected,S – static, R – RIP, O- OSPF
IA - OSPF inter area,E1-OSPF external type 1
E2 - OSPF external type 2,* - candidate default
锐捷交换机、路由器常用命令
EXEC模式:
用户模式switch>
交换机信息的查看,简单测试命令
特权模式switch#
查看、管理交换机配置信息,测试、调试
配置模式:
全局配置模式switch(config)#
配置交换机的整体参数
接口配置模式switch(config-if)#
配置交换机的接口参数
进入全局配置模式
关闭生成树协议
Switch(config)#no Spanning-tree
配置生成树协议的类型
Switch(config)#Spanning-tree mode stp/rstp
锐捷全系列交换机默认使用MSTP协议
配置交换机优先级
Switch(config)#spanning-tree priority <0-61440>
Switch(config-if)#end
Switch#
命令行其他功能
获得帮助
switch#?
switch#show ?
命令简写
全写:switch# configure terminal
简写:Switch# config
使用历史命令
Switch# (向上键)
Switch# (向下键)
配置交换机Telnet功能
show startup-config !查看用户保存在NVRAM中的配置文件
保存配置文件
Router#copy running-config startup-config
Router#write memory
Router#write
删除配置文件
Router#delete flash:config.text !删除初始配置文件
RouterA(config)# interface fastethernet 1/0
!进入路由器接口配置模式
RouterA(config-if)# ip address 192.168.0.1 255.255.255.0
!配置路由器管理接口IP地址
RouterA(config-if)# no shutdown !开启路由器f 1/0接口
例:ip route 192.168.10.0 255.255.255.0 172.16.2.1
静态路由描述转发路径的方式有两种
指向本地接口(即从本地某接口发出)
指向下一跳路由器直连接口的IP地址(即将数据包交给X.X.X.X)
配置默认路由:
router(config)#ip route0.0.0.0 0.0.0.0 [转发路由器的IP地址/本地接口]
如果这个AP不存在,可自动创建AG端口
查看聚合端口的汇总信息
Switch#show aggregateport summary
查看聚合端口的流量平衡方式
Switch#show aggregateport load-balance
路由器上配置telnet
第一步: 配置端口地址
RouterA# configure terminal !进入全局配置模式
Switch (config-if)#no shutdown
Switch (config-if)#ip address 192.168.1.1 255.255.255.0
Switch (config-if)#end
配置文件的管理
保存配置
将当前运行的参数保存到flash 中用于系统初始化时初始化参数
Switch#copy running-config startup-config
第三步:配置路由器特权模式密码
RouterA(config)# enable secret star !设置路由器特权模式密码为 “star”
或者
RouterA(config)# enable password star
查看配置文件
show version !查看版本及引导信息
show running-config !查看运行配置
Router(config-router)#network 192.168.1.0
3、指定RIP协议的版本2(默认是version1)
Router(config-router)#version 2
4、在RIPv2版本中关闭自动汇总
Router(config-router)#no auto-summary
注:连续接口 0/1-8,不连续接口用逗号隔开,但一定要写明模块编号
配置Tag VLAN-Trunk
把Fa0/1配成Trunk口
Switch# configure terminal
Switch(config)# interface fastethernet0/1
Switch(config-if)# switchport mode trunk
配置aggregate port
将该接口加入一个AP
Switch#c onfigure terminal
Switch(config) # interface interface-type interface-id
Switch(config-if-range)#port-group port-group-number
查看RIP配置信息
验证 RIP的配置
Router#show ip protocols
显示路由表的信息
Router#show ip route
清除 IP路由表的信息
Router#clear ip route
在控制台显示 RIP的工作状态
Router#debug ip rip
OSPF协议
OSPF配置如下:
把端口Fa0/20 配置为Trunk端口,但是不包含VLAN 2:
Switch(config)# interface fastethernet 0/20
Switch(config-if)# switchport trunk allowed vlan remove 2
Switch(config-if)# end
Switch#write memory
Switch#write
删除配置
永久性的删除flash 中不需要的文件
使用命令delete flash:config.text
删除当前的配置: 在配置命令前加no
例:switch(config-if)# no ip address