⑴ 华三交换机配置命令
华三交换机配置命令如下:
<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:显示用户界面状态
(1)交换机命令详解扩展阅读:
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地址的数据包将仅送往其对应的端口,而不是所有的端口。因此,交换机可用于划分数据链路层广播,即冲突域;但它不能划分网络层广播,即广播域。
参考资料:网络—交换机
参考资料:网络—交换机命令
⑵ 交换机的基本命令是什么
“Switch>”
⑶ 交换机配置命令
1、交换机配置命令,英文名Switchboard Command,是一种计算机语言,用来控制交换机的语言。
⑷ 交换机的命令具体怎么使用
交换机的命令非常多,主要是用来配置交换机的,只有可网管的交换机(有console口的交换机)才能进行配置。
不同厂家、不同型号的交换机的配置命令也不大一样。
举个CISCO的命令例子吧:
hostname是给交换机命名的命令,如交换机本来的名字是Switch,使用(config)#hostname
JIAOHUANJI,就可以把交换机的名字改成JIAOHUANJI了。
交换机配置时还分很多种模式,每种模式下的配置命令也都有很大区别,具体的真不是三两句说得清的,你只有买些教材看看了。
⑸ 交换机的常用配置命令
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设备
⑹ 交换机命令是什么意思!
switchport
allowed
vlan
使用这个命令在选定的接口上配置vlan组,使用no的形式恢复默认值。
语法
switchport
allowed
vlan
{add
vlan
[tagged
|
untagged]
|
remove
vlan}
no
switchport
allowed
vlan
1
add
vlan--所要添加的vlan标识符
2
remove
vlan--所要删除的vlan标识符
默认设置
所有的端口被分配到vlan
1
帧类型未加标记
命令模式
接口配置
命令的使用
1
如果交换机端口模式设置为trunk,那么你只能分配一个接口到vlan组作为未加标记的成员。
2
帧总是在交换机中被加标记。加标记和未加标记的参数用于告知交换机是否从进口处的帧保留或除去标记。
3
如果链接的另一端所有媒质网络设备和主机都不支持vlan,那么应该添加接口到这些vlan作为未加标记的成员。否则,有必要最多只添加一个vlan作为未加标记的成员,这应该符合本地vlan。
4
如果手动添加禁用列中的vlan
到那个接口,那么vlan自动从列中被删除。
switchport
native
vlan
使用这个命令为一个端口配置pvid,使用no的形式恢复默认值。
语法
switchport
native
vlan
vlan-id
no
switchport
native
vlan
vlan-id--一个端口的默认vlan
id。(范围:1-4094)
默认设置
vlan
1
命令模式
接口配置
命令的使用
1
如果接口不是vlan
1的成员,且你分配了它的pvid到这个vlan,那么接口将自动添加到vlan
1作为一个未加标记的成员。对于其他vlan,在你分配接口的pvid到那个组之前,接口必须先配置为未加标记的成员。
2
如故可接受的帧类型被设为all(所有),或交换机端口模式被设为hybrid(混合),那么pvid将被插入到所有未加标记的帧,流入进入端口。
第三个是一个基于交换机的命令
untagged
是一个端口的模式
⑺ 思科交换机详细配置方法和命令
思科交换机的基本配置命令学习
一、交换机口令设置:
switch>enable ;进入特权模式
switch#config terminal ;进入全局配置模式
switch(config)#hostname csico ;设置交换机的主机名
switch(config)#enable secret
csico1 ;设置特权加密口令
switch(config)#enable password csico8 ;设置特权非密口令
switch(config)#line console 0 ;进入控制台口
switch(config-line)#line vty 0 4
;进入虚拟终端
switch(config-line)#login ;虚拟终端允许登录
switch(config-line)#password
csico6 ;设置虚拟终端登录口令csico6
switch#exit ;返回命令
二、交换机显示命令:
switch#write ;保存配置信息
switch#show vtp ;查看vtp配置信息
switch#show run ;查看当前配置信息
switch#show
vlan ;查看vlan配置信息
switch#show interface ;查看端口信息
switch#show int f0/0
;查看指定端口信息
switch#show int f0/0 status;查看指定端口状态
switch#dir flash: ;查看闪存
Cisco路由器配置命令大全网络 2010-06-26 06:43:44 阅读657 评论0 字号:大中小 订阅 .
(1)模式转换命令
用户模式----特权模式,使用命令"enable"
特权模式----全局配置模式,使用命令"config
t"
全局配置模式----接口模式,使用命令"interface+接口类型+接口号"
全局配置模式----线控模式,使用命令"line+接口类型+接口号"
注:
用户模式:查看初始化的信息.
特权模式:查看所有信息、调试、保存配置信息
全局模式:配置所有信息、针对整个路由器或交换机的所有接口
接口模式:针对某一个接口的配置
线控模式:对路由器进行控制的接口配置
(2)配置命令
show running config 显示所有的配置
show
versin 显示版本号和寄存器值
shut down 关闭接口
no shutdown 打开接口
ip add +ip地址
配置IP地址
secondary+IP地址 为接口配置第二个IP地址
show interface+接口类型+接口号 查看接口管理性
show controllers interface 查看接口是否有DCE电缆
show history 查看历史记录
show
terminal 查看终端记录大小
hostname+主机名 配置路由器或交换机的标识
config memory
修改保存在NVRAM中的启动配置
exec timeout 0 0 设置控制台会话超时为0
service password-encryptin
手工加密所有密码
enable password +密码 配置明文密码
ena sec +密码 配置密文密码
line vty 0
4/15 进入telnet接口
password +密码 配置telnet密码
line aux 0 进入AUX接口
password
+密码 配置密码
line con 0 进入CON接口
password +密码 配置密码
bandwidth+数字 配置带宽
no ip address 删除已配置的IP地址
show startup config 查看NVRAM中的配置信息
run-config atartup config 保存信息到NVRAM
write 保存信息到NVRAM
erase
startup-config 清除NVRAM中的配置信息
show ip interface brief 查看接口的谪要信息
banner
motd # +信息 + # 配置路由器或交换机的描素信息
description+信息 配置接口听描素信息
vlan database
进入VLAN数据库模式
vlan +vlan号+ 名称 创建VLAN
switchport access vlan +vlan号
为VLAN为配接口
interface vlan +vlan号 进入VLAN接口模式
ip add +ip地址 为VLAN配置管理IP地址
vtp+service/tracsparent/client 配置SW的VTP工作模式
vtp +domain+域名 配置SW的VTP域名
vtp +password +密码 配置SW的密码
switchport mode trunk 启用中继
no vlan +vlan号
删除VLAN
show spamming-tree vlan +vlan号 查看VLA怕生成树议
三. 路由器配置命令
ip
route+非直连网段+子网掩码+下一跳地址 配置静态/默认路由
show ip route 查看路由表
show protocols
显示出所有的被动路由协议和接口上哪些协议被设置
show ip protocols 显示了被配置在路由器上的路由选择协议,同时给出了在路由选择协议中使用
的定时器
等信息
router rip 激活RIP协议
network +直连网段 发布直连网段
interface lookback 0 激活逻辑接口
passive-interface +接口类型+接口号 配置接口为被动模式
debug ip +协议 动态查看路由更新信息
undebug all 关闭所有DEBUG信息
router eigrp +as号
激活EIGRP路由协议
network +网段+子网掩码 发布直连网段
show ip eigrp neighbors 查看邻居表
show ip eigrp topology 查看拓扑表
show ip eigrp traffic 查看发送包数量
router
ospf +process-ID 激活OSPF协议
network+直连网段+area+区域号 发布直连网段
show ip ospf
显示OSPF的进程号和ROUTER-ID
encapsulation+封装格式 更改封装格式
no ip admain-lookup
关闭路由器的域名查找
ip routing 在三层交换机上启用路由功能
show user 查看SW的在线用户
clear line
+线路号 清除线路
四. 三层交换机配置命令
配置一组二层端口
configure terminal 进入配置状态
nterface range {port-range} 进入组配置状态
配置三层端口
configure terminal 进入配置状态
interface {{fastethernet | gigabitethernet} interface-id} | {vlan vlan-id} |
{port-
channel port-channel-number} 进入端口配置状态
no switchport
把物理端口变成三层口
ip address ip_address subnet_mask 配置IP地址和掩码
no shutdown 激活端口
例:
Switch(config)# interface gigabitethernet0/2
Switch(config-if)#
no switchport
Switch(config-if)# ip address 192.20.135.21 255.255.255.0
Switch(config-if)# no shutdown
配置VLAN
configure terminal 进入配置状态
vlan vlan-id 输入一个VLAN号, 然后进入vlan配态,可以输入一个新的VLAN号或旧的来进行修改
⑻ 求交换机命令大全
每个厂家的 产品命令也是不一样的
1.在基于IOS的交换机上设置主机名/系统名:
switch(config)# hostname hostname
在基于CLI的交换机上设置主机名/系统名:
switch(enable) set system name name-string
2.在基于IOS的交换机上设置登录口令:
switch(config)# enable password level 1 password
在基于CLI的交换机上设置登录口令:
switch(enable) set password
switch(enable) set enalbepass
3.在基于IOS的交换机上设置远程访问:
switch(config)# interface vlan 1
switch(config-if)# ip address ip-address netmask
switch(config-if)# ip default-gateway ip-address
在基于CLI的交换机上设置远程访问:
switch(enable) set interface sc0 ip-address netmask broadcast-address
switch(enable) set interface sc0 vlan
switch(enable) set ip route default gateway
4.在基于IOS的交换机上启用和浏览CDP信息:
switch(config-if)# cdp enable
switch(config-if)# no cdp enable
为了查看Cisco邻接设备的CDP通告信息:
switch# show cdp interface [type modle/port]
switch# show cdp neighbors [type mole/port] [detail]
在基于CLI的交换机上启用和浏览CDP信息:
switch(enable) set cdp {enable|disable} mole/port
为了查看Cisco邻接设备的CDP通告信息:
switch(enable) show cdp neighbors[mole/port] [vlan|plex|capabilities|detail]
5.基于IOS的交换机的端口描述:
switch(config-if)# description description-string
基于CLI的交换机的端口描述:
switch(enable)set port name mole/number description-string
6.在基于IOS的交换机上设置端口速度:
switch(config-if)# speed{10|100|auto}
在基于CLI的交换机上设置端口速度:
switch(enable) set port speed moudle/number {10|100|auto}
switch(enable) set port speed moudle/number {4|16|auto}
7.在基于IOS的交换机上设置以太网的链路模式:
switch(config-if)# plex {auto|full|half}
在基于CLI的交换机上设置以太网的链路模式:
switch(enable) set port plex mole/number {full|half}
8.在基于IOS的交换机上配置静态VLAN:
switch# vlan database
switch(vlan)# vlan vlan-num name vla
switch(vlan)# exit
switch# configure teriminal
switch(config)# interface interface mole/number
switch(config-if)# switchport mode access
switch(config-if)# switchport access vlan vlan-num
switch(config-if)# end
在基于CLI的交换机上配置静态VLAN:
switch(enable) set vlan vlan-num [name name]
switch(enable) set vlan vlan-num mod-num/port-list
9. 在基于IOS的交换机上配置VLAN中继线:
switch(config)# interface interface mod/port
switch(config-if)# switchport mode trunk
switch(config-if)# switchport trunk encapsulation {isl|dotlq}
switch(config-if)# switchport trunk allowed vlan remove vlan-list
switch(config-if)# switchport trunk allowed vlan add vlan-list
在基于CLI的交换机上配置VLAN中继线:
switch(enable) set trunk mole/port [on|off|desirable|auto|nonegotiate]
Vlan-range [isl|dotlq|dotl0|lane|negotiate]
10.在基于IOS的交换机上配置VTP管理域:
switch# vlan database
switch(vlan)# vtp domain domain-name
在基于CLI的交换机上配置VTP管理域:
switch(enable) set vtp [domain domain-name]
11.在基于IOS的交换机上配置VTP 模式:
switch# vlan database
switch(vlan)# vtp domain domain-name
switch(vlan)# vtp {sever|cilent|transparent}
switch(vlan)# vtp password password
在基于CLI的交换机上配置VTP 模式:
switch(enable) set vtp [domain domain-name] [mode{ sever|cilent|transparent }][password password]
⑼ 交换机的基本命令
交换机的启动及基本配置
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
查看生成树信息
⑽ 交换机全部命令和汉语翻译,高分送上!
交换机配置命令详解 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 ;查看指定端口信息