交换机基本命令

合集下载

交换机配置命令大全

交换机配置命令大全

交换机配置命令大全交换机是网络中非常重要的设备,它可以实现局域网内计算机之间的数据传输和通信。

在进行交换机的配置时,我们需要掌握一些基本的配置命令,以确保交换机能够正常运行并满足网络的需求。

下面将介绍一些常用的交换机配置命令,希望对大家有所帮助。

1. 设置交换机的主机名。

在配置交换机之前,我们首先需要设置交换机的主机名,以便在网络中进行识别和管理。

我们可以通过以下命令来设置交换机的主机名:```。

Switch(config)#hostname S1。

```。

这条命令将交换机的主机名设置为S1,您也可以根据实际情况进行修改。

2. 配置交换机的管理IP地址。

为了实现对交换机的远程管理,我们需要为交换机配置一个IP地址。

我们可以通过以下命令来配置交换机的管理IP地址:```。

Switch(config)#interface vlan 1。

Switch(config-if)#ip address 192.168.1.1 255.255.255.0。

Switch(config-if)#no shutdown。

```。

这条命令将VLAN 1接口的IP地址设置为192.168.1.1,子网掩码为255.255.255.0,并启用该接口。

3. 配置交换机端口。

在实际网络中,我们需要对交换机的端口进行配置,以满足不同设备的连接需求。

以下是一些常用的端口配置命令:```。

Switch(config)#interface fastethernet 0/1。

Switch(config-if)#switchport mode access。

Switch(config-if)#switchport access vlan 10。

```。

这条命令将FastEthernet 0/1端口设置为接入模式,并将该端口划分到VLAN 10中。

4. 配置交换机的VLAN。

VLAN是虚拟局域网的缩写,它可以将一个物理局域网划分成多个逻辑上的局域网。

交换机基本配置命令汇总大全

交换机基本配置命令汇总大全

交换机基本配置命令汇总大全一、交换机基本操作:1.1进入特权模式Switch>enableSwitch#1.2返回用户模式Switch#exitPress RETURN to get started!Switch>二、配置模式:全局配置模式[主机名(config)#]:配置交换机的整体参数2.1子模式:1.线路配置模式[主机名(config-line)#]:配置交换机的线路参数2.接口配置模式[主机名(config-if)#]:配置交换机的接口参数2.2进入、退出全局配置模式Switch#configure terminalSwitch(config)#exitSwitch#2.3进入、退出线路配置模式Switch(config)#line console0Switch(config-line)#exitSwitch(config)#2.4进入、退出接口配置模式Switch(config)#interface fastEthernet0/1Switch(config-if)#exitSwitch(config)#2.5从子模式下直接返回特权模式Switch(config-if)#endSwitch#三、交换机操作帮助:Ø支持命令简写(按TAB键将命令补充完整)Ø在每种操作模式下直接输入“?”显示该模式下所有的命令Ø命令空格“?”显示命令参数并对其解释说明Ø“字符?”显示以该字符开头的命令Ø命令历史缓存:(Ctrl+P)显示上一条命令,(Ctrl+N)显示下一条命令Ø错误提示信息四、交换机显示命令:Ø显示交换机硬件及软件的信息Switch#show versionØ显示当前运行的配置参数Switch#show running-configØ显示保存的配置参数Switch#show configure五、常用交换机flash中的命令:5.1将当前运行的配置参数复制到flashSwitch#write memoryBuilding configuration...[OK]Switch#5.2清空flashSwitch#delete flash:config.textSwitch#5.3交换机重新启动:Switch#reloadSystem configuration has been modified.Save?[yes/no]:n Proceed with reload?[confirm]5.4配置交换机主机名:Switch(config)#hostname S2126G-1S2126G-1(config)#5.5配置交换机口令:1)配置交换机的登陆密码S2126G(config)#enable secret level10star“0”表示输入的是明文形式的口令2)配置交换机的特权密码S2126G(config)#enable secret level150star“0”表示输入的是明文形式的口令六、常用交换机配置命令:6.1为交换机分配管理IPS2126G(config)#interface vlan1S2126G(config-if)#ip address{IP address}{IP subnetmask}[secondary]6.2将接口启用S2126G(config-if)#no shutdown6.3将接口关闭S2126G(config-if)#shutdown6.4配置接口速率S2126G(config-if)#speed[10|100|auto]6.5配置接口双工模式S2126G(config-if)#duplex[auto|full|half]七、显示接口状态:S2126G#show interface八、测定目的端的可达性:S2126G>ping{IP address}九、从TFTP服务器下载配置参数:S2126G#copy tftp startup-config十、管理交换机MAC地址表:10.1查看MACS2126G#show mac-address-table10.2配置MACS2126G(config)#mac-address-table aging-time<10-1000000> 10.3查看MACS2126G#show mac-address-table aging-time十一、VLAN的配置:11.1添加一个VLANS2126G(config)#vlan<1-4094>S2126G(config-vlan)#11.2为VLANS2126G(config-vlan)#name名字十二、将交换机端口分配到VLAN12.1配置Port VLANSwitch(config-if)#switchport access vlan<1-4094>12.2配置Tag VLANSwitch(config-if)#switchport mode trunk1)配置本地(native)VLANSwitch(config-if)#switchport trunk native vlan<1-4094> Native VLAN即PVID,默认情况下每个trunk口的native VLAN是12)从主干链路中清除VLANSwitch(config-if)#switchport trunk allowed vlanexcept vlan-list注:VLAN1不可被清除3)在主干链路中允许所有VLANSwitch(config-if)#switchport trunk allowed vlan all4)向主干链路中加入VLANSwitch(config-if)#switchport trunk allowed vlanadd vlan-list12.3VLAN1.显示全部的VLAN:Switch#show vlan2.显示单独的VLAN:Switch#show vlan id<1-4094>十三、RSTP的配置:13.1启用生成树:S2126G(config)#spanning-tree13.2配置交换机优先级:S2126G(config)#spanning-tree priority<0-61440>“0”或“4096”的倍数(RSTP BPDU该值后12bit全0)13.3配置交换机端口优先级:S2126G(config-if)#spanning-tree port-priority<0-240>“0”或“16”的倍数(RSTP BPDU该值后4bit全0)13.4生成树helloS2126G(config)#spanning-tree hello-time<1-10>13.5生成树的验证:Switch#show spanning-treeSwitch#show spanning-tree interface<接口名称><接口编号>十四、三层交换机路由功能:14.1开启三层交换机的路由功能Switch(config)#ip routing14.2开启端口的三层路由功能Switch(config)#interface fastethernet0/1Switch(config-if)#no switchport(这样就可以为某一端口配置IP)Switch(config-if)#ip address192.168.1.1255.255.255.0 Switch(config-if)#no shutdown。

