交换机命令大全

合集下载

交换机口令大全

交换机口令大全

3. 使能口令:Switch(config)#enable Password 密码
4. 加密保存的使能口令:Switch(config)#enable secret 密码
5. 配置IP地址:
Switch(config)#interface vlan 1
Switch(config-if)#ip address IP地址 网关
switch:
(4)再switch:后执行flash_init命令。
(5)查看Flash中的文件。
(6)把config.text文件改名为config.old文件。
(7)执行boot命令,启动交换机。
(8)进入特权模式查看flash里的文件。
(9)把文件config.old改为config.text文件。
一、模式命令:
1. 用户模式:Switch>
2. 特权模式:Switch>enable
Switch#
3. 全局配置模式:Switch#config terminal
Switch(config)#
4. 接口配置模式:Switch(config)#interface fastethernet0/1
3. 在vlan中添加端口:
Switch#config terminal
Switch(config)#interface f0/1(端口)
Switch(config-if)#Switchport mode access
Switch(config-if)#switchport access vlan 2
Switch(config-if)#end
一次将多个端口添加到vlan中:

交换机配置命令大全

交换机配置命令大全

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

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

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

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………………应用策略表。

华为路由器交换机配置命令大全

华为路由器交换机配置命令大全

华为路由器交换机配置命令大全华为路由器交换机配置大全本文提供XXX路由器交换机的配置命令,包括计算机命令和交换机命令。

一、计算机命令以下是一些常用的计算机命令:shutdown-hnow;关机init 0;关机logout;用户注销login;用户登录ifconfig;显示IP地址ifconfig eth0 netmask;设置IP地址ifconfig eht0 netmask down;禁用IP地址route add 0.0.0.0 gw;设置网关route del 0.0.0.0 gw;删除网关route add default gw;设置网关route del default gw;删除网关route;显示网关ping;发ECHO包;远程登录二、XXX路由器交换机配置命令以下是一些常用的XXX路由器交换机配置命令:Quidway]dis cur;显示当前配置Quidway]display n;显示当前配置Quidway]display interfaces;显示接口信息Quidway]display vlan;显示vlan信息Quidway]display n;显示版本信息Quidway]super password;修改特权用户密码Quidway]sysname;交换机命名Quidway]XXX;进入接口视图Quidway]interface vlan x;进入接口视图Quidway-Vlan-interface x]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]rip;rip协议Quidway]local-user ftpQuidway]user-interface vty 0 4;进入虚拟终端S3026-ui-vty0-4]n-mode password;设置口令模式首先,这篇文章需要进行重新排版和编辑,以便更清晰地传达信息。

华为路由器交换机常用命令

华为路由器交换机常用命令

华为路由器交换机常用命令一、设备管理命令1.登录管理命令- ssh [ip地质] -p [端口号]:通过SSH协议登录设备。

- telnet [ip地质]:通过Telnet协议登录设备。

- logout:退出设备。

2.用户管理命令- display current-configuration:显示当前设备配置信息。

- save:保存当前配置。

- undo save:取消保存的配置。

- super:切换到超级用户模式。

- user-interface console 0:配置控制台终端的参数。

- user-interface vty 0 4:配置远程登录终端的参数。

3.设备操作命令- reboot:重启设备。

- reset saved-configuration:恢复出厂配置。

- display version:显示设备的硬件和软件版本信息。

- display device:显示设备的基本信息。

- display interface[接口名称]:显示指定接口信息。

- display ip routing-table:显示IP路由表信息。

二、网络配置命令1.IP配置命令- interface [接口名称]:进入指定接口。

- ip address [IP地质] [子网掩码]:配置接口IP地质。

- undo ip address:取消接口IP地质配置。

- ip route-static [目标网络] [子网掩码] [下一跳地质]:配置静态路由。

- undo ip route-static [目标网络] [子网掩码] [下一跳地质]:取消静态路由配置。

2.VLAN配置命令- vlan [VLAN ID]:创建指定VLAN。

- quit:退出VLAN配置模式。

- interface vlan [VLAN ID]:进入指定VLAN接口。

- ip address [IP地质] [子网掩码]:为VLAN接口配置IP地质。

[进阶阅读] 交换机&路由器命令大全(带中文注释)

