水简介

首页 » 常识 » 常识 » 锐捷交换机常用配置命令
TUhjnbcbe - 2021/8/18 9:56:00
治疗白癜风的最新方法 http://m.39.net/pf/bdfyy/
基本配置Enable进入特权模式#Exit返回上一级操作模式#End返回到特权模式#writememory或copyrunning-configstartup-config保存配置文件#delflash:config.text删除配置文件(交换机及系列路由器)#erasestartup-config删除配置文件(系列路由器)#delflash:vlan.dat删除Vlan配置信息(交换机)#Configureterminal进入全局配置模式(config)#hostnameswitchA配置设备名称为switchA(config)#bannermotd配置每日提示信息为终止符(config)#enablesecretlevel10star配置远程登陆密码为star(config)#enablesecretlevelstar配置特权密码为starLevel1为普通用户级别,可选为1~15,15为最高权限级别;0表示密码不加密(config)#enableservicesweb-server开启交换机WEB管理功能Services可选以下:web-server(WEB管理)、telnet-server(远程登陆)等查看信息showrunning-config查看当前生效的配置信息showinterfacefastethernet0/3查看F0/3端口信息showinterfaceserial1/2查看S1/2端口信息showinterface查看所有端口信息showipinterfacebrief以简洁方式汇总查看所有端口信息showipinterface查看所有端口信息showversion查看版本信息showmac-address-table查看交换机当前MAC地址表信息showrunning-config查看当前生效的配置信息showvlan查看所有VLAN信息showvlanid10查看某一VLAN(如VLAN10)的信息showinterfacefastethernet0/1switchport查看某一端口模式(如F0/1)showaggregateport1summary查看聚合端口AG1的信息showspanning-tree查看生成树配置信息showspanning-treeinterfacefastethernet0/1查看该端口的生成树状态showport-security查看交换机的端口安全配置信息showport-securityaddress查看地址安全绑定配置信息showipaccess-listslistname查看名为listname的列表的配置信息showaccess-lists端口的基本配置

(config)#Interfacefastethernet0/3进入F0/3的端口配置模式(config)#interfacerangefa0/1-2,0/5,0/7-9进入F0/1、F0/2、F0/5、F0/7、F0/8、F0/9的端口配置模式(config-if)#speed10配置端口速率为10M,可选10,,auto(config-if)#duplexfull配置端口为全双工模式,可选full(全双工),half(半双式),auto(自适应)(config-if)#noshutdown开启该端口(config-if)#switchportaccessvlan10将该端口划入VLAN10中,用于VLAN(config-if)#switchportmodetrunk将该端口设为trunk模式,用于Tagvlan,可选模式为access,trunk(config-if)#port-group1将该端口划入聚合端口AG1中,用于聚合端口聚合端口的创建

(config)#interfaceaggregateport1创建聚合接口AG1(config-if)#switchportmodetrunk配置并保证AG1为trunk模式(config)#intf0/23-24(config-if-range)#port-group1将端口(端口组)划入聚合端口AG1中生成树

(config)#spanning-tree开启生成树协议(config)#spanning-treemodestp指定生成树类型为stp,可选模式stp,rstp,mstp(config)#spanning-treepriority设置交换机的优先级为,优先级值小为高。优先级可选值为0,,,……,为的倍数。交换机默认值为VLAN的基本配置

(config)#vlan10创建VLAN10(config-vlan)#namevlanname命名VLAN为vlanname(config-if)#switchportaccessvlan10将该端口划入VLAN10中某端口的接口配置模式下进行(config)#interfacevlan10进入VLAN10的虚拟端口配置模式(config-if)#ipaddress..1....0为VLAN10的虚拟端口配置IP及掩码,二层交换机只能配置一个IP,此IP是作为管理IP使用,例如,使用Telnet的方式登录的IP地址(config-if)#noshutdown启用该端口端口安全(config)#interfacefastethernet0/1进入一个端口(config-if)#switchportport-security开启该端口的安全功能1.配置最大连接数限制(config-if)#switchportport-secruitymaxmum1配置端口的最大连接数为1,最大连接数为(config-if)#switchportport-secruityviolationshutdown配置安全违例的处理方式为shutdown,可选为protect(当安全地址数满后,将未知名地址丢弃)、restrict(当违例时,发送一个Trap通知)、shutdown(当违例时将端口关闭,并发送Trap通知,可在全局模式下用errdisablerecovery来恢复)2.IP和MAC地址绑定

(config-if)#switchportport-securitymac-addressxxxx.xxxx.xxxxip-address.16.1.1接口配置模式下配置MAC地址xxxx.xxxx.xxxx和IP.16.1.1进行绑定(MAC地址注意用小写)三层路由功能(针对三层交换机)

(config)#iprouting开启三层交换机的路由功能(config)#interfacefastethernet0/1(config-if)#noswitchport开启端口的三层路由功能(这样就可以为某一端口配置IP)(config-if)#ipaddress..1....0(config-if)#noshutdown三层交换机路由协议

(config)#iproute.16.1.0...0.16.2.1配置静态路由注:.16.1.0...0为目标网络的网络号及子网掩码.16.2.1为下一跳的地址,也可用接口表示,如iproute.16.1.0...0serial1/2(.16.2.0所接的端口)(config)#routerrip开启RIP协议进程(config-router)#network.16.1.0申明本设备的直连网段信息(config-router)#version2开启RIPV2,可选为version1(RIPV1)、version2(RIPV2)(config-router)#noauto-summary关闭路由信息的自动汇总功能(只有在RIPV2支持)(config)#routerospf开启OSPF路由协议进程(针对,无需使用进程ID)(config)#routerospf1开启OSPF路由协议进程(针对,需要加OSPF进程ID)(config-router)#network..1.00.0.0.area0申明直连网段信息,并分配区域号(area0为骨干区域)IPACL:

交换机采用命名的访问控制列表;分标准(stand)和扩展(extended)两种

1.标准ACL

(config)#ipaccess-liststandlistname定义命名标准列表,命名为listname,stand为标准列表(config-std-nacl)#deny..30.00.0.0.拒绝来自..30.0网段的IP流量通过注:deny:拒绝通过;可选:deny(拒绝通过)、permit(允许通过)..30.00.0.0.:源地址及源地址通配符;可使用any表示任何IP(config-std-nacl)#permitany(config-std-nacl)#end返回2.扩展ACL

(config)#ipaccess-listextendedlistname定义命名扩展列表,命名为listname,extended为扩展(config-ext-nacl)#denytcp..30.00.0.0...10.00.0.0.eq

1
查看完整版本: 锐捷交换机常用配置命令