交换机常用命令

交换机常用命令

交换机1、恢复出厂设置#set default2、给vlan添加端口#vlan 100 (创建一个vlan100)#switchport interface ethernet 1/1 (将E1/1接口加入vlan100中)#switchport interface ethernet 1/2-5 (将E1/2-5 范围内加入到vlan100中)3、设置Trunk端口允许通过vlan#interface ethernet 1/5#switchport mode trunk (将E1/5设置为trunk模式)#switchport trunk allowed vlan 1;3;5-20 (允许通过的vlan段)#switchport forbidden vlan add vlan 10 (防止E1/5加入到vlan10中)4、光口,电口的转换#interface ethernet 1/1#media-type copper(电口)/fiber(光口)5、端口粘连#switchport port-security mac-address sticky (将自动学习到得mac地址粘连到接口上)6、端口过滤#mac-address-table blackhole address {mac-address} vlan 17、端口聚合#port-group 1 (创建一个port-group组)#interface ethernet 1/1-2#port-group 1 mode on(强制)、passive(被动)、active(主动)[两个不能是passive ,active 和passive 要一起使用]8、端口镜像#monitor session 1 source interface ethernet 1/0/1 both (将源E1/0/1的流量镜像到E1/0/2)#monitor session 1 destination interface ethernet 1/0/2 (将源session 1发送至E1/0/2中)9、设置用户自动退出特权模式的超时时间#exec timeout10、关闭端口的vlan入口规则#vlan ingress disable11、设定引入路由的缺省路由权值#default-metric12、设置MD5认证,采用MD5认证#ip ospf message-digest-key 1 MD5 password#ip ospf authentication message-digest13、绑定MAC地址①在端口安全中绑定#switchport port-security mac-address …….②AM中启动#am mac-ip-pool …….③全局配置模式下#mac-address-table static address {mac-address} vlan 1 interface e1/114、生成树#spanning-tree 开启生成树#spanning-tree mst configuration 域配置#instance 10 vlan 10,,2 配置vlan到instance的映射#spanning-tree mst 10 priority 配置映射域的优先级#spanning-tree mst 10 cost 4096 在接口中调整开销15、交换机VRRP①创建vlan②配置vlan接口IP③配置vrrp#router vrrp 1 创建VRRP组#interface vlan 10 关联vlan接口#virtual-ip 192.168.10.1 配置虚拟地址#priority 120 优先级#preempt-mode true/false 配置抢占模式#enable 开启VRRP16、DHCP#service dhcp 开启DHCP#network-address 配置地址池#default-router 配置网关#dns-service DNF服务器地址17、QOS一、在交换机上实现QOSA.采用ACL定义需要限速的数据流(1)#ip access-list standard yuangong …..定义访问控制列表名(2)#permit host 192.168.1.1 ……………..定义限速的数据流B.设置带宽限制和猝发数据量(3)#class-map yuangong…………………定义类图yuangong(4)#match access-group yuangong……...关联匹配的列表(5)#policy-map test……………………….定义策略表(6)#class yuangong……………………….关联类图(7)#police 1000000 655356 exceed-action drop…..设置数据流量限制C.将带宽限制策略应用到相应的端口上(8)#interface e1/0/1……………………….进入借口模式(9)#mls qos trust cos……………………...开启信任COS值(10)#service-policy input test………………应用策略表。

(完整版)锐捷交换机命令大全

(完整版)锐捷交换机命令大全

【第一部分】交换机支持的命令: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、配置文件相关命令[Quidway]display current-configuration 显示当前生效的配置[Quidway]display saved-configuration显示flash中配置文件,即下次上电启动时所用的配置文件reset saved-configuration 檫除旧的配置文件reboot 交换机重启display version 显示系统版本信息2、基本配置[Quidway]super password 修改特权用户密码[Quidway]sysname 交换机命名[Quidway]interface ethernet 1/0/1 进入接口视图[Quidway]interface vlan 1进入接口视图[Quidway-Vlan-interfacex]ip address 10.1.1.11 255.255.0.0配置VLAN的IP地址[Quidway]ip route-static 0.0.0.0 0.0.0.0 10.1.1.1静态路由=网关3、telnet配置[Quidway]user-interface vty 0 4 进入虚拟终端[S3026-ui-vty0-4]authentication-mode password 设置口令模式[S3026-ui-vty0-4]set authentication-mode password simple xmws123设置口令[S3026-ui-vty0-4]user privilege level 3 用户级别4、端口配置[Quidway-Ethernet1/0/1]duplex {half|full|auto} 配置端口工作状态[Quidway-Ethernet1/0/1]speed {10|100|auto} 配置端口工作速率[Quidway-Ethernet1/0/1]flow-control 配置端口流控[Quidway-Ethernet1/0/1]mdi {across|auto|normal} 配置端口平接扭接[Quidway-Ethernet1/0/1]port link-type {trunk|access|hybrid} 设置端口工作模式[Quidway-Ethernet1/0/1]undo shutdown 激活端口[Quidway-Ethernet1/0/2]quit 退出系统视图5、链路聚合配置[DeviceA] link-aggregation group 1 mode manual 创建手工聚合组1[Qw_A] interface ethernet 1/0/1 将以太网端口Ethernet1/0/1加入聚合组1 [Qw_A-Ethernet1/0/1] port link-aggregation group 1[Qw_A-Ethernet1/0/1] interface ethernet 1/0/2 将以太网端口Ethernet1/0/1加入聚合组1[Qw_A-Ethernet1/0/2] port link-aggregation group 1[Qw_A] link-aggregation group 1 service-type tunnel # 在手工聚合组的基础上创建t unnel业务环回组。

华为交换机基本切换的命令行

华为交换机基本切换的命令行

