思科、华为等四大厂商的交换机基础配置命令全收录** 01**思科交换机基本配置命令01 进入特权模式enableswitch>enableswitch#02 进入全局配置模式configure terminalswitch>enableswitch#configure terminalswitch(conf)#03 交换机命名hostname aptech2950以aptech2950为例switch>enableswitch#configure terminalswitch(conf)#hostname aptch-2950aptech2950(conf)#04 配置使能口令enable password cisco以cisco为例switch>enableswitch # c onfigure terminalswitch(conf)#hostname aptch2950aptech2950(conf)# enable password cisco05 配置使能密码enable secret ciscolab以cicsolab为例switch>enableswitch # c onfigure terminalswitch(conf)#hostname aptch2950aptech2950(conf)# enble secret ciscolab06 创建多个VLANswitch>enable (进入特权模式)switch#vlan data (进入VLAN配置模式)switch(vlan)#vlan 10 name IT (划分VLAN 10,名称为IT)switch(vlan)#vlan 20 name HR (划分VLAN20,名称为HR)switch(vlan)#vlan 30 name FIN (划分VLAN30,名称为FIN)switch(vlan)#vlan 40 name LOG (划分VLAN40,名称为LOG)switch(vlan)#exit07 设置VLAN 1switch>enableswitch # configure terminalswitch(conf)#hostname aptch2950aptech2950(conf)# interface vlan 1aptech2950(conf-if)#ip address 192.168.1.1 255.255.255.0配置交换机端口IP和子网掩码aptech2950(conf-if)#no shutaptech2950(conf-if)#exitaptech2950(conf)#ip default-gateway 192.168.254 设置网关地址08 进入交换机某一个端口interface fastehernet 0/17以17为例switch>enableswitch # configure terminalswitch(conf)#hostname aptch2950aptech2950(conf)# interface fastehernet 0/17aptech2950(conf-if)#09 查看命令showswitch>enableswitch# show version查看系统中的所有版本信息show interface vlan 1查看交换机有关IP协议的配置信息show running-configure查看交换机当前起作用的配置信息show interface fastethernet 0/1查看交换机1接口具体配置和统计信息show mac-address-table查看MAC地址表show mac-address-table aging-time查看MAC地址表自动老化时间10 交换机恢复出厂默认命令switch>enableswitch # erase startup-configureswitch # reload11 双工模式设置switch> enableswitch # c onfigure terminalswitch2950(conf)#hostname aptch-2950aptech2950(conf)# interface fastehernet 0/17aptech2950(conf-if)#duplex full/half/auto有 full、half、auto三个选项12 cdp相关命令switch> enableswitch# show cdp 查看设备的cdp全局配置信息show cdp interface fastethernet 0/17show cdp traffic 查看有关cdp包的统计信息show cdp nerghbors 列出与设备相连的cisco设备13 交换机telnet远程登录设置switch>enableswitch # configure terminalswitch(conf)#hostname aptech-2950aptech2950(conf)#enable password ciscoaptech2950(conf)#interface fastethernet 0/1aptech2950(conf-if)#ip address 192.168.1.1 255.255.255.0aptech2950(conf-it)#no shutaptech2950(conf-if)#exitaptech2950(conf)line vty 0 4 设置0-4个用户可以telnet远程登录aptech2950(conf-line)#password edge 以edge为远程登录的用户密码主机设置:IP 192.168.1.2 主机的IP必须和交换机端口的地址在同一个网络段metmask 255.255.255.0gate-way 192.168.1.1 网关地址是交换机端口地址运行:telent 192.168.1.1进入telnet远程登录界面password:edgeaptech2950>enpassword:ciscoaptech#0**2**华为交换机基础配置命令01 常用命令视图02 创建VLAN //用户视图,一般display命令查看信息比较多。
system-view //准备进入系统视图[Huawei]vlan 100 //创建vlan 100[Huawei-vlan100]quit //退回系统视图03 将端口加入到vlan中[Huawei] interface GigabitEthernet2/0/1 //(10G光口) [Huawei- GigabitEthernet2/0/1] port link-type access //定义端口传输模式 [Huawei- GigabitEthernet2/0/1] port default vlan 100 //将端口加入vlan100 [Huawei- GigabitEthernet2/0/1] quit //回到接口视图 [Huawei] interface GigabitEthernet1/0/0 //进入1号插槽上的第一个千兆网口接口视图中0代表1号口 [Huawei- GigabitEthernet1/0/0] port link-type access //定义端口传输模式 [Huawei- GigabitEthernet2/0/1] port default vlan 10 //将这个端口加入到vlan10中 [Huawei- GigabitEthernet2/0/1] quit 04 将多个端口加入到VLAN中system-view [Huawei]vlan 10 [Huawei-vlan10]port GigabitEthernet 1/0/0 to 1/0/29 //将0到29号口加入到vlan10中 [Huawei-vlan10]quit05 交换机配置IP地址[Huawei] interface Vlanif100 // 进入vlan100接口视图与vlan 100命令进入的地方不同 [Huawei-Vlanif100] ip address 192.168.1.1 255.255.255.0 // 定义vlan100管理IP三层 交换网关路由 [Huawei-Vlanif100] quit //返回视图06 配置默认网关[Huawei]ip route-static 0.0.0.0 0.0.0.0 192.168.1.254 //配置默认网关。
07 交换机保存设置和重置命令save //保存配置信息 reset saved-configuration //重置交换机的配置 reboot //重新启动交换机08 交换机常用的显示命令用户视图模式下:>display current-configuration //显示现在交换机正在运行的配置明细 >display device //显示各设备状态 >display interface xxx //显示个端口状态,用?可以查看后边跟的选项 >display version //查看交换机固件版本信息 >display vlan xxx // 查看vlan的配置信息0**3**H3C交换机的基本配置01 基本配置 //用户直行模式提示符,用户视图 system-view //进入系统视图 [H3C] sysname xxx //设置主机名成为xxx这里使用修改特权用户密码02 用户配置system-view[H3C]super password H3C //设置用户分级密码[H3C]undo superpassword //删除用户分级密码[H3C]localuser bigheap 1234561 //Web网管用户设置,1为管理级用户[H3C]undo localuser bigheap //删除Web网管用户[H3C]user-interface aux 0 //只支持0[H3C-Aux]idle-timeout 250 //设置超时为2分50秒,若为0则表示不超时,默认为5分钟[H3C-Aux]undoidle-timeout //恢复默认值[H3C]user-interface vty 0 //只支持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 authentication password //取消密码[H3C]displayusers //显示用户[H3C]displayuser-interface //用户界面状态03 vlan配置[H3C]vlan 2 /。