[进阶阅读] 交换机&路由器命令大全(带中文注释)
router#show frame map ;显示映射
基本访问控制列表:
router(config)#access-list permit|deny
router(config)#interface ;default:deny any
router(config-if)#ip access-group in|out ;defaultut
router(config-router)#negihbor ;点对点帧中继用。
帧中继命令:
router(config)#frame-relay switching ;使能帧中继交换
router(config-s0)#encapsulation frame-relay ;使能帧中继
switch(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#exit ;返回命令
交换机VLAN设置:
switch#vlan database ;进入VLAN设置
switch(vlan)#vlan 2 ;建VLAN 2
switch(vlan)#no vlan 2 ;删vlan 2
switch(config)#int f0/1 ;进入端口1
router#reload ;重新引导
路由器文件操作:
router#copy running-config startup-config ;保存配置

(完整版)华为交换机命令大全

(完整版)华为交换机命令大全

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

交换机配置命令华为,思科,北电,迈普等配置命令各有不同,以下先以思科设备为例:
switch> 用户模式
1:进入特权模式 enable
switch> enable
switch#
2:进入全局配置模式 configure terminal
switch> enable
switch#configure terminal
switch(conf)#
3:交换机命名 hostname aptech2950 以aptech2950为例
switch> enable
switch#configure terminal
switch(conf)#hostname aptch-2950
aptech2950(conf)#
4:配置使能口令 enable password cisco 以cisco为例
switch> enable
switch#configure terminal
switch(conf)#hostname aptch2950
aptech2950(conf)# enable password cisco
5:配置使能密码 enable secret ciscolab 以cicsolab为例
switch> enable
switch#configure terminal
switch(conf)#hostname aptch2950
aptech2950(conf)# enable secret ciscolab
6:设置虚拟局域网vlan 1 interface vlan 1 和网关地址
switch> enable
switch#configure terminal
switch(conf)#hostname aptch2950
aptech2950(conf)# interface vlan 1
aptech2950(conf-if)#ip address 192.168.1.1 255.255.255.0 配置交换机端口ip和子网掩码
aptech2950(conf-if)#no shut 是配置处于运行中
aptech2950(conf-if)#exit
aptech2950(conf)#ip default-gateway 192.168.254 设置网关地址
7:进入交换机某一端口 interface fastehernet 0/17 以17端口为例
switch> enable
switch#configure terminal
switch(conf)#hostname aptch2950
aptech2950(conf)# interface fastehernet 0/17
aptech2950(conf-if)#
8:查看命令 show
switch> enable
switch# 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地址表自动老化时间
9:交换机恢复出厂默认恢复命令
switch> enable
switch# erase startup-configure
switch# reload
10:双工模式设置
switch> enable
switch#configure terminal
switch2950(conf)#hostname aptch-2950
aptech2950(conf)# interface fastehernet 0/17 以17端口为例
aptech2950(conf-if)#duplex full/half/auto 有full , half, auto 三个可选项
11:cdp相关命令
switch> enable
switch# show cdp 查看设备的cdp全局配置信息
show cdp interface fastethernet 0/17 查看17端口的cdp配置信息show cdp traffic 查看有关cdp包的统计信息
show cdp nerghbors 列出与设备相连的cisco设备
12:csico2950的密码恢复
拔下交换机电源线。

用手按着交换机的MODE键,插上电源线
在switch:后执行flash_ini命令:switch: flash_ini
查看flash中的文件: switch: dir flash:
把“config.text”文件改名为“config.old”: switch: rename flash: config.text flash: config.old
执行boot: switch: boot
交换机进入是否进入配置的对话,执行no :
进入特权模式察看flash里的文件: show flash :
把“config.old”文件改名为“config.text”: switch: rename flash: config.old flash: config.text
把“config.text”拷入系统的“running-configure”: copy flash: config.text system : running-configure
把配置模式重新设置密码存盘,密码恢复成功。

13:交换机telnet远程登录设置:
switch>en
switch#configure terminal
switch(conf)#hostname aptech-2950
aptech2950(conf)#enable password cisco 以cisco为特权模式密码aptech2950(conf)#interface fastethernet 0/1 以17端口为telnet 远程登录端口
aptech2950(conf-if)#ip address 192.168.1.1 255.255.255.0
aptech2950(conf-if)#no shut
aptech2950(conf-if)#exit
aptech2950(conf)line vty 0 4 设置0-4 个用户可以telnet远程登陆
aptech2950(conf-line)#login
aptech2950(conf-line)#password edge 以edge为远程登录的用户密码
主机设置:
ip 192.168.1.2 主机的ip必须和交换机端口的地址在同一网络段
netmask 255.255.255.0
gate-way 192.168.1.1 网关地址是交换机端口地址
运行:
telnet 192.168.1.1
进入telnet远程登录界面
password : edge
aptech2950>en
password: cisco
aptech#
14:交换机配置的重新载入和保存
设置完成交换机的配置后:
aptech2950(conf)#reload
是否保存(y/n) y: 保存设置信息 n:不保存设置信息
15:保存
aptech2950(conf)#wr
另外:思科是没有中文格式的,华为和迈普有,以下以华为改成中文模式为例:
<Quidway> language-mode chinese
Change language mode, confirm? [Y/N]y
改变到中文模式
答案补充
华为交换机命令
<Quidway>system
Enter system view, return to user view with Ctrl+Z.
[Quidway]vlan 1 (建vlan1)
[Quidway-vlan1]inter vlan 1 (进入vlan1)
[Quidway-Vlan-interface1]ip address 192.168.1.1 255.255.255.0 (给vlan1加入地址即vlan1的网关)
[Quidway-Vlan-interface1]undo shut (打开vlan1)
[Quidway-Vlan-interface1]save (保存)
但是s2000是二层交换机,只能给一个VLAN配一个地址,其支持通过Console口的命令行配置,支持HGMP V2集群管理(作为成员交换机),但是不支持web。

相关文档
最新文档