一、华为交换机基本切换的命令行1、用户视图2、系统视图system-view进系统视图命令[HUAWEI]进系统试图状态3、接口视图[HUAWEI]interface GigabitEthernet 0/0/1进接口视图命令进第一接口[Huawei-GigabitEthernet0/0/1]进接口视图状态4、退出命令视图[HUAWEI]quit5、配置主机名[huawei]sysname6、显示系统IOS名称以及版本信息[huawei]dis version7、查看交换机当前配置信息[huawei]display current-configuration8、显示已保存的配置信息[huawei]display saved-configuration9、保存当前配置信息save10、删除已保存的配置信息#reset saved-configuration11、进入接口视图[huawei]interface g0/0/1[huawei-GigabitEthernet]12、配置接口类型[huawei-GigabitEthernet]port link-type access [huawei-GigabitEthernet]port default vlan 213、shutdown命令用来关闭当前接口。

14、undo shutdown命令用来开启当前接口。

15、display interface命令用来查看接口当前运行状态和接口统计信息16、display interface brief命令用来查看接口状态和配置的简要信息。

17、display ip interface brief命令用来查看接口与IP相关的简要信息,包括IP地址、子网掩码、物理链路和协议的Up/Down状态以及处于不同状态的接口数目。

二、划分vlanvlan 2quitintervlan 2ip add 192.168.1.254 24 quitvlan 3quitintervlan 3ip add 192.168.2.254 24 quitinter g0/0/1port link-type access port default vlan 2 quitinter g0/0/2port link-type trunk port trunk all vlan 2 to 3 quit。

华为交换机常见命令

华为交换机常见命令

一、清空配置:<HUAWEI> reset saved-configuration(清楚下次启动时使用的配置文件信息)然后重启设备,重启设备室提示保存信息,选择“NO”。

<HUAWEI> reset saved-configurationWarning: The action will delete thesaved configuration in the device.The configuration will be erased toreconfigure. Continue? [Y/N]:yWarning: Now clearing the configuration inthe device.Info: Succeeded in clearing the configuration in the device.<HUAWEI> rebootInfo: The system is now comparing the configuration, pleasewait.Warning: The configuration has been modified, and it will be saved tothe next startup saved-configuration file flash:/vrpcfg.zip. Continue?[Y/N]:n //此处请选择“N”Info: If want to reboot with saving diagnosticinformation, input 'N' and then execute 'reboot save diagnostic-information'.System will reboot! Continue?[Y/N]:y二、通过STelnet/Telnet登录交换机设置新的Console口登录密码# 以登录用户界面的认证方式为密码认证,密码为Huawei@123为例,配置如下。

交换机路由器命令大全(结合配置实例)

交换机路由器命令大全(结合配置实例)

交换机路由器命令大全(结合配置实例)交换机路由器命令大全(结合配置实例)交换机和路由器是计算机网络中常用的网络设备,用于实现数据包的转发和路由选择。

在实际应用中,我们需要使用命令来配置交换机和路由器的各项参数。

本文将给出交换机和路由器常用命令的大全,并结合实际配置示例进行说明。

一、交换机命令1. 查看交换机基本信息查看交换机型号、固件版本、序列号等基本信息:show version2. 配置交换机端口设置交换机接口的速率、全双工模式等参数:interface interface_namespeed speed_valueduplex {full | half}3. 查看交换机端口状态查看交换机端口的连接状态、速率、工作模式等信息:show interfaces status4. 配置交换机VLAN创建VLAN和端口关联,实现VLAN的隔离和管理:vlan vlan_idname vlan_nameinterface interface_name5. 查看交换机MAC表显示交换机学习到的MAC地址和对应的端口:show mac-address-table6. 配置交换机链路聚合将多个物理端口绑定为一个逻辑端口,提高带宽和冗余性:interface port-channel channel_numberdescription description_textswitchport mode trunk/access7. 交换机Spanning Tree配置配置交换机的Spanning Tree协议参数,避免网络环路:spanning-tree vlan vlan_idpriority priority_value二、路由器命令1. 查看路由表显示路由器的路由表,包括直连路由、静态路由和动态路由表项:show ip route2. 配置静态路由手动配置路由器的静态路由表,指定目的网络和下一跳信息:ip route destination_network subnet_mask next_hop_ip3. 配置路由器接口配置路由器的接口参数,包括IP地址、子网掩码、描述等:interface interface_nameip address ip_address subnet_maskdescription description_text4. 配置路由器OSPF协议配置路由器之间的OSPF动态路由协议,实现网络的动态路由选择:router ospf process_idnetwork network_address wildcard_mask area area_number5. 配置路由器ACL配置路由器的访问控制列表,用于控制数据包的流量:access-list access_list_number permit/deny source destination6. 配置路由器NAT配置路由器的网络地址转换功能,实现内网与外网的互通:interface interface_nameip nat inside/outside三、配置实例1. 配置交换机端口接口GigabitEthernet0/1配置为100Mbps全双工模式:interface GigabitEthernet0/1speed 100duplex full2. 配置交换机VLAN创建VLAN10,将接口GigabitEthernet0/1划分到VLAN10:vlan 10name VLAN10interface GigabitEthernet0/13. 配置路由器接口将接口GigabitEthernet0/0配置为192.168.1.1/24的IP地址:interface GigabitEthernet0/0ip address 192.168.1.1 255.255.255.0description LAN interface4. 配置静态路由配置路由器的静态路由表,将目的网络192.168.2.0/24指向下一跳192.168.1.2:ip route 192.168.2.0 255.255.255.0 192.168.1.25. 配置路由器ACL设置访问控制列表,允许源IP地址为192.168.1.0/24的流量通过:access-list 1 permit 192.168.1.0 0.0.0.2556. 配置路由器NAT设置路由器的NAT,将内部接口GigabitEthernet0/1地址转换为公网地址:interface GigabitEthernet0/1ip nat inside以上是交换机和路由器常用命令的大全以及配置实例。

交换机命令大全

交换机命令大全

华为交换机基本配置命令一、单交换机VLAN划分命令命令解释system 进入系统视图system-view 进入系统视图quit 退到系统视图undo vlan 20 删除vlan 20sysname 交换机命名disp vlan 显示vlanvlan 20 创建vlan(也可进入vlan 20)port e1/0/1 to e1/0/5 把端口1-5放入VLAN 20 中disp vlan 20 显示vlan里的端口20int e1/0/24 进入端口24port access vlan 20 把当前端口放入vlan 20undo port e1/0/10 表示删除当前VLAN端口10disp curr 显示当前配置二、配置交换机支持TELNETsystem 进入系统视图sysname 交换机命名int vlan 1 进入VLAN 1ip address 192.168.3.100 255.255.255.0 配置IP地址user-int vty 0 4 进入虚拟终端authentication-mode password (aut password) 设置口令模式set authentication password simple 222 (set aut pass sim 222) 设置口令user privilege level 3(use priv lev 3) 配置用户级别disp current-configuration (disp cur) 查看当前配置disp ip int 查看交换机VLAN IP配置删除配置必须退到用户模式reset saved-configuration(reset saved) 删除配置reboot 重启交换机三、跨交换机VLAN的通讯在sw1上:vlan 10 建立VLAN 10int e1/0/5 进入端口5port access vlan 10 把端口5加入vlan 10vlan 20 建立VLAN 20int e1/0/15 进入端口15port access vlan 20 把端口15加入VLAN 20int e1/0/24 进入端口24port link-type trunk 把24端口设为TRUNK端口port trunk permit vlan all 同上在SW2上:vlan 10 建立VLAN 10int e1/0/20 进入端口20port access vlan 10 把端口20放入VLAN 10int e1/0/24 进入端口24port link-type trunk 把24端口设为TRUNK端口port trunk permit vlan all (port trunk permit vlan 10 只能为vlan 10使用)24端口为所有VLAN使用disp int e1/0/24 查看端口24是否为TRUNKundo port trunk permit vlan all 删除该句四、路由的配置命令system 进入系统模式sysname 命名int e1/0 进入端口ip address 192.168.3.100 255.255.255.0 设置IPundo shutdown 打开端口disp ip int e1/0 查看IP接口情况disp ip int brief 查看IP接口情况user-int vty 0 4 进入口令模式authentication-mode password(auth pass) 进入口令模式set authentication password simple 222 37 设置口令user privilege level 3 进入3级特权save 保存配置reset saved-configuration 删除配置(用户模式下运行)undo shutdown 配置远程登陆密码int e1/4ip route 192.168.3.0(目标网段)255.255.255.0 192.168.12.1(下一跳:下一路由器的接口)静态路由ip route 0.0.0.0 0.0.0.0 192.168.12.1 默认路由disp ip rout 显示路由列表华3C AR-18E1/0(lan1-lan4)E2/0(wan0)E3/0(WAN1)路由器连接使用直通线。

H3C交换机基础配置命令详解

H3C交换机基础配置命令详解

H3C交换机基础配置命令详解交换机的配置华为与H3C比较类似,这里面我们今天就来了解下,基础的配置命令,大家可以重点看下vlan的划分,这个在项目应用中较多。

一、基本配置<H3C> //用户直行模式提示符,用户视图<H3C>system-view //进入配置视图[H3C] sysname xxx //设置主机名成为xxx这里使用修改特权用户密码一、用户配置<H3C>system-view[H3C]super passwordH3C //设置用户分级密码[H3C]undo superpassword //删除用户分级密码[H3C]localuser bigheap 1234561 //Web网管用户设置,1(缺省)为管理级用户,缺省admin,admin[H3C]undo localuserbigheap //删除Web网管用户[H3C]user-interface aux0 //只支持0[H3C-Aux]idle-timeout 250 //设置超时为2分50秒,若为0则表示不超时,默认为5分钟[H3C-Aux]undoidle-timeout //恢复默认值[H3C]user-interface vty0 //只支持0和1[H3C-vty]idle-timeout 250 //设置超时为2分50秒,若为0则表示不超时,默认为5分钟[H3C-vty]undoidle-timeout //恢复默认值[H3C-vty]set authentication password123456 //设置telnet密码,必须设置[H3C-vty]undo set authenticationpassword //取消密码[H3C]displayusers //显示用户[H3C]displayuser-interface //用户界面状态三、VLAN配置[H3C]vlan 2 //创建VLAN2[H3C]undo vlanall //删除除缺省VLAN外的所有VLAN,缺省VLAN不能被删除[H3C-vlan2]port Ethernet 0/4 to Ethernet0/7 //将4到7号端口加入到VLAN2中,此命令只能用来加access端口,不能用来增加trunk或者hybrid端口[H3C-vlan2]port-isolateenable //打开VLAN内端口隔离特性,不能二层转发,默认不启用该功能[H3C-Ethernet0/4]port-isolate uplink-portvlan 2 //设置4为VLAN2的隔离上行端口,用于转发二层数据,只能配置一个上行端口,若为trunk,则建议允许所有VLAN通过,隔离不能与汇聚同时配置[H3C]display vlanall //显示所有VLAN的详细信息S1550E支持基于端口的VLAN,通过创建不同的user-group来实现,一个端口可以属于多个user-group,不属于同一个user-group的端口不能互相通信[H3C]user-group20 //创建user-group 20,默认只存在user-group 1[H3C-UserGroup20]port Ethernet 0/4 toEthernet 0/7 //将4到7号端口加入到VLAN20中,初始时都属于user-group 1中[H3C]display user-group20 //显示user-group 20的相关信息四、交换机IP配置[H3C]vlan 20 //创建vlan[H3C]management-vlan 20 //管理vlan[H3C]interface vlan-interface20 //进入并管理vlan20[H3C]undo interface vlan-interface20 //删除管理VLAN接口[H3C-Vlan-interface20]ip address192.168.1.2 255.255.255.0 //配置管理VLAN接口静态IP地址(缺省为192.168.0.234) [H3C-Vlan-interface20]undo ipaddress //删除IP地址[H3C-Vlan-interface20]ip gateway192.168.1.1 //指定缺省网关(默认无网关地址)[H3C-Vlan-interface20]undo ip gateway[H3C-Vlan-interface20]shutdown //关闭接口[H3C-Vlan-interface20]undoshutdown //开启[H3C]display ip //显示管理VLAN接口IP的相关信息[H3C]display interface vlan-interface20 //查看管理VLAN的接口信息<H3C>debuggingip //开启IP调试功能<H3C>undo debugging ip五、DHCP客户端配置[H3C-Vlan-interface20]ip addressdhcp-alloc // 管理VLAN接口通过DHCP方式获取IP地址[H3C-Vlan-interface20]undo ip addressdhcp-alloc // 取消[H3C]display dhcp //显示DHCP客户信息<H3C>debuggingdhcp-alloc //开启DHCP调试功能<H3C>undo debugging dhcp-alloc六、端口配置[H3C]interface Ethernet0/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]port link-typetrunk //设置链路的类型为trunk,可为access(缺省),trunk[H3C-Ethernet0/3]port trunk pvid vlan20 //设置20为该trunk 的缺省VLAN,默认为1(trunk线路两端的PVID必须一致) [H3C-Ethernet0/3]port access vlan20 //将当前access端口加入指定的VLAN[H3C-Ethernet0/3]port trunk permit vlanall //允许所有的VLAN通过当前的trunk端口,可多次使用该命令[H3C-Ethernet0/3]mdiauto //设置以太端口为自动监测,normal(缺省)为直通线,across为交叉线[H3C]link-aggregation Ethernet 0/1 toEthernet 0/4 //将1-4口加入汇聚组,1为主端口,两端需要同时配置,设置了端口镜像以及端口隔离的端口无法汇聚[H3C]undo link-aggregation Ethernet0/1 //删除该汇聚组[H3C]link-aggregation modeegress //配置端口汇聚模式为根据目的MAC地址进行负荷分担,可选为ingress,egress和both,缺省为both[H3C]monitor-port Ethernet0/2 //将该端口设置为镜像端口,必须先设置镜像端口,删除时必须先删除被镜像端口,而且它们不能同在一个端口,该端口不能在汇聚组中,设置新镜像端口时,新取代旧,被镜像不变[H3C]mirroring-port Ethernet 0/3 toEthernet 0/4 both //将端口3和4设置为被镜像端口,both为同时监控接收和发送的报文,inbound表示仅监控接收的报文,outbound表示仅监控发送的报文[H3C]display mirror[H3C]display interface Ethernet 0/3<H3C>resetcounters //清除所有端口的统计信息[H3C]display link-aggregation Ethernet0/3 //显示端口汇聚信息[H3C-Ethernet0/3]virtual-cable-test //诊断该端口的电路状况七、集群配置S2100只能作为成员交换机加入集群中,加入后系统名改为'集群名_成员编号.原系统名'的格式.即插即用功能通过两个功能实现: 集群管理协议MAC组播地址协商和管理VLAN协商[H3C]cluster enable //启用群集功能,缺省为启用[H3C]cluster //进入群集视图[H3C-cluster]administrator-address H-H-Hname switch H-H-H为命令交换机的MAC,加入switch集群[switch_1.H3C-cluster]undoadministrator-address //退出集群[H3C]displaycluster //显示集群信息[H3C]management-vlan2 //集群报文只能在管理VLAN中转发,同一集群需在同一个管理VLAN中,需在建立集群之前指定管理VLAN八、QOS优先级配置QoS配置步骤:设置端口的优先级,设置交换机信任报文的优先级方式,队列调度,端口限速[H3C-Ethernet0/3]priority7 //设置端口优先级为7,默认为0[H3C]priority-trustcos //设置交换机信任报文的优先级方式为cos(802.1p优先级,缺省值),还可以设为dscp方式(dscp优先级方式) [H3C]queue-scheduler hq-wrr 2 4 68 //设置队列调度算法为HQ-WRR(默认为WRR),权重为2,4,6,8[H3C-Ethernet0/3]line-rate inbound29 //将端口进口速率限制为2Mbps,取1-28时,速率为rate*8*1024/125,即64,128,192...1.792M;29-127时,速率为(rate-27)*1024,即2M,3M,4M...100M,千兆时可继续往下取,128-240时,速率为(rate-115)*8*1024,即104M,112M,120M...1000M[H3C]displayqueue-scheduler //显示队列调度模式及参数[H3C]displaypriority-trust //显示优先级信任模式九、系统管理[H3C]mac-address blackhole H-H-H vlan1 //在VLAN1中添加黑洞MAC[H3C]mac-address static H-H-H interfaceEthernet 0/1 vlan 1 //在VLAN1中添加端口一的一个mac[H3C]mac-address timer aging500 //设置MAC地址表的老化时间为500s[H3C]display mac-address[H3C]display arp[H3C]mac-address port-binding H-H-Hinterface Ethernet 0/1 vlan 1 配置端口邦定[H3C]display mac-address port-binding[H3C]display saved-configuration[H3C]display current-configuration<H3C>save[H3C]restoredefault //恢复交换机出厂默认配置,恢复后需重启才能生效[H3C]display version<H3C>reboot[H3C]display device[H3C]sysname bigheap[H3C]info-centerenable //启用系统日志功能,缺省情况下启用[H3C]info-center loghost ip192.168.0.3 //向指定日志主机(只能为UNIX或LINUX,不能为Windows)输出信息,需先开启日志功能,缺省关闭[H3C]info-center loghost level8 //设置系统日志级别为8,默认为5.级别说明:1.emergencies 2.alerts 3.critical4.errors 5.warnings 6.notifications rmational 8.debugging<H3C>terminaldebugging //启用控制台对调试信息的显示,缺省控制台为禁用<H3C>terminallogging //启用控制台对日志信息的显示,缺省控制台为启用<H3C>terminaltrapping //启用控制台对告警信息的显示,缺省控制台为启用[H3C]displayinfo-center //显示系统日志的配置和缓冲区记录的信息[H3C]displaylogbuffer //显示日志缓冲区最近记录的指定数目的日志信息[H3C]displaytrapbuffer //显示告警缓冲区最近记录的指定数目的日志信息<H3C>resetlogbuffer //清除日志缓冲区的信息<H3C>resettrapbuffer //清除告警缓冲区的信息十、网络协议配置NDP即是邻居发现协议,S1550E只能开启或关闭NDP,无法配置,默认有效保留时间为180s,NDP报文发送的间隔60s[H3C]ndp enable //缺省情况下是开启的[H3C-Ethernet0/3]ndpenable //缺省情况下开启[H3C]display ndp //显示NDP配置信息[H3C]display ndp interface Ethernet0/1 //显示指定端口NDP 发现的邻居信息<H3C>debugging ndp interface Ethernet0/1// HABP协议即HuaweiAuthentication Bypass Protocol,华为鉴权旁路协议,是用来解决当交换机上同时配置了802.1x和HGMPv1/v2时,未经授权和认证的端口上将过滤HGMP报文,从而使管理设备无法管理下挂的交换机的问题。

交换机常用命令汇总

交换机常用命令汇总

交换机常用命令汇总华为1、查看交换机当前配置displaycur2、从特权模式进入全局模式(配置模式)sys3、修改交换机名称sysname4、创建Vlan10(创建后自动进入vlan)vlan10quit〃退出vlan5、给VIan配置IP地址interfaceVlanif10ipaddress192.168.30.12 55.255.255.0dhcpselectglobaldhcpenableundodhcenable〃关闭DHCP6、将端口3加入VIanlO进入端口3:interfaceGigabitEthernet0/0/3portlink-typeaccessportdefaultvlan107、配置IP地址池ippool10gateway-list192.168.10.1network192.168.10.1mask255.255.255.0excluded-ip-address192.168.10.2192.168.10.99〃排除IP不参与DHCPexcluded-ip-address192.168.10.200192.168.254〃排除IP不参与DHCPdns-list2.2.2.25.5.5.5〃删除IP地址池:undoippool105、保存配置save6、查看Vlan网关dispipintbrief7、检查OSPF视图下的配置dispcurconfigospf8、查看IP所在端口disparp∣inip9、查看MaC地址所在交换机端口dispmac-add∣inmac地址10、查看交换机里面MaC地址信息dispmac-add Il s进入该端口interfacegigabitethernet0/0/112、disth进入端口后查看端口配置13、nslook-up查看网页地址14、displayiprouting-table显示路由表信息15、显示VLANdiSPlayVlan17、删除Vlan20UndOVlan20清除告警clearalamindexno-trap24、重启交换机reboot 18、 查看全部报警displayalamall 20、开启端口undoshutdown 21、删除undo 22、关闭shutdown 23、退出当前模式返回上一级quit19、25、调试信息显示terminalmonitor26、双电源查看displaypower27、显示cpu信息displaycpu28、查看子卡运行状态displaydevice29、查看设备复位情况displayreboot-info30、查看设备温度displaytemperatureall32、查看内存占用情况displaymemory-usage。

常见交换机配置命令

常见交换机配置命令

交换机常用命令及配置(cisco)switch> 用户模式1.进入特权模式enableswitch> enableswitch#2.进入Setup模式setupswitch> enableswitch#setup3.进入全局配置模式configure terminalswitch> enableswitch#configure terminalswitch(conf)#4.交换机命名hostname (以switch01 为例)switch> enableswitch#configure terminalswitch(conf)#hostname switch01switch01(conf)#5.配置密文密码enable secret (以123 为例)switch> enableswitch#configure terminalswitch(conf)# enable secret1236.配置明文密码enable password (以456 为例)switch> enableswitch#configure terminalswitch (conf)# enable password45611.设置虚拟端口的IP地址、网关等(以vlan 1为例)switch> enableswitch#configure terminalswitch(conf)# interface vlan 1switch(conf-if)# ip address192.168.1.254 255.255.255.0//配置交换机端口ip 和子网掩码switch (conf-if)#no shutdown //激活端口switch (conf-if)#exit //退出到上层配置模式switch (conf)#ip default-gateway192.168.1.254 //设置网关地址为什么要设置虚拟端口?虽然PC和交换机都可以配IP地址,但PC上的IP地址是绑定到以太网接口,交换机上的IP地址是绑定到VLAN。

交换机路由器常用命令

交换机路由器常用命令

交换机路由器常用命令交换机和路由器是网络中非常重要的设备,熟练掌握它们的常用命令对于网络管理和故障排除至关重要。

下面为您介绍一些交换机和路由器常用的命令。

一、交换机常用命令1、`enable` 命令这个命令用于进入特权模式。

在特权模式下,可以执行更多高级的配置和管理操作。

2、`configure terminal` 命令输入此命令后,可以进入全局配置模式,对交换机的整体参数进行设置。

3、`interface` 命令通过`interface` 加上接口类型和编号,例如`interface ethernet0/1` ,可以进入特定接口的配置模式,对该接口的参数进行详细配置。

4、`vlan` 命令`vlan` 相关的命令用于创建、删除和配置 VLAN(虚拟局域网)。

比如`vlan 10` 创建 VLAN 10 ,`name VLAN10` 为 VLAN 10 命名。

5、`show vlan` 命令用于查看交换机上已创建的VLAN 信息,包括VLAN 编号、名称、端口成员等。

6、`show interfaces` 命令此命令可以查看交换机各个接口的状态、速率、双工模式等详细信息。

7、`port trunk allowpass vlan` 命令在配置 trunk 链路时,使用该命令允许特定的 VLAN 通过 trunk 链路。

8、`spanningtree` 命令用于配置生成树协议,防止网络环路。

例如`spanningtree moderstp` 可以设置生成树的模式为快速生成树。

二、路由器常用命令1、`enable` 命令同样用于进入特权模式。

2、`configure terminal` 命令进入全局配置模式。

3、`interface` 命令例如`interface fastethernet 0/0` ,进入特定的接口配置模式。

4、`ip address` 命令为接口配置 IP 地址,如`ip address 19216811 2552552550` 。

H3C交换机基本配置命令明细一览

H3C交换机基本配置命令明细一览

