1. 交换机的命令具体怎么使用
交换机的命令非常多,主要是用来配置交换机的,只有可网管的交换机(有console口的交换机)才能进行配置。
不同厂家、不同型号的交换机的配置命令也不大一样。
举个CISCO的命令例子吧:
hostname是给交换机命名的命令,如交换机本来的名字是Switch,使用(config)#hostname
JIAOHUANJI,就可以把交换机的名字改成JIAOHUANJI了。
交换机配置时还分很多种模式,每种模式下的配置命令也都有很大区别,具体的真不是三两句说得清的,你只有买些教材看看了。
2. 华三交换机配置命令
华三交换机配置命令如下:
<H3C>system-view
[H3C]super password H3C:设置用户分级密码
[H3C]undo super password:删除用户分级密码
[H3C]localuser bigheap 123456 1:Web网管用户设置,1(缺省)为管理级用户,缺admin,admin
[H3C]undo localuser bigheap:删除Web网管用户
[H3C]user-interface aux 0:只支持0
[H3C-Aux]idle-timeout 2 50:设置超时为2分50秒,若为0则表示不超时,默认为5分钟
[H3C-Aux]undo idle-timeout:恢复默认值
[H3C]user-interface vty 0:只支持0和1
[H3C-vty]idle-timeout 2 50:设置超时为2分50秒,若为0则表示不超时,默认为5分钟
[H3C-vty]undo idle-timeout:恢复默认值
[H3C-vty]set authentication password 123456:设置telnet密码,必须设置
[H3C-vty]undo set authentication password:取消密码
[H3C]display users:显示用户
[H3C]display user-interface:显示用户界面状态
(2)交换机基础命令扩展阅读:
H3C Switch命令:
一、模式命令:
1、用户模式:Switch>
2、特权模式:Switch>enable
Switch#
3、全局配置模式:Switch#config terminal
Switch(config)#
4、接口配置模式:Switch(config)#interface fastethernet0/1
Switch(config-if)#
5、Line模式:Switch(config)#line console 0
Switch(config-line)#
二、特权模式下的命令:
1、查看机MAC地址:Switch#show mac-address-table
2、发现(CDP):
Switch#show cdp
Switch#show cdp interface fastethernet0/1
Switch#show cdp neighbors
Switch#show cdp neighbors detail
Switch#show cdp entry
工作原理:
交换机工作于OSI参考模型的第二层,即数据链路层。交换机内部的CPU会在每个端口成功连接时,通过将MAC地址和端口对应,形成一张MAC表。
在今后的通讯中,发往该MAC地址的数据包将仅送往其对应的端口,而不是所有的端口。因此,交换机可用于划分数据链路层广播,即冲突域;但它不能划分网络层广播,即广播域。
参考资料:网络—交换机
参考资料:网络—交换机命令
3. 普通交换机常用配置命令是什么
第一个回答的那个就挺详细的,算是普通操作吧。基本上包括第一次进机的配置,密码配置,创建vlan,对特定端口设定访问vlan,基本的就这些了,其他的比如show命令,这个有很多选项的,show
running-config之类的查看工作状态和排错的也很多也重要。
4. 交换机的基本命令是什么
“Switch>”
5. 交换机全部命令和汉语翻译,高分送上!
交换机配置命令详解 1. 交换机支持的命令: 交换机基本状态: switch: ;ROM状态, 路由器是rommon hostname ;用户模式 hostname# ;特权模式 hostname(config)# ;全局配置模式 hostname(config-if)# ;接口状态 交换机口令设置: switchenable ;进入特权模式 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 ;设置登录口令xx 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 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(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模式 交换机设置IP地址: switch(config)#interface vlan 1 ;进入vlan 1 switch(config-if)#ip address ;设置IP地址 switch(config)#ip default-gateway ;设置默认网关 switch#dir flash: ;查看闪存 交换机显示命令: switch#write ;保存配置信息 switch#show vtp ;查看vtp配置信息 switch#show run ;查看当前配置信息 switch#show vlan ;查看vlan配置信息 switch#show interface ;查看端口信息 switch#show int f0/0 ;查看指定端口信息
6. 简述交换机的几种配置模式,以及进入的操作命令是什么
交换机的模式有普通用户模式、特权用户模式、全局配置模式、接口配置模式、vlan配置模式、恢复交换机的缺省配置等等。
1、普通用户模式
开机直接进入普通用户模式,在该模式下我们只能查询交换机的一些基础信息,如版本号(show version) 等,权限最低,只能使用少量的查看行政的命令。如需进入特权模式一般需要密码。。
2、特权用户模式
在普通用户模式下输入enable命令即可进入特权用户模式,在该模式下我们可以查看交换机的配置信息和调试信息等等,使用更多的查看性质的命令和做一些少量修改的路由器参数命令,进入全局配置模式不需要任何密码。
3、全局配置模式
在特权用户模式下输入c terminal命令即可进入全局配置模式,在该模式下主要完成全局参数的配置,不能使用查看性质的命令,在此模式下做大量的路由配置模式,可用在此基础上接口配置模式,线路配置模式,路由进程模式。
4、接口配置模式
在全局配置模式下输入interface interface-list 即可进入接口配置模式,在该模式下主要完成接口参数的配置。
5、vlan配置模式
在全局配置模式下输入vlan vlan-number即可进入vlan配置模式,在该配置模式下可以完成vlan的一些相关配置。
6、恢复交换机的缺省配置
为了不让实验受交换机以前的配置影响,常常需要先恢复交换机的缺省配置。在特权用户模式下顺序使用erase,restet命令即可恢复交换机的缺省配置。
(6)交换机基础命令扩展阅读:
交换机说明:
1、在实验环境中,如果配置两个vlan: vlan1, vlan2, 注意其中vlan1是交换机默认的vlan,既不能创建也不能删除,所有端口都属于vlan1,所以应该首先创建vlan2,然后为各个vlan分配端口(switchport interface-list)。
2、使用命令行进行配置的时候,在任何模式下均可以使用“?”来帮助我们完成配置。
使用“?”可以查询任何模式下可以使用的命令;或者某参数后面可以输入的参数;或者以某字母开始的命令。例如在全局配置模式下输入“?”或“show ?”或“s?”,可以看看它们分别有什么帮助信息显示。
如果你不能确认当前模块所在的插槽的编号,可以通过命令行中的show命令来查看插槽以及插槽.上的端口信息;也可以在路由器特权EXEC模式下执行show version命 令,在路由器版本信息中有每个模块所在插槽编号的信息。
7. 交换机的常用配置命令
a、更改远程TELNNET密码
Switch#configure terminal
Switch(config)#line vty 0 4
Switch(config-line)#password qycx123
Switch(config-line)#login
Switch(config-line)#exit
b、更改进入全局配置模式时的密码
Switch#configure terminal
Switch(config)#enable secret qycx123
思科交换机常用命令——创建并划分VLAN
a、创建VLAN
Switch#vlan database
Switch(vlan)#vlan 99 name office (创建vlan 99 并命名为office)
b、将端口划分至vlan
Switch(config)#interface fastEthernet 0/8
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 99 (将8号快速以太口划分至vlan 99)
思科交换机常用命令——调试命令
a、显示所有配置命令:Switch#show run
b、显示所有接口状态:Switch#show ip int brief
c、显示所有VLAN的信息:Switch#show vlan brief
cisco交换机还是比较常用的,于是我研究了一下Cisco交换机命令的大总结,在这里拿出来和大家分享一下,希望对大家有用。我所针对的都是Cisco的设备而言的,华为的可以跟据手册来查,配置都是差不多的,这里华子就不多写华为的设备了,了解的也不是很多。
Cisco交换机命令之使用Telnet远程式管理
switch(config)#interface vlan 1 进入vlan 1
switch(config-if)#ip address 设置IP地址
switch(config-if)#ip default-gateway 设置默认网关
switch(config)#line vty 0 4 进入虚拟终端
switch(config-line)#login 允许登录
switch(config-line)#password xx 设置登录口令
switch#exit 返回命令
Cisco交换机命令之控制台口令
switch(config)#line console 0 进入控制台口
switch(config-line)#login 允许登录
switch(config-line)#password xx 设置登录口令
switch#exit 返回命令
Cisco交换机命令之基本接口配置
switch(config)#interface f0/1 进入f0/1接口
switch(config-if)#plex full 配置全双工模式
switch(config-if)#speed 100 配置速率
switch(config-if)#description to ***** 接口描述
switch(config)#ip domain-name ***.com 设置或名服务器
switch(config)#mac-address-table aging-time 设置mac表超时时间
switch#write 保存配置信息
switch# running-config startup-config 保存当前配置nvram
switch#erase startup-config 清除配置文件
Cisco交换机命令之交换机VLAN设置:
switch#vlan database 进入VLAN设置
switch(vlan)#vlan 2 建VLAN 2
switch(vlan)#name 名字 建VLAN 2的名称
switch(vlan)#no vlan 2 删vlan 2
注:删除vlan时原属于此vlan的端口处于非激活状态,直到重新分配为止。
switch(config)#int f0/1 进入端口1
switch(config-if)#switchport mode access 当前端口工作莫试
switch(config-if)#switchport access vlan 2 当前端口加入vlan 2
switch(config-if)#switchport mode trunk 设置为干线
switch(config-if)#switchport trunk encapsulation dot1q 设置vlan 中继协议
switch(config-if)#no switchport mode 或 ( switchport mode access) 禁用干线
switch(config-if)#switchport trunk allowed vlan add 1,2 ; 从Trunk中添加vlans
switch(config-if)#switchport trunk allowed vlan remove 1,2 ;从Trunk中删除vlans
switch(config-if)#switchport trunk pruning vlan remove 1,2 ;从Trunk中关闭局部修剪
Cisco交换机命令之以太网通道配置
switch(config)#interface range fasternet0/1 - 2 将fasternet0/1和0/2 口捆绑
switch(config-if)#channel-group 1 mode on 配置以太通道模式
switch(config-if)#port-channel load-balance {dst-mac | src-mac}在链路间实现负载均衡
switch#show etherchannel 1 summary 查看通道信息
switch#show etherchannel load-balance 查看通道信息
Cisco交换机命令之vtp配置
switch(config)#vtp domain 设置vtp域名
switch(config)#vtp password 设置vtp密码
switch(config)#vtp mode server 设置vtp服务器模式
switch(config)#vtp mode client 设置vtp客户机模式
switch(config)#vtp mode transparent 设置vtp 透明模式
switch(config)#vtp version 设置vtp版本
switch(config)#vtp pruning 启用vtp修解
switch(config)#no vtp pruning 关闭vtp修解
注:要想从vtp中减少一台交换机只需将该交换机vtp 名更改
Cisco交换机命令之生成树stp:
switch(config)#spanning-tree vlan 启用stp生成树(基于vlan)
switch(config)#spanning-tree vlan root primary 指定根交换机(基于vlan)
switch(config)#spanning-tree vlan root secondary 指定备用根交换机(基于vlan)
switch(config)#spanning-tree vlan priority 指定交换机优先级(基于vlan)
switch(config)#no spanning-tree vlan priority 将交换机的优先级恢复默认值(基于vlan)
switch(config-if)#spanning-tree vlan cost 指定端口成本(起用trunk的端口模式下)
switch(config-if)#spanning-tree vlan port-prioty 指定交换机端口优先级(基于vlan)
switch(config-if)#spanning-tree portfast 配置速端口(连接终端设备的端口状态)如pc机
switch(config)#spanning-tree uplinkfast 配置上行速端口
switch(config)#spanning-tree vlan hello-time 配置交换机hello时间(基于vlan)
switch(config)#spanning-tree vlan forward-time 修改转发延迟计时器(基于vlan)
switch(config)#spanning-tree vlan max-time 修改最大老化时间(基于vlan)
switch#show spanning-tree summery 检测vlan生成树配置
switch#show spanning-tree vlan detail 浏览详细生成树配置信息
switch#show spanning-tree interface detail 浏览详细生成树端口配置信息
Cisco交换机命令之交换机显示命令:
switch#show vtp status 查看vtp配置信息
switch#show running-config 查看当前配置信息
switch#show vlan 查看vlan配置信息
switch#show interface 查看端口信息
switch#show int f0/0 查看指定端口信息
switch#dir flash: 查看闪存
switch#show version 查看当前版本信息
switch#show mac-address-table aging-time 查看mac超时时间
switch#show cdp cisco设备发现协议 (可以查看聆接设备)
switch#show cdp traffic 杳看接收和发送的cdp包统计信息
switch#show cdp neighbors 查看与该设备相邻的cisco设备
switch#show interface f0/1 switchport 查看有关switchport的配置
switch#show cdp neighbors 查看与该设备相邻的cisco设备
8. 交换机配置命令
1、交换机配置命令,英文名Switchboard Command,是一种计算机语言,用来控制交换机的语言。
9. ssh远程交换机基本命令
一、配置思路
配置ssh远程登陆,一般是有四个步骤:
1、首先选择Console方式登陆交换机
2、开启交换机的SSH服务功能并配置IP
3、生成加密密钥
4、配置SSH管理的登入口令
二、配置步骤(以锐捷交换机的配置为例)
一、配置思路
配置ssh远程登陆,一般是有四个步骤:
1、首先选择Console方式登陆交换机
2、开启交换机的SSH服务功能并配置IP
3、生成加密密钥
4、配置SSH管理的登入口令
二、配置步骤(以锐捷交换机的配置为例)
10. 交换机的基本命令
交换机的启动及基本配置
1924交换机上配置
sw1924_b#delete nvram
全部清除交换机的所有配置
sw1924_b#reload
重新启动交换机(初始提示符为> )
sw1924_b#hostname sw1924
设置交换机的主机名
sw1924_b#enable secret cisco
设置加密密码
sw1924_b#enable password level 1 cisco1
设置等级密码(1最低)
sw1924_b#enable password level 15 cisco15
设置等级密码(15最高)
sw1924_b#ip address 192.168.14.1 255.255.255.0
设置交换机的管理IP地址
sw1924_b#ip default-gateway 192.168.198.2
设置交换机的网关地址
sw1924_b#ip domain-name pctc.com.cn
设置交换机所连域的域名
sw1924_b#ip name-server 218.87.18.230
设置交换机所连域的域名服务器IP
sw1924_b#show ip
查看上述设置环境
sw1924_b#show version
查看交换机的版本等信息
sw1924_b#show running-config
查看交换机的当前运行配置等全部信息
sw1924_b#show int e0/1
查看交换机的第1个端口信息
1924交换机配置端口属性
sw1924_b#conf t
sw1924_b#interface ethernet 0/1
进入第1个端口
sw1924_b#description sw1924_b-e0/1-pc1
给端口写入注释信息
sw1924_b#plex auto/full/full-flow-control/half
设置端口的工作模式
sw1924_b#port secure
启用端口安全性
sw1924_b#port secure max-mac-count 1
设置该端口允许对应的MAC地址数(默认132个)
sw1924_b#sh mac-address-table security
查看端口安全性
sw1912_a#conf t
进入全局配置模式
sw1912_a#interface fastethernet 0/1
进入第1个端口
sw1912_a#description sw2912_a-f0/1-pc1
给端口写入注释信息
sw1912_a#plex auto/full/half
设置端口的工作模式
sw1912_a#port security
启用端口安全性
sw1912_a#port security max-mac-count 1
设置该端口允许对应的MAC地址数(默认132个)
sw1912_a#end
返回特权模式
sw1912_a#sh port security
查看端口安全性
配置和查看MAC地址表
1924交换机配置MAC地址表
sw1924_b#mac-address-table aging-time 600
设置动态地址超时时间
sw1924_b#mac-address-table permanent 0000.0cdd.5a4d e0/3
定义永久MAC地址(绑定MAC地址)
sw1924_b#mac-address-table restricted static 0000.0cdd.aaed e0/6 e0/7
定义受限MAC地址
sw1924_b#address-violation disable/ignore/suspend
定义地址安全违规
sw1924_b#show mac-address-table
查看上述配置
sw1924_b#clear mac-addr restric static
清除受限MAC地址表项
2912交换机配置MAC地址表
sw2912_a#mac-address-table aging-time 700
设置动态地址超时时间
sw2912_a#mac-address-table static 0000.0cdd.5a4d e0/3
定义永久MAC地址(绑定MAC地址)
sw2912_a#mac-address-table secure 00d0.f80d.3333 f0/3 vlan 1
定义受限MAC地址
sw2912_a#port security action shutdown/trap
定义地址安全违规
sw2912_a#show port security
查看上述配置
配置VTP、VLAN、VLAN Trunk和STP
配置VTP
sw1924_a#conf t
sw1924_a#vtp server
定义VTP的工作模式
sw1924_a#vtp domain cisco
定义VTP的域名
sw1924_a#trunk on
启用干道
sw1924_b#vtp domain cisco
加入VTP域
sw1924_b#vtp client
定义VTP的工作模式
sw1924_b#trunk on
启用干道
sw1924_a#show trunk b
sw1924_a#show trunk b allowed-vlans
查看干道信息
配置VLAN
sw1924_a#vlan 10 dept1
sw1924_a#vlan 20 dept2
sw1924_a#vlan 30 dept3
sw1924_a#vlan 40 dept4
定义所需VLAN
sw1924_a#show vlan
查看VLAN信息
sw1924_b#show vlan
sw1924_b#show vtp
查看VTP的信息
sw1924_b#int e0/1
sw1924_b#vlan-membership static 10
sw1924_b#int e0/2
sw1924_b#vlan-membership static 20
sw1924_b#int e0/3
sw1924_b#vlan-membership static 30
sw1924_b#int e0/4
sw1924_b#vlan-membership static 40
把接口划入各自VLAN
配置spanning tree
sw1924_b#spantree 1
启用生成树协议
sw1924_b#sh spantree 1
查看生成树信息
sw1924_b#no spantree 1
关闭生成树协议
sw1924_b#sh spantree 1
查看生成树信息