-
思科交换机基本配置命令
2020-11-12 20:14:06输入命令config terminal进入全局配置模式 switch(config)# 输入命令int xxx可进入端口或者vlan的全局配置子模式 特权用户模式可输入show命令查看相关设置,命令后输入?可查询帮助 可用no 命令撤销已经设置的配置...思科交换机相关配置
一、基础操作
进入交换机界面为一般用户模式 switch>
输入命令 enable进入特权用户模式 switch#
输入命令config terminal进入全局配置模式 switch(config)#
输入命令int xxx可进入端口或者vlan的全局配置子模式switch(config-if)#特权用户模式可输入show命令查看相关设置,命令后输入?可查询帮助
可用no 命令撤销已经设置的配置二、Telnet远程登录设置
1.交换机配置IP地址
进入vlan 1 //int vlan 1
启用 //no shutdown
设置ip地址 ///ip address ip地址 子网掩码
2.设置交换机用户名和密码
useename xxx
password/secret xxx
设置enable密码
enable password xxx
3.设置访问数量
line vty 0 x(x是数量,最小为1)
password xxx
login
也可以直接调用上面设置的本地用户名密码
line vty 0 x
login local
4.console口的密码设置也相似
line console 0
login local三、SSH远程登录
1.基础设置与Telnet类似
2.设置访问数量
line vty 0 x
3.选择ssh方式
transport input ssh
4.更改hostname
hostname xxx
5.设置域名
ip domain-name xxx.com
6.设置rsa加密密钥
crypto key generate rsa
[512]:在360-2048中选择即可
7.PC端登录命令
ssh -l username ip地址四、交换机中划分vlan
1.创建vlan
vlan x(数字)
可以使用name命令改名
2.进入端口,分配vlan
int f0/1
switchport access vlan x
3.交换机之间相连需要在连接端口做trunk
进入连接端口
int f0/24
创建trunk
switchport mode trunk五、核心交换机中划分vlan
1.创建vlan
vlan x1
vlan x2
…
2.vlan 中设置网关,vlan下的pc终端也要设置相同网关
int vlan x
ip address xxx xxx
3.三层交换机与交换机相连端口做trunk
封装dot1q协议
switchport trunk encapsulation dot1q
创建trunk
switchport mode trunk
4.如有需要,可以开启路由功能
ip routing六、本地端口镜像
1.设置源端口
monitor session 1 source int f0/1
2.设置目的端口
monitor session 1 destination f0/2七、远程端口镜像
1.设置远程专用vlan
vlan 100
开启远程端口镜像功能
remote-span
2.被监视交换机中
设置源端口
monitor session 1 source int f0/1
设置目的端口
monitor session 1 destination remote vlan 100 reflector-port f0/1
3.另一台监视交换机
同上,创建vlan,开启远程镜像
设置源端口
monitor session 2 source remote vlan 100
设置目的端口
monitor session 2 destination int f0/3八、PVST配置,负载均衡
1.打开pvst功能
spanning-tree mode pvst
2.进入交换机全局配置模式
配置主根
spainning-tree vlan x1 priority 4096
配置次根
spanning- tree vlan x2 priority 8192
3.进入另一个交换机
配置主根
spainning-tree vlan x2 priority 4096
配置次根
spanning- tree vlan x1 priority 8192
3.进入另一个交换机九、链路聚合lacp
1.进入需要配置的端口
int range f0/21-24
2.选择lacp协议
channel-protocol lacp
2.开启
channel-group 1 mode active
3.如果链路聚合需要做trunk,可以执行以下操作
int port- channel 1
switchport mode trunk -
思科交换机的配置模式基本配置命令
2021-01-28 22:55:47从特权模式进入全局配置模式 Switch#configure terminal Switch(config)# 在特权模式下可以对交换机进行命名,这样在配置多台交换机时,避免将配置写错交换机。 Switch(config)#hostname cisco-sw1 配置交换端口...思科交换机的配置模式基本配置命令
- 打开思科交换CLI,首先进入的是用户模式,如果要进行配置操作需要进入特权模式。
Switch>enable
Switch#
- 从特权模式进入全局配置模式
Switch#configure terminal
Switch(config)#
- 在特权模式下可以对交换机进行命名,这样在配置多台交换机时,避免将配置写错交换机。
Switch(config)#hostname cisco-sw1
- 配置交换端口密码,登录特权模式时需要输入该密码,避免设备被其他人使用。
cisco-sw1(config)#enable password cisco
ps:password表示密码为明文
- 给交换机配置使能密码,进入特权模式时需要输入密码才能进入,避免设备可以被其他人员使用。
cisco-sw1(config)#enable secret ciscoswitch
ps:secret表示密码用的密文
- 交换机配置VLAN,并给将端口加入到该VLAN:
cisco-sw1(config)#vlan 2
cisco-sw1(config-vlan)#name test
cisco-sw1(config-vlan)#exit
cisco-sw1(config)#interface fastEthernet 0/1
cisco-sw1(config-if)#switchport mode access
cisco-sw1(config-if)#switchport access vlan 2
- 进入交换机某一端口
switch> enable
switch#configure terminal
switch(conf)# interface fastehernet 0/1
switch(conf-if)#
- show:查看命令,交换机的所有配置和其它相关信息都需要通过show命令查看。
switch> enable
switch# show version 察看系统中的所有版本信息
switch#show vlan id 1 查看交换机有关vlan配置信息
switch#show running-configure 查看交换机当前起作用的配置信息
switch#show interface fastethernet 0/1 察看交换机1 接口具体配置和统计信息
switch#show mac-address-table 查看mac地址转发表
- 交换机恢复出厂
switch> enable
switch# erase startup-configure
switch# reload
- telnet 远程登录设置:
switch>en
switch#configure terminal
swich(conf)#enable password cisco 以cisco 为特权模式密码
swich(conf)#interface vlan 1 以vlan 1端口作为远程登录的接口,其他端口亦可
swich(conf-if)#ip address 192.168.1.1 255.255.255.0
swich(conf-if)#no shut
swich(conf-if)#exit
swich(conf)line vty 0 4 设置0-4 个用户可以telnet 远程登陆
swich(conf-line)#password 123456
swich(conf-line)#login
- SSH远程登录设置:
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#hostname cisco-sw1 交换机重新命名
cisco-sw1(config)#ip domain-name cisco.com 配置域名
cisco-sw1(config)#line vty 0 4
cisco-sw1(config-line)#transport input ssh 登录方式为SSH
cisco-sw1(config-line)#exit
cisco-sw1(config)#crypto key generate rsa 配置秘钥
The name for the keys will be: cisco-sw1.cisco.com
Choose the size of the key modulus in the range of 360 to 2048 for your
General Purpose Keys. Choosing a key modulus greater than 512 may take
a few minutes.
How many bits in the modulus [512]: 1024 思科推荐使用1024
% Generating 1024 bit RSA keys, keys will be non-exportable...[OK]
-
思科交换机配置试题_思科交换机基本配置命令全集
2020-12-31 10:07:33enable 进入特权模式Switch #config terminal 进入全局配置模式Switch(config)#hostname 设置交换机的主机名Switch(config)#enable password 进入特权模式的密码(明文形式保存)Switch(config)#enablesecret 加密密码...原标题:思科交换机基本配置命令全集
基本配置命令
Switch>enable 进入特权模式
Switch #config terminal 进入全局配置模式
Switch(config)#hostname 设置交换机的主机名
Switch(config)#enable password 进入特权模式的密码(明文形式保存)
Switch(config)#enablesecret 加密密码(加密形式保存) (优先)
Switch(config)#ipdefault-gateway 配置交换机网关
Switch(config)#showmac-address-table 查看MAC地址
Switch(config)loggingsynchronous 阻止控制台信息覆盖命令行上的输入
Switch(config)no ipdomain-lookup 关闭DNS查找功能
Switch(config)exec-timeout 00 阻止会话退出
使用Telnet远程式管理
Switch(config)#line vty 0 4 进入虚拟终端
Switch (config-line)# password 设置登录口令
Switch(config-line)# login 要求口令验证
控制台口令
switch(config)#lineconsole 0 进入控制台口
switch(config-line)# password xx
switch(config-line)#设置登录口令login 允许登录
恢复出厂配置
Switch(config)#erasestartup-config
Switch(config)delete vlan.dat
配置接口标识 接口标识用于区分路由器的各个接口。
switch(config)#interfacefastethernet 0/1 以0/1 接口为例
switch(config)# deion this is a fast Ethernetport used to connecting the company’s intranet!
Vtp配置
switch(config)#vtpdomain 设置vtp域名
switch(config)#vtp password 设置vtp密码
switch(config)#vtp modeserver /client/transparent 设置vtp服务器模式
switch(config)#vtpversion 设置vtp版本
switch(config)#vtppruning 启用vtp修解
注:要想从vtp中减少一台交换机只需将该交换机vtp域名更改
Vlan基本配置
Switch#vlandatabase 进去vlan配置模式
Switch(vlan)#vlan 号码 name名称 创建vlan及vlan名
Switch(vlan)#vlan号码mtu数值 修改MTU大小
Switch(vlan)#exit 更新vlan数据并推出
Switch#showvlan 查看\验证
Switch#copy running-configstartup-config 保存配置
叫NO 删除VLAN
VLAN 中添加 删除端口
Switch#configterminal 进入全局配置
Switch(config)#interfacefastethernet0/1 进入要分配的端口
Switch(config-if)#Switchportmodeaccess 定义二层端口
Switch(config-if)#Switchport acces vlan号 把端口分给一个vlan
Switch(config-if)#switchportmode trunk 设置为干线
Switch(config-if)#switchport trunk encapsulationdot1q 设置vlan 中继协议
Switch(config-if)#noswitchport mode 或 ( switchport mode access) 禁用干线
Switch(config-if)#switchport trunk allowed vlan add1,2 从Trunk中添加vlans
Switch(config-if)#switchporttrunk allowed vlan remove 1,2 从Trunk中删除vlan
Switch(config-if)#switchport trunk pruning vlan remove1,2 ;从Trunk中关闭局部修剪
注:可以使用default interfaceinterface-id 还原接口到默认配置状态
Trunk
开启(no) ——将端口设置为永久中继模式
关闭(off) ——将端口设置为永久非中继模式, 并且将链路转变为非中继链路
企望(desirable)——让端口主动试图将链路转换成中继链路
自动(auto) ——使该端口愿意将链路变成中继链路
配置接口为动态协商模式
Switch(config)#interface接口号
Switch(config)#switchport mode dynamic desirable/auto
生成树stp:
Switch(config)#spanning-treevlan 启用stp生成树(基于vlan)
Switch(config)#spanning-tree vlan root primary 指定根交换机(基于vlan)
Switch(config)#spanning-treevlan root secondary 指定备用根交换机(基于vlan)
Switch(config)#spanning-tree vlan priority <0-65535> 指定交换机优先级(基于vlan)
Switch(config)#nospanning-tree vlan priority 将交换机的优先级恢复默认值(基于vlan)
Switch(config-if)#spanning-tree vlan cost <0-200000000> 指定端口成本(起用trunk的端口模式下)
Switch(config-if)#spanning-treevlan port-prioty <0-255> 指定交换机端口优先级(基于vlan)
Switch(config-if)#spanning-treeportfast 配置速端口(连接终端设备的端口状态)如pc机
Switch(config)#spanning-treeuplinkfast 配置上行速端口
注:在配置上行速端口前要先将基于vlan上的网桥优先级,网桥成本恢复默认值。起用了该命令后在进行优先级更改,
注:vlan为可选参数,当没有该参数时将修改所有vlan网桥的优先级\及所有的vlan端口成本
Switch#show spanning-tree summery 检测vlan生成树配置
Switch#showspanning-tree vlan detail 浏览详细生成树配置信息
Switch#show spanning-tree interface detail 浏览详细生成树端口配置信息
以太网通道配置
switch(config)#interfacerange fasternet0/1 - 2 将fasternet0/1和0/2 口捆绑
switch(config-if)#channel-group 1 modeon 配置以太通道模式
switch(config-if)#port-channelload-balance {dst-mac | src-mac}在链路间实现负载均衡
switch#show etherchannel 1 summary 查看通道信息
switch#showetherchannel load-balance 查看通道信息返回搜狐,查看更多
责任编辑:
-
思科设备基础配置命令
2018-04-28 10:26:24enable (进入特权模式)Switch#configure terminal(进入全局模式)Switch(config)#interface f0/1(进入接口模式) Exit (退到上一级)End (退到特权模式) 配置控制台会话时间永不超时Switch(config)#line console 0...思科设备模式配置
Switch>(用户模式)
Switch>enable (进入特权模式)
Switch#configure terminal(进入全局模式)
Switch(config)#interface f0/1(进入接口模式)Exit (退到上一级)
End (退到特权模式)配置控制台会话时间永不超时
Switch(config)#line console 0
Switch(config-line)#exec-timeout 0 0配置输出日志同步
Switch(config)#line console 0
Switch(config-line)#logging synchronous禁用DNS查询
Switch(config)#no ip domain-lookup更改名字
Switch(config)#Hostmane S1(S1为自定义用户名)查询当前交换机所运行的配置
Switch#show running-config查询版本
Switch#show version特权加密
Switch(config)#enable password 123 (明文密码)
Switch(config)#enable secret 456 (密文密码)配置Console加密
Switch(config)#line console 0
Switch(config-line)#password 1234
Switch(config-line)#login保存
Switch#copy running-config startup-config转载于:https://blog.51cto.com/13721775/2108737
-
思科命令大全_思科基础命令大全,建议收藏!
2020-12-17 20:28:58思科 基本端口设置命令no ip routing 二层交换关闭路由功能configure terminal (conf t) 进入全局模式interface fastEthernet 1/0 (int f1/0) 进入端口1/0 简写int f1/0speed 100 设置速率为100MBduplex full 设置... -
思科命令大全
2018-12-03 17:06:56进入全局配置模式 switch(config)#hostname csico ;设置交换机的主机名 switch(config)#enable secret csico1 ;设置特权加密口令 switch(config)#enable password csico8 ;设置特权非密口令 switch(config)#line ... -
cs寄存器 x86 特权模式_思科交换机进特权模式的命令是什么?
2020-12-24 14:40:45展开全部router #2:进入全局636f707962616964757a686964616f31333365643535配置模式 configure terminalrouter > enablerouter #c onfigure terminalrouter (conf)#3:交换机命名 hostname routera 以routerA为... -
9.思科交换路由基本命令操作
2017-03-07 17:24:21:用户模式#:特权模式(config)#:全局模式(config-if)#:接口模式命令大致划分:v用户模式下大多都是对设备IOS系统进行操作配置的一些命令。v特权模式下大多都是Show查看类命令。v全局模式下大多都是配置类命令。v... -
思科交换机:基本命令(上)
2020-10-26 19:35:52一、设备模式的介绍 用户模式 >代表在用户模式,只能查看设备的...进入全局模式 (config)全局模式,可以修改配置,且全局生效。 Switch#config terminal Enter configuration commands, one per line. End with C -
cisco思科交换机-常用命令及配置
2020-05-22 15:28:062:进入全局配置模式configure terminal switch> enable switch#configure terminal switch(conf)# 3:交换机命名hostname name 以cisco001 为例 switch> enable switch#c onfigure terminal switch... -
思科,基本命令总结
2019-10-24 10:28:561、思科 基本端口设置命令 no ip routing //二层...configure terminal (conf t) //进入全局模式 interface fastEthernet 1/0 (int f1/0) //进入端口1/0 简写int f1/0 speed 100 //设置速率为100MB duple... -
思科Cisco交换机的基本模式和命令基本使用和技巧大全
2020-10-24 21:43:51Switch(config# 全局配置模式(conf t 由特权模式进入) Switch(config-if)# 端口模式(interface 端口 例如:int fa0/1) 其他: Switch(config-line)#(例如line vty 0 4进入) Switch(conf -
思科路由配置命令
2018-07-01 18:08:08路由器基本配置命令enable #进入特权模式 configure terminal 进入全局配置命令show ip interface brief 简要查看接口状态命令interface fastethernet 0/1 进入f0/1接口ip address 10.0.0.1 255.255.255.0 为... -
思科交换机-常用命令及配置
2017-09-06 12:17:48switch> 用户模式 1:进入特权模式enable ...2:进入全局配置模式configure terminal switch> enable switch#configure terminal switch(conf)# 3:交换机命名hostname name 以cisco001 为例 switch> enable -
思科常用基本操作命令
2011-04-26 16:11:00常用基本操作命令hostname wolf :给路由器改名configure terminal :进入全局模式no ip domain-lookup:关闭域名查询logging synchronous :防止弹出信息干扰exec-time 0 0或no exec-time :设置控制台会话永不超时... -
思科基础命令
2020-09-05 17:05:41... configure terminal //进入全局配置模式 username abc privileg 15 secret abc123 //设置远程登陆账号和密码 end //退出到特权模式 configure terminal / -
思科路由相关配置命令
2011-12-28 20:40:011. 交换机支持的命令: 交换机基本状态: switch: ;ROM状态, 路由器是rommon>hostname>;用户模式hostname# ;特权模式hostname(config)# ;全局配置模式hostname(config...进入特权模式switch#config term... -
思科常用命令
2018-11-30 15:35:15,进入命令:初始模式。 特权模式。提示符:"#",进入命令:enable 退出命令:disable 全局配置模式。提示符:"(config)#",进入命令:configure terminal 退出命令:exit 其他配置模式。如接口... -
思科交换机配置命令大全.pdf
2020-08-21 11:38:042:进入全局配置模式configure terminal switch> enable switch#c onfigure terminal switch(conf)# 3:交换机命名hostname aptech2950 以aptech2950 为例 switch> enable switch#c onfigure terminal switch(conf... -
思科交换机的基本配置命令
2018-07-03 13:32:38思科交换机的基本配置命令思科交换机的基本配置命令学习CISCO交换机基本配置:Console端口连接用户模式hostname# ;特权模式hostname(config)# ;全局配置模式hostname...进入全局配置模式switch(config)#hostn... -
YW-思科模拟器交换机命令
2019-03-04 15:04:44全局模式 其他模式 二.进入接口模式的时候 全局模式下 interface 接口名字 接口类型 三.配置主机名 全局模式下 hostname xxx 四.查看配置命令 特权模式下 show running-config 五.配置明文命令 全局... -
思科命令
2013-05-20 18:26:30交换机口令设置:switch>...进入全局配置模式switch(config)#hostname ;设置交换机主机名switch(config)#enable secret xxx ;设置特权加密口令为xxxswitch(config)#enable password xxx ;设置特权非密口令为x... -
思科路由交换部分命令大全。
2018-01-17 18:32:59交换机部分命令 ...Swith#config t //切换到全局配置模式 Swith(config)# interface f0/1 //进入接口f0/0 Swith(config)# interface vlan 1 //进入VLAN 1中 Swith(config-if)#ip address 192.168.1.1 255.25... -
华为/思科一些常见命令集对照
2020-03-12 14:08:39思科:用户模式 特权模式 全局模式 接口模式 协议模式 用户模式:权限特别低,仅仅用于查看,查看的东西特别少 特权模式:还是用于查看,但是能够查看的东西更多,权限更高 R1>enable---------从用户模式进入特权... -
思科三层交换机配置命令
2019-05-21 14:29:031.交换机支持的命令 思科交换机基本状态: hostname> ;用户模式 hostname# ;特权模式 hostname(config)# ;全局配置模式 hostname(config-if)# ;...进入全局配置模式 switch(config)#hostnam...
-
2021年 系统架构设计师 系列课
-
MyBatisSelf.rar
-
git配置 用户名 邮箱 SSH
-
MPC第1期.rar
-
本文仅供测试,随时删除
-
app软件测试全栈系列精品课程
-
【爱码农】C#制作MDI文本编辑器
-
Amoeba 实现 MySQL 高可用、负载均衡和读写分离
-
LeetCode刷题-剑指55
-
2021-03-01
-
计算机常见复试问题.pdf
-
物联网基础篇:快速玩转MQTT
-
Docker从入门到精通
-
线性回归模拟(二维输入,一维输出,一层隐藏层)
-
《ChinaTeXMathFAQ_V1.1》.pdf
-
基于Qt的LibVLC开发教程
-
python课件.rar
-
java与c++区别
-
记一次Maya使用入门
-
C/C++反汇编解密