H3C交换机基本配置命令明细⼀览1:配置登录⽤户,⼝令等<H3C> //⽤户直⾏模式提⽰符,⽤户视图<H3C>system-view //进⼊配置视图[H3C] //配置视图(配置密码后必须输⼊密码才可进⼊配置视图)[H3C] sysname xxx //设置主机名成为xxx这⾥使⽤修改特权⽤户密码<H3C>system-view[H3C]super password level 3 cipher/simple xxxxx //设置本地登录交换机命令[H3C] aaa //进⼊aaa认证模式定义⽤户账户[H3C-aaa] local-user duowan password cipher duowan[H3C-aaa] local-user duowan level 15[H3C-aaa] local-user duowan service-type telnet terminal ssh //有时候这个命令是最先可以运 //⾏的,上边两个命令像password,level都是定义完vty 的 // authentication-mode aaa后才出现[H3C-aaa] quit[H3C] user-interface vty 0 4 //当时很奇怪这个命令就是找不到,最后尝试了⼏次才能运⾏[H3C-ui-vty0-4] authentication-mode aaa[H3C-ui-vty0-4] quit单独设置远程登录账户:<H3C>system-view[H3C]user-interface vty 0 4[H3C-ui-vty0-4]authentication-mode password //设置登录模式[H3C-ui-vty0-4]user privilege level 3 //管理权限配置,3为管理级权限[H3C-ui-vty0-4]set authentication password cipher 123456 //设置登录密码以密⽂⽅式登录[H3C-ui-vty0-4]quit[H3C]2:H3C VLan设置创建vlan:<H3C> //⽤户直⾏模式提⽰符,⽤户视图<H3C>system-view //进⼊配置视图[H3C] vlan 10 //创建vlan 10,并进⼊vlan10配置视图,如果vlan10存在就直接进⼊vlan10配置视图[H3C-vlan10] quit //回到配置视图[H3C] vlan 100 //创建vlan 100,并进⼊vlan100配置视图,如果vlan10存在就直接进⼊vlan100配置视图[H3C-vlan100] quit //回到配置视图将端⼝加⼊到vlan中:[H3C] interface GigabitEthernet2/0/1 (10G光⼝)[H3C- GigabitEthernet2/0/1] port link-type access //定义端⼝传输模式[H3C- GigabitEthernet2/0/1] port default vlan 100 //将端⼝加⼊vlan100[H3C- GigabitEthernet2/0/1] quit[H3C] interface GigabitEthernet1/0/0 //进⼊1号插槽上的第⼀个千兆⽹⼝配置视图中。

锐捷交换机命令大全

锐捷交换机命令大全

【第一部分】交换机支持的命令: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、连接交换机,写下连接的命令;telnet 192.168.2.102 10203 连接网络机房1中的第二个机柜堆叠中第三台交换机的连接命令2、对交换机进行初始化配置,写出配置项目的命令;switch>enable //从一般模式切换到特权模式switch#conf t //从特权模式切换到全局配置模式switch<config># hostname sw2960 //配置交换机的名称为sw2960sw2960<config># interface vlan 1 //进入管理vlan 1sw2960<config-If-vlan1># ip address 192.168.5.20 255.255.255.0 //配置管理vlan 1 ip地址为192.168.5.20 子网掩码为255.255.255.0删除管理vlan 1的IP地址命令为:sw2960<config># interface vlan 1sw2960<config-If-vlan1>#no ip addresssw2960<config-If-vlan1># no shutdown //保存并运行此配置sw2960<config-If-vlan1># 按键盘上的ctrl+z //返回到一般模式sw2960#wr //保存设置sw2960# clock set 09:43:50 2010.09.18 //配置交换机时间命令sw2960# conf t //从一般模式进入到特权模式sw2960<config># enable password //进入设置特权用户密码current password //没有设置任何口令按回车进入密码设置new password 110 //配置密码为110confirm new password 110 // 确认密码110sw2960<config>#interface ethernet 1-24 //进入端口1-24配置sw2960<config-port-range># speed-duplex //配置端口速率和双控模式ctrl+z 返回一般配置模式sw2960#wr //保存设置3 配置交换机带内管理web连接和远程telnet的配置命令;根据第二题操作带内管理web连接sw2960<config>#ip http server 启动交换机web服务sw2960<config>#web-user admin password 0 admin //设置交换机的授权Http用户sw12960#wr //保存设置关闭带内管理web连接命令为:no ip http server在dos命令下输入telnet 192.168.5.20 将连接到交换机远程telnet配置sw2960<config>#telnet-server enable //开启交换机telnet服务器sw2960<config>#telnet-user zjg password 0 110 //为交换机设置授权telnet用户sw2960<config>#exit //退出全局配置模式sw2960#wr //保存设置关闭交换机telnet服务命令如下:sw2960<config>#no telnet-server enable在dos命令下输入http:\\192.168.5.20 进入telnet管理交换机接口4 保存配置,记录下flash中的文件名及文件大小。

锐捷交换机命令大全

锐捷交换机命令大全

【第一部分】交换机支持的命令:1.交换机基本状态:s w i t c h:;R O M状态,路由器是r o m m o n> h o s t n a m e>;用户模式h o s t n a m e#;特权模式h o s t n a m e(c o n f i g)#;全局配置模式h o s t n a m e(c o n f i g-i f)#;接口状态2.交换机口令设置:s w i t c h>e n a b l e;进入特权模式s w i t c h#c o n f i g t e r m i n a l;进入全局配置模式s w i t c h(c o n f i g)#h o s t n a m e;设置交换机的主机名s w i t c h(c o n f i g)#e n a b l e s e c r e t x x x;设置特权加密口令s w i t c h(c o n f i g)#e n a b l e p a s s w o r d x x a;设置特权非密口令s w i t c h(c o n f i g)#l i n e c o n s o l e0;进入控制台口s w i t c h(c o n f i g-l i n e)#l i n e v t y04;进入虚拟终端s w i t c h(c o n f i g-l i n e)#l o g i n;允许登录s w i t c h(c o n f i g-l i n e)#p a s s w o r d x x;设置登录口令x x s w i t c h#e x i t;返回命令3.交换机V L A N设置:s w i t c h#v l a n d a t a b a s e;进入V L A N设置s w i t c h(v l a n)#v l a n2;建V L A N 2 s w i t c h(v l a n)#n o v l a n2;删v l a n 2 s w i t c h(c o n f i g)#i n t f0/1;进入端口 1 s w i t c h(c o n f i g-i f)#s w i t c h p o r t a c c e s s v l a n2;当前端口加入v l a n2 s w i t c h(c o n f i g-i f)#s w i t c h p o r t m o d e t r u n k;设置为干线s w i t c h(c o n f i g-i f)#s w i t c h p o r t t r u n k a l l o w e d v l a n1,2;设置允许的v l a n s w i t c h(c o n f i g-i f)#s w i t c h p o r t t r u n k e n c a p d o t1q;设置v l a n中继s w i t c h(c o n f i g)#v t p d o m a i n;设置发v t p域名s w i t c h(c o n f i g)#v t p p a s s w o r d;设置发v t p密码s w i t c h(c o n f i g)#v t p m o d e s e r v e r;设置发v t p模式s w i t c h(c o n f i g)#v t p m o d e c l i e n t;设置发v t p模式4.交换机设置I P地址:s w i t c h(c o n f i g)#i n t e r f a c e v l a n1;进入v l a n 1 s w i t c h(c o n f i g-i f)#i p a d d r e s s;设置I P地址s w i t c h(c o n f i g)#i p d e f a u l t-g a t e w a y;设置默认网关s w i t c h#d i r f l a s h:;查看闪存5.交换机显示命令:s w i t c h#w r i t e;保存配置信息s w i t c h#s h o w v t p;查看v t p配置信息s w i t c h#s h o w r u n;查看当前配置信息s w i t c h#s h o w v l a n;查看v l a n配置信息s w i t c h#s h o w i n t e r f a c e;查看端口信息s w i t c h#s h o w i n t f0/0;查看指定端口信息【第二部分】路由器支持的命令:1.路由器显示命令:router#showrun;显示配置信息router#showinterface;显示接口信息router#showiproute;显示路由信息router#showcdpnei;显示邻居信息router#reload;重新起动2.路由器口令设置:router>enable;进入特权模式router#configterminal;进入全局配置模式router(config)#hostname;设置交换机的主机名router(config)#enablesecretxxx;设置特权加密口令router(config)#enablepasswordxxb;设置特权非密口令router(config)#lineconsole0;进入控制台口router(config-line)#linevty04;进入虚拟终端router(config-line)#login;要求口令验证router(config-line)#passwordxx;设置登录口令xxrouter(config)#(Ctrl+z);返回特权模式router#exit;返回命令3.路由器配置:router(config)#ints0/0;进入Serail接口router(config-if)#noshutdown;激活当前接口router(config-if)#clockrate64000;设置同步时钟router(config-if)#ipaddress;设置IP地址router(config-if)#ipaddresssecond;设置第二个IProuter(config-if)#intf0/0.1;进入子接口router(config-subif.1)#ipaddress;设置子接口IProuter(config-subif.1)#encapsulationdot1q;绑定vlan中继协议router(config)#config-register0x2142;跳过配置文件router(config)#config-register0x2102;正常使用配置文件router#reload;重新引导4.路由器文件操作:router#copyrunning-configstartup-config;保存配置router#copyrunning-configtftp;保存配置到tftprouter#copystartup-configtftp;开机配置存到tftprouter#copytftpflash:;下传文件到flashrouter#copytftpstartup-config;下载配置文件ROM状态:Ctrl+Break;进入ROM监控状态rommon>confreg0x2142;跳过配置文件rommon>confreg0x2102;恢复配置文件rommon>reset;重新引导rommon>copyxmodem:flash:;从console传输文件;设置路由器IP;设置路由器掩码rommon>T;指定TFTP服务器IPrommon>TFTP_FILE=c2600.bin;指定下载的文件rommon>tftpdnld;从tftp下载rommon>dirflash:;查看闪存内容rommon>boot;引导IOS5.静态路由:iproute;命令格式;静态路由举例;默认路由举例6.动态路由:router(config)#iprouting;启动路由转发router(config)#routerrip;启动RIP路由协议。

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

1、Switch> 用户模式
2、Switch>enable 进入特权模式
Switch#
3、Switch#config terminal 进入全局模式
Switch(config)#
4、Switch(config)#interface f0/1 进入接口模式
Switch(config-if)#
5、Switch(config)#line console 0 进入line模式
Switch(config-line)#
exit 退回上层
end 结束所有操作
6、Switch(config)#hostname aaa 配置主机名
7、switch#show running-config 查看配置情况
8、Switch(config)#enable password 111 设置使能密码(明文)
9、Switch(config)#enable secret 111 设置使能密码(密文)
Switch(config)#line console 0 设置console密码
Switch(config-line)#password 333
Switch(config-line)#login
10、Switch(config)#interface vlan1
Switch(config-if)#ip address 192.168.1.1 255.255.255.0 设置IP地址Switch(config-if)#no shutdown
11、Switch(config)#ip default-gateway 192.168.1.10 设置网关
12、Switch#show mac-address-table 查看MAC地址表
13、Switch#show cdp cdp全局配置信息
14、Switch#show cdp interface f0/1 cdp接口配置信息
15、Switch#show cdp traffic cdp包的配置信息
16、Switch#show cdp neighbors cdp邻居基本信息
17、Switch#show cdp neighbors detail cdp邻居详细信息
Switch#show cdp neighbors entry
18、Switch#copy running-config startup-config
Switch#write 保存交换机配置信息
19、Switch#erase startup-config 恢复出厂信息
Switch#reload 重新加载
20、交换机密码恢复
*断开电源
*按住MODE键,加电(等待数秒)
*switch:出现此符号
*switch:flash_init 初始化flash
*switch:dir flash: (查看文件,可省去)
*switch:rename config.text config.old 改名
*switch:boot 重启
*switch>enable 进入特权
*switch#dir flash: (查看文件,可省去)
*switch#rename config.old config.text改名
*switch#copy flash:config.text running-config 复制到系统内
*switch#confit terminal 进入全局模式
*switch(config)#enable password 222 设置新密码
21、switch#show vlan-sw brief 查看vlan
22、switch#vlan database 进入vlan模式
switch(vlan)#vlan 20 name bbb 创建vlan并命名
23、switch(vlan)#no vlan 20 删除vlan
24、添加端口到vlan(单个)
switch(config)#interface f0/1 进入接口模式
switch(config-if)#switchport access vlan 10 添加至vlan10
switch(config-if)#end 退出
switch#show vlan brief (id) 验证vlan
switch(config)#show running-config interface f0/1(查看某接口)25、添加端口到vlan(批量)
switch(config)#interface range f0/1 - 5
switch(config-if-range)#switchport access vlan 10
26、switch(config)#interface f0/1 进入接口
switch(config-if)#switchport mode trunk 设置为trunk(永久)
switch(config-if)#switchport mode dynamic desirable/auto(其它trunk)
switch(config-if)#switchport trunk allowed vlan remove 10 移除vlan10) switch(config-if)#switchport trunk allowed vlan add 20 添加vlan20 27、switch#show interface f0/1 switchport 查看接口模式
show ip interface brief。

相关文档
最新文档