当前位置:文档之家› 思科交换机基本命令(全)

思科交换机基本命令(全)

思科交换机基本命令(全)
思科交换机基本命令(全)

思科模拟器命令:

设置交换机名字为yzh

Switch> 进入超级终端控制台

Switch>enable 进入交换机特权模式

Switch#

Switch#configure terminal 进入交换机全局配置模式

Switch(configure)#hostname yzh 改变名字为XXX

yzh(configure)# 显示改名成功

yzh(configure)#exit 退回上级操作模式,即返回特权模式

yzh#

yzh#exit 返回到用户模式

yzh>

参看交换机有关信息

yzh#

yzh#configure terminal 进入交换机全局配置模式

yzh#show version 查看交换机的版本信息

yzh#show vlan 查看交换机的VLAN信息,默认情况下所有借口均属于VLAN yzh#show running-config 查看交换机当前生效的配置信息

配置交换机接口f0/2

yzh>

yzh>enable

yzh#

yzh#configure terminal 进入交换机配置模式

yzh(config)#interface fastEthernet 0/2 进入交换机接口fa0/2

yzh(config-if)# 进入接口配置模式

yzh(config-if)#speed 100 设置接口F0/2速率为100M

yzh(config-if)#duplex half 配置接口的双工模式是半双工

yzh(config-if)#no shutdown 开启接口,使得处于工作状态,等待转发数据。

yzh(config-if)#exit 输入exit返回全局模式

yzh(config)#exit 返回特权模式

yzh# 位于特权模式

yzh#show interfaces fastEthernet 0/2 查看刚才对接口f0/2配置情况

设置交换机Enable特权密码为admin

yzh> 进入超级终端控制台

yzh>enable 进入交换机特权模式

yzh#configure terminal 进入交换机配置模式

yzh(config)#enable secret admin 设置Enable密码为admin

注:验证密码自己思考。

查看设备配置信息

yzh#show running-config

保存配置信息

yzh#write 保存设置配置,把配置指令写入对到系统文件夹中yzh#dir 查看系统文件

删除配置,恢复初始配置

yzh#

yzh#dir 查看系统文件

yzh#delete? 输入“?”号,获得帮助

yzh#delete flash:config.txt 删除配置文件

系统就恢复了出厂配置

三层交换机与二层交换机的大多数都相同。

配置三层交换机的名称为SW3,enable密码为admin,并且配置与远程登陆相关的选项。Switch>enable 进入交换机特权模式

Switch#configure terminal 进入交换机全局模式

Swirch(config)#hostname yzh 修改交换机名称

Yzh(config)#enable password admin 设置交换机enable密码为admin

Yzh(config)#interface vlan1 进入vlan1

Yzh(config-if-VLAN1)#ip address 192.168.1.1 255.255.255.0 配置IP地址

yzh(config-if-VLAN1)#exit 退出配置vlan1

yzh(config)#username admin password admin 配置登陆交换机的用户名与密码

yzh(config)#line vty 0 4 进入vty端口配置

yzh(config-line)#login local 配置vty端口使用本地数据库验证

yzh(config-line)#exit 退出vty端口配置

yzh(config)# 配置OK

保存三层交换机配置。

SW3#write

配置三层交换机名称与VLAN

yzh>enable 进入交换机特权模式

yzh#configure terminal 进入交换机全局模式

yzh(config)#hostname YZH 修改交换机名称为YZH

YZH(config)#vlan10 创建vlan10

YZH(config-vlan)#vlan20 创建vlan20

YZH(config-vlan)#exit

YZH(config)#interface range fastEthernet 0/1-10 进入fa/1-10端口

YZH(config-if-range)#switchport access vlan10 划分fa/1-10端口为vlan10 YZH(config-if-range)exit

YZH(config)#interface range fastEthernet 0/11-20 进入fa/11-20端口

YZH(config-if-range)#switchport access vlan20 划分fa/11-20端口为vlan20 YZH(config-if-range)#exit

查看vlan配置信息

YZH(config)#exit

YZH#show vlan 查看交换机vlan信息

配置vlan10与vlan20的IP地址,使vlan10与vlan20之间能相互通讯。

YZH(config)#interface vlan10 进入vlan10

YZH(config-vlan10)#ip address 192.168.1.1 255.255.255.0 配置vlan10的IP地址YZH(config-vlan10)#exit

YZH(config)#interface vlan20 进入vlan20

YZH(config-vlan20)#ip address 192.168.2.1 255.255.255.0 配置vlan20的IP地址YZH(config)#exit

YZH#show running-config 查看交换机配置信息

在三层交换机上配置vlan10与20的IP地址后,PC1与PC2可以相互通讯

YZH>enable 进入特权模式

YZH#configure terminal 进入全局模式

YZH(config)#hostname yzh 修改名称

yzh(config)#interface range fasrEthernet 0/1-2 进入fa0/1、fa0/2端口

yzh(config-if-range)#port-group 1 把fa0/1、fa0/2端口聚合为端口组1 yzh(config-if-range)#exit

yzh(config)#exit 注:验证测试:查看交换机配置

yzh#show running-config

配置三层交换机SW1的生成树协议

yzh>enable

yzh#configure

yzh(config)#hostname YZH

YZH(config)#spanning-tree 配置生成树

YZH(config)#exit

验证配置:

YZH#show vlan 查看VLAN划分信息

配置二层交换机SWB的VLAN划分

YZH>enable

YZH #configure terminal

YZH(config)#hostname SWB 配置交换机名称

YZH (config)#vlan20 创建VLAN20

YZH (config-vlan)#exit

YZH (config)#int fa0/1

YZH (config-if)#swit

YZH (config-if)#switchport access vlan20 将端口Fa0/1划分为VLAN20

YZH (config-if)#exit

YZH (config)#int fa0/24

YZH (config-if)#switchport access vlan20 将端口Fa0/24划分为VLAN20

YZH (config-if)#exit

配置三层交换机SW1不同VLAN之间的通信

YZH>enable

YZH #configure terminal

YZH (config)#hostname yzh !配置交换机名称

yzh (config)#vlan10 !创建VLAN10

yzh (config-vlan)#vlan20 !创建VLAN20

yzh (config-vlan)#vlan 30 !创建VLAN30

yzh (config-vlan)#exit

yzh (config)#interface vlan10 !配置VLAN10的IP地址

yzh (config-VLAN10)#ip address 192.168.1.1 255.255.255.0

yzh (config-VLAN10)#exit

yzh config)#interface vlan20 !配置VLAN20的IP地址

yzh (config-VLAN20)#ip address 192.168.2.1 255.255.255.0

yzh config-VLAN20)#exit

yzh (config)#interface vlan 30 !配置VLAN30的IP地址

yzh (config-VLAN 30)#ip address 192.168.3.1 255.255.255.0

yzh (config-VLAN 30)#exit

yzh (config)#interface range fastEthernet 0/1-7

yzh (config-if-range)#switchport access vlan10 !划分VLAN10

yzh (config-if-range)#exit

yzh (config)#interface range fastEthernet 0/8-14

yzh (config-if-range)#switchport access vlan20 !划分VLAN20

yzh (config-if-range)#exit

yzh (config)#interface range fastEthernet 0/15-21

yzh (config-if-range)#switchport access vlan 30 !划分VLAN30

yzh (config-if-range)#exit

配置风暴控制。

在交换机配置F0/1端口(连接PC1 的端口)对广播报文进行风暴控制,限制其端口收到

的报文速率(pps)

yzh#configure

yzh(config)#interface fastEthernet 0/1

yzh(config-if)#storm-control broadcast pps 100 配置报文速率阈每秒100个报文

yzh(config-if)#exit

配置交换机端口安全的最大连接数和端口违背模式,绑定PC机IP地址和MAC地址到端口

yzh>enable

yzh#configure

yzh(config)#interface fastEthernet 0/1

yzh(config-FastEthernet 0/1)#switchport port-security 打开端口安全功能

yzh(config-FastEthernet 0/1)#switchport port-security mac address 0023.7d51.72ad

ip-addreess 192.168.1.1

yzh(config-if-range)#switchport port-security violation shutdown 配置安全违背关闭模式

验证交换机端口的最大连接数和端口违背模式

yzh(config)#show port-secruity

验证端口绑定的MAC地址和IP地址

yzh(config)#show port-security

验证端口绑定的MAC地址和IP地址

yzh(config)#show port-security address

配置镜像源端口0/1-2的进出流量映射到目的端口F0/20

yzh#configure

yzh(config)#monitor session 1 source interface fasrEthernet 0/1-2 both

yzh(config)#monitor session 1 destination interface fastEthernet 0/20

yzh(config)#exit

查看配置信息

yzh(config)#show monitor session 1

交换机地址绑定(address-bind)功能

yzh>

yzh>enable

yzh#configure terminal

yzh(config)#address-bind install 使用address-bind功能

yzh(config)#address-bind 192.168.1.1 0016.d390.6cc5

绑定IP地址为192.168.1.1 MAC地址为0016.d390.6cc5的主机让其使用网络

yzh(config)#address-bind 192.168.1.2 0016.d390.6cc4

绑定IP地址为192.168.1.2 MAC地址为0016.d390.6cc4的主机让其使用网络

yzh(config)#address-bind iplink GigabitEthernet 0/24

设置F0/24为例外端口,对于绑定地址策略不生效!

查看配置信息

yzh#show address-bind

创建ACL,定义需要限速的主机范围

yzh>enable

yzh#configure

yzh(config)#ip access-list standard gc 创建标准访问控制列表gc

yzh(config-std-ipacl)#permit host 192.168.1.0 定义限速的数据流

yzh(config)#ip access-list standard yg 创建标准访问控制列表yg

yzh(config-std-ipacl)#permit host 192.168.2.0 定义限速的数据流

定义分类表

Yzh(config)#class-map yg 创建名为yg的分类表

yzh(config-cmap)#match access-group yg 关联匹配的列表地址

yzh(config-cmap)#exit

yzh(config)#class-map gc 创建名为yg的分类表

yzh(config-cmap)#match access-group gc 关联匹配的列表地址

yzh(config-cmap)#exit

创建策略列表,关联对应的分类表,配置限速大小

yzh(config)#policy-map qos1 创建名为qos1的策略列表

yzh(config-pmap)#class yg 关联分类表yg

yzh(config-pmap-c)#police 20000 2000 exceed-action drop

将满足yg分类规则的报文的带宽设置为20M比特/秒,突发值为2M字节,超出此带宽的报文一律丢弃

yzh(config-pmap)#class gc 关联分类表gc

yzh(config-pmap-c)#bandwidth 20 percent 设置cg占取20%带宽

yzh(config-pmap-c)#exit

将带宽限制策略应用到相应的端口

yzh(config)#interface range fastEthernet 0/1-2 进入端口1-2

yzh(config-if)#service-policy input qos1 应用策略列表

小贴士

验证分类表和策略列表的配置命令

Switch#show class-map

Switch#show policy-map

yzh#config

yzh(config)#time-range schooltime 创建时间表schooltime

yzh(config-time-range)#periodic Daily 23:00 to 23:59

定义时间范围为23:00到23:59

yzh(config-time-range)#periodic Daily 0:00 to 7:00

定义时间范围为0:00 到 7:00

yzh(config)#exit

:创建扩展ACL并命名为schoolACl,配置禁止172.20.83.0该网段在每天晚上23:00至凌晨7:00禁止访问外网IP地址172.20.82.100。

yzh(config)#ip access-list extended schoolACL 创建ACL,命名为schoolACL

yzh(config-ext-nacl)#deny ip 172.20.83.0 0.0.0.255 172.20.82.100 time-range schooltime

禁止 172.20.83.0该网段在Schooltime 的时间段内访问外网IP地址172.20.82.100 yzh(config-ext-nacl)#permit ip any any 允许其他所有IP通过

yzh(config-ext-nacl)#exit

进入端口F0/1,配置PC的网关地址,将名为schoolACL的ACL绑定到该端口的入口处。yzh(config)#interface range fastEthernet 0/1

yzh(config-if-range)#ip address 172.20.83.1 255.255.255.0 设置PC网关地址

yzh(config-if-range)#ip access-group schoolACL in 将名为schoolACL的ACL绑定到该端口的入口处

yzh(config-if-range)#exit

把交换机的系统时间设置到ACL所允许通信的时间范围内

yzh(config)#clock set 9:00:00 10 19 2010 设置交换机系统时间为9点

把交换机的系统时间设置到ACL所禁止通信的时间范围内

yzh(config)#clock set 2:00:00 10 19 2010 设置交换机系统时间为2点

配置三层交换机S1,按照以下命令配置网关地址,并配置VRRP

yzh>enable

yzh#configure

yzh(config)#interface fastEthernet 0/23

yzh(config-FastEthernet 0/23)#no switchport

yzh(config-FastEthernet 0/23)#ip address 192.168.1.1 255.255.255.0

yzh(config-FastEthernet 0/23)vrrp 1 192.168.1.254

创建VRRP组为1,并设置虚拟网关

yzh(config-FastEthernet 0/23)#vrrp 1 priority 180 设置组号为1的优先级为180 yzh(config-FastEthernet 0/23)#exit

yzh(config)#interface fastEthernet 0/24

yzh(config-FastEthernet 0/24)#no switchport

yzh(config-FastEthernet 0/24)#ip address 10.0.0.1 255.255.255.240

yzh(config-FastEthernet 0/24)exit

配置三层交换机S2,按照以下命令配置网关地址,并配置VRRP。

S2>enable

S2(config)#interface fastEthernet 0/23

S2(config-FastEthernet 0/23)#no switchport

S2(config-FastEthernet 0/23)ip address 192.168.1.2 255.255.255.0

S2(config-FastEthernet 0/23)#vrrp 1 ip 192.168.1.254

创建VRRP组为1,并设置虚拟网关

S2(config-FastEthernet 0/23)#vrry 1 priority 150 设置组号为1的优先级为150

S2(config-FastEthernet 0/23)#exit

S2(config)#interface fastEthernet 0/24

S2(config-FastEthernet 0/24)#no switchport

S2(config-FastEthernet 0/24)#ip address 20.0.0.1 255.255.255.240

S2(config-FastEthernet 0/24)#exit

配置路由器R1,按照以下命令设置各端口IP地址

R1>

R1>enable

R1#configure

R1(config)#interface fastEthernet 0/0

R1(config-if)#ip address 10.0.0.5 255.255.255.240

R1(config-if)#exit

R1(config)#interface fastEthernet 0/1

R1(config-if)#ip address 20.0.0.4 255.255.255.240

R1(config-if)#exit

R1(config)#interface loopback 1

R1(config-if)#ip address 10.0.0.100 255.255.255.240

R1(config-if)#exit

配置三层交换机S1

S1(config)#route ospf 1

S1(config-router)#network 192.168.1.0 255.255.255.0 area 0

S1(config-router)#network 10.0.0.0 255.255.255.240 area 0

S1(config-router)#exit

配置路由器R1。

R1(config)#route ospf 1

R1(config-router)#network 10.0.0.96 255.255.255.240 area 0

R1(config-router)#network 10.0.0.0 255.255.255.240 area 0

R1(config-router)#network 20.0.0.0 255.255.255.240 area 0

R1(config-router)#exit

在三层交换机S1配置VRRP协议

S1(config)#interface vlan 10 !进入Vlan10

S1(config-VLAN 10)#vrrp 1 ip 192.168.1.10 !创建VRRP组为1,并设置虚拟网关S1(config-VLAN 10)#vrrp 1 priority 180 !设置组号为1的优先级为180

S1(config-VLAN 10)#exit

在三层交换机S1配置VRRP协议

S2(config)#interface vlan 10 !进入Vlan10

S1(config-VLAN 10)#vrrp 1 ip 192.168.1.10 !创建VRRP组为1,并设置虚拟网关S1(config-VLAN 10)#vrrp 1 priority 150 !设置组号为1的优先级为150

S1(config-VLAN 10)#exit

思科交换机命令大全

思科交换机命令大全集团文件发布号:(9816-UATWW-MWUB-WUNN-INNUL-DQQTY-

思科交换机常用命令大全 1.1 用户模式与特权模式 用户模式:可以使用一些基本的查询命令 特权模式:可以对交换机进行相关的配置 进入特权模式命令:Switch>enable 退出特权模式命令:Switch#exit 启用命令查询: 时间设置:Switch#clock set 时间(自选参数,参数必须符合交换机要求) 显示信息命令:Switch#show 可选参数 注意:可以用TAB键补齐命令,自选参数为用户自定义参数,可选参数为交换机设定参数 查看交换机配置: Switch#show running-config 保存交换机配置:Switch#copy running-config startup-config Switch#wr

查看端口信息:Switch#show interface 查看MAC地址表:Switch#show mac-address-table 查看交换机CPU的状态信息:Switch#show processes 1.2 全局配置模式 进入全局配置模式:Switch#configure terminal 主机名修改:Switch(config)#hostname 主机名(自选参数) 特权模式进入密码: Switch(config)#enable secret 密码(自选参数) 取消特权模式密码:Switch(config)#no enable secret 取消主机名设置: Switch(config)#no hostname 退出配置模式: Switch(config)#exit 需要特别注意的是在配置模式中无法使用show命令,如果要使用 的话show前必须加do和空格,例如:do show * 指定根交换机命令:Switch(config)#spanning-tree vlan 自选参数(VLAN号) root primary 例如: Switch(config)#spanning-tree vlan 1 root primary

思科交换机-常用命令及配置

思科交换机-常用命令及配置 switch> 用户模式 1:进入特权模式enable switch> enable switch# 2:进入全局配置模式configure terminal switch> enable switch#configure terminal switch(conf)# 3:交换机命名hostname name 以cisco001 为例 switch> enable switch#c onfigure terminal switch(conf)#hostname cisco001 cisco001(conf)# 4:配置使能口令(未加密)enable password cisco 以cisco 为例switch> enable switch#configure terminal cisco001(conf)# enable password cisco 5:配置使能密码(加密)enable secret ciscolab 以cicsolab 为例switch> enable switch#configure terminal switch(conf)# enable secret ciscolab

6:设置虚拟局域网vlan 1 interface vlan 1 switch> enable switch#configure terminal switch(conf)# interface vlan 1 switch(conf)# ip address 192.168.1.1 255.255.255.0 配置交换机端口ip 和子网掩码 switch (conf-if)#no shut 激活端口 switch (conf-if)#exit switch (conf)#ip default-gateway 192.168.254 设置网关地址 7:进入交换机某一端口interface fastehernet 0/17 以17 端口为例 switch> enable switch#configure terminal switch(conf)# interface fastehernet 0/17 switch(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 地址表

思科交换机命令大全

思科交换机常用命令大全 1.1 用户模式与特权模式 用户模式:可以使用一些基本的查询命令 特权模式:可以对交换机进行相关的配置 进入特权模式命令:Switch>enable 退出特权模式命令:Switch#exit 启用命令查询:? 时间设置:Switch#clock set 时间(自选参数,参数必须符合交换机要求) 显示信息命令:Switch#show 可选参数 注意:可以用TAB键补齐命令,自选参数为用户自定义参数,可选参数为交换机设定参数 查看交换机配置: Switch#show running-config 保存交换机配置:Switch#copy running-config startup-config Switch#wr 查看端口信息:Switch#show interface 查看MAC地址表:Switch#show mac-address-table 查看交换机CPU的状态信息:Switch#show processes 1.2 全局配置模式 进入全局配置模式:Switch#configure terminal

主机名修改:Switch(config)#hostname 主机名(自选参数) 特权模式进入密码: Switch(config)#enable secret 密码(自选参数) 取消特权模式密码:Switch(config)#no enable secret 取消主机名设置: Switch(config)#no hostname 退出配置模式: Switch(config)#exit 需要特别注意的是在配置模式中无法使用show命令,如果要使用 的话show前必须加do和空格,例如:do show * 指定根交换机命令:Switch(config)#spanning-tree vlan 自选参数(VLAN号)root primary 例如: Switch(config)#spanning-tree vlan 1 root primary 需要注意的是:设置根交换机是基于VLAN的 关闭生成树协议命令:Switch(config)#no spanning-tree vlan 自选参数(VLAN 号) 例如: Switch(config)#no spanning-tree vlan 1 1.3 接口配置模式 进入接口配置模式:Switch(config)#interface 端口名称(可选参数) 启用端口:Switch(config-if)#no shutdown 停用端口:Switch(config-if)#shutdown 进入同种类型多端口配置:Switch(config)# interface range fastethernet 0/1-5 进入不同类型多端口配置:Switch(config)#interface range fastethernet 0/1-5,gigabitethernet 0/1-2

cisco交换机配置口令大全

cisco交换机配置口令大全 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 module/port] [detail] 在基于CLI的交换机上启用和浏览CDP信息: switch(enable) set cdp {enable|disable} module/port 为了查看Cisco邻接设备的CDP通告信息: switch(enable) show cdp neighbors[module/port] [vlan|duplex|capabilities|detail] 5.基于IOS的交换机的端口描述: switch(config-if)# description description-string 基于CLI的交换机的端口描述: switch(enable)set port name module/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)# duplex {auto|full|half}

思科交换机路由器命令大全

思科交换机路由器命令 大全 YUKI was compiled on the morning of December 16, 2020

1. 交换机支持的命令:交换机基本状态: 交换机口令设置: switch>enable ;进入特权模式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 ;设置登录口令 xxswitch#exit ;返回命令 交换机VLAN设置:

switch(vlan)#vlan 2 ;建VLAN 2switch(vlan)#no vlan 2 ;删vlan 2switch(config)#int f0/1 ;进入端 口1switch(config-if)#switchport access vlan 2 ; 当前端口加入vlan 2switch(config-if)#switchport mode trunk ;设置为干线switch(config- if)#switchport trunk allowed vlan 1,2 ;设置允许 的vlanswitch(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地址: 交换机显示命令:

Cisco IOS 基本命令

Cisco IOS 基本命令一、基本路由器的检验命令 show version show processes show protocols show mem show ip route show startup-config show running-config show flash show interfaces 二、基本路由配置命令 进入:config terminal/memory/network 配置网络时常采用的命令:copy和load 1.标识:hostname 标识名 2.启动标识:banner 启动标识 3.接口:interface 端口号 4.密码:line 0 6 login passwd 口令 enable password/secret 口令 5.接口:

1)配置端口 interface 端口号 clock rate 时钟速率(64000)/* 在串口中配置*/ bandwidth 带宽(缺省56)/* 在串口中配置*/ media-type 介质类型/* 在以太网口上*/ early-token release /* 在令牌环网口上*/ ring-speed 16 /* 在令牌环网口上*/ no shutdown write memory 2)检验端口 show interfaces show controllers 6.配置环境 1)引导方式 boot system flash IOS-filename boot system tftp IOS-filename tftp-address boot system rom 2)配置Register值 config-register 0x2102 7.查看邻居路由 show cdp interface show cdp neighbors [detail]

Cisco交换机常用配置命令

Cisco交换机常用配置命令 CISCO交换机基本配置 switch>ena 進入特权模式 switch#erasenvram 全部清除交换机的所有配置 switch#reload 重新启动交换机(初始提示符为switch> ) ------------------------------------------------------------------------------------ CISCO交换机基本配置:Console端口连接 用户模式hostname>; 特权模式hostname(config)# ; 全局配置模式hostname(config-if)# ; 交换机口令设置: switch>enable ;进入特权模式 switch#config;进入全局配置模式 switch(config)#hostname cisco ;设置交换机的主机名 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#write 保存配置設置 switch#copy running-config startup-config 保存配置設置,與write一樣switch#exit;返回命令 配置终端过一会时间就会由全局配置模式自动改为用户模式,将超时设置为永不超时 switch#conf t switch(config)#line con 0 switch(config-line)#exec-timeout 0 --------------------------------------------------------------------------------- 交换机显示命令: switch#write;保存配置信息 switch#showvtp;查看vtp配置信息 switch#show run ;查看当前配置信息 switch#showvlan;查看vlan配置信息 switch#showvlan name vlan2 switch#show interface ;查看端口信息

思科交换机配置维护手册

思科交换机配置维护手册

目录

一、端口配置 1.1 配置一组端口 当使用interface range命令时有如下的规则: ?有效的组范围: o vlan从1 到4094 o fastethernet槽位/{first port} - {last port}, 槽位为0 o gigabitethernet槽位/{first port} - {last port},槽位为0 o port-channel port-channel-number - port-channel-number, port-channel号从1到64 ?端口号之间需要加入空格,如:interface range fastethernet 0/1 – 5是有效的,而interface range fastethernet 0/1-5是无效的. ?interface range命令只能配置已经存在的interface vlan ?所有在同一组的端口必须是相同类别的。

见以下例子: Switch# configure terminal Switch(config)# interface range fastethernet0/1 - 5 Switch(config-if-range)# no shutdown 以下的例子显示使用句号来配置不同类型端口的组: Switch# configure terminal Switch(config)# interface range fastethernet0/1 - 3, gigabitethernet0/1 - 2 Switch(config-if-range)# no shutdown 1.2 配置二层端口 1.2.1 配置端口速率及双工模式

思科交换机基本配置(非常详细)

cisco交换机基本配置 1.Cisco IOS简介 Cisco Catalyst系列交换机所使用的操作系统是IOS(Internetwork Operating System,互联网际操作系统)或COS(Catalyst Operating System),其中以IOS使用最为广泛,该操作系统和路由器所使用的操作系统都基于相同的内核和shell。 IOS的优点在于命令体系比较易用。利用操作系统所提供的命令,可实现对交换机的配置和管理。Cisco IOS操作系统具有以下特点: (1)支持通过命令行(Command-Line Interface,简称CLI)或Web界面,来对交换机进行配置和管理。 (2)支持通过交换机的控制端口(Console)或Telnet会话来登录连接访问交换机。 (3)提供有用户模式(user level)和特权模式(privileged level)两种命令执行级别,并提供有全局配置、接口配置、子接口配置和vlan数据库配置等多种级别的配置模式,以允许用户对交换机的资源进行配置。 (4)在用户模式,仅能运行少数的命令,允许查看当前配置信息,但不能对交换机进行配置。特权模式允许运行提供的所有命令。 (5)IOS命令不区分大小写。 (6)在不引起混淆的情况下,支持命令简写。比如enable通常可简约表达为en。 (7)可随时使用?来获得命令行帮助,支持命令行编辑功能,并可将执行过的命令保存下来,供进行历史命令查询。 1.搭建交换机配置环境 在对交换机进行配置之前,首先应登录连接到交换机,这可通过交换机的控制端口(Console)连接或通过Telnet登录来实现。 (1)通过Console口连接交换机 对于首次配置交换机,必须采用该方式。对交换机设置管理IP地址后,就可采用Telnet登录方式来配置交换机。 对于可管理的交换机一般都提供有一个名为Console的控制台端口(或称配置口),该端口采用RJ-45接口,是一个符合EIA/TIA-232异步串行规范的配置口,通过该控制端口,可实现对交换机的本地配置。 交换机一般都随机配送了一根控制线,它的一端是RJ-45水晶头,用于连接交换机的控制台端口,另一端提供了DB-9(针)和DB-25(针)串行接口插头,用于连接PC机的COM1或COM2串行接口。Cisco的控制线两端均是RJ-45水晶头接口,但配送有RJ-45到DB-9和RJ-45到DB-25的转接头。 通过该控制线将交换机与PC机相连,并在PC上运行超级终端仿真程序,即可实现将PC机仿真成交换机的一个终端,从而实现对交换机的访问和配置。 Windows系统一般都默认安装了超级终端程序,对于Windows 2000 Server系统,该程序位于【开始】菜单下【程序】中【附件】的【通讯】群组下面,若没有,可利用控制面板中的【添加/删除程序】来安装。单击【通讯】群组下面的【超级终端】,即可启动超级终端。 首次启动超级终端时,会要求输入所在地区的电话区号,输入后将显示下图所示的连接创建对话框,在【名称】输入框中输入该连接的名称,并选择所使用的示意图标,然后单击确定按钮。 图9-2 超级终端连接创建对话框

思科路由器命令大全详解

一 switch> 用户模式 1:进入特权模式enable switch> enable switch# 2:进入全局配置模式configure terminal switch> enable switch#c onfigure terminal switch(conf)# 3:交换机命名hostname aptech2950 以aptech2950为例 switch> enable switch#c onfigure terminal switch(conf)#hostname aptch-2950 aptech2950(conf)# 4:配置使能口令enable password cisco 以cisco为例 switch> enable switch#c onfigure terminal switch(conf)#hostname aptch2950 aptech2950(conf)# enable password cisco 5:配置使能密码enable secret ciscolab 以cicsolab为例 switch> enable switch#c onfigure terminal switch(conf)#hostname aptch2950 aptech2950(conf)# enable secret ciscolab 6:设置虚拟局域网vlan 1 interface vlan 1 switch> enable switch#c onfigure terminal switch(conf)#hostname aptch2950 aptech2950(conf)# interface vlan 1 aptech2950(conf-if)#ip address 配置交换机端口ip和子网掩码 aptech2950(conf-if)#no shut 是配置处于运行中aptech2950(conf-if)#exit aptech2950(conf)#ip default-gateway 设置网关地址 7:进入交换机某一端口interface fastehernet 0/17 以17端口为例switch> enable switch#c onfigure terminal switch(conf)#hostname aptch2950 aptech2950(conf)# interface fastehernet 0/17 aptech2950(conf-if)# 8:查看命令show switch> enable

思科交换机配置常用命令(精编文档).doc

【最新整理,下载后即可编辑】 Cisco三层交换机配置命令及解释 (2011-07-11 08:54:50) 分类:IT资讯 标签: cisco 杂谈 基本配置 S> enable 进入特权模式 S# configure terminal 进入全局配置模式 S(config)# hostname name 改变交换机名称 S(config)# enable password level level_# password 设置用户口令(level_#=1)或特权口令(level_#=15) S(config)# line console 0 进入控制台接口 S(config-line)# password console_password 接上一条命令,设置控制台口令 S(config)# line vty 0 15 进入虚拟终端 S(config-line)# password telnet_password 接上一条命令,设置Telnet口令 S(config-line)# login 允许Telnet登录 S(config)# enable password|secret privilege_password 配置特权口令(加密或不加密) S(config)# interface ethernet|fastethernet|gigabitethernet slot_#/port_# 进入接口子配置模式 S(config-if)# [no] shutdown 关闭或启用该接口(默认启用) S(config)# ip address IP_address sunbet_mask 指定IP地址 S(config)# ip default-gateway router's_IP_address 指定哪台路由器地址为默认网关 S# show running-config 查看当前的配置 S# copy running-config startup-config 将RAM中的当前配置保存到NVRAM中

思科交换机配置常用命令

Cisco三层交换机配置命令及解释 (2011-07-11 08:54:50) 标签: 分类:IT资讯 cisco 杂谈 基本配置 S> enable 进入特权模式 S# configure terminal 进入全局配置模式 S(config)# hostname name 改变交换机名称 S(config)# enable password level level_# password 设置用户口令(level_#=1)或特权口令(level_#=15) S(config)# line console 0 进入控制台接口 S(config-line)# password console_password 接上一条命令,设置控制台口令 S(config)# line vty 0 15 进入虚拟终端 S(config-line)# password telnet_password 接上一条命令,设置Telnet口令 S(config-line)# login 允许Telnet登录 S(config)# enable password|secret privilege_password 配置特权口令(加密或不加密)S(config)# interface ethernet|fastethernet|gigabitethernet slot_#/port_# 进入接口子配置模式 S(config-if)# [no] shutdown 关闭或启用该接口(默认启用) S(config)# ip address IP_address sunbet_mask 指定IP地址 S(config)# ip default-gateway router's_IP_address 指定哪台路由器地址为默认网关 S# show running-config 查看当前的配置 S# copy running-config startup-config 将RAM中的当前配置保存到NVRAM中 S> show interface [type slot_#/port_#] 查看所有或指定接口的信息 S> show ip 显示交换机的IP配置(只在1900系列上可用) S> show version 查看设备信息 S# show ip interface brief 验证IP配置 S(config-if)# speed 10|100|auto 设置接口速率 S(config-if)# duplex auto|full|half 设置接口双工模式 S> show mac-address-table 查看CAM表 S# clear mac-address-table 清除CAM表中的动态条目 1900(config)# mac-address-table permanent MAC_address type [slot_#/]port_# 在CAM 表中创建静态条目 2950(config)# mac-address-table static MAC_address vlan VLAN_# interface type [slot_#/] port_# 在CAM表中创建静态条目 1900(config)# mac-address-table restricted static MAC_address source_port list_of_allowed_interface 设置静态端口安全措施 1900(config-if)# port secure 启用粘性学习 1900(config-if)# port secure max-mac-count value 设置粘性学习特性能够学到的地址数量(默认132,取值范围是1-132)

CISCO 常用命令解释

视图模式介绍: 普通视图 router> 特权视图 router# /在普通模式下输入enable 全局视图 router(config)# /在特权模式下输入config t 接口视图 router(config-if)# /在全局模式下输入int 接口名称例如int s0或int e0 路由协议视图 router(config-route)# /在全局模式下输入router 动态路由协议名称 1、基本配置: router>enable /进入特权模式 router#conf t /进入全局配置模式 router(config)# hostname xxx /设置设备名称就好像给我们的计算机起个名字 router(config)#enable password /设置特权口令 router(config)#no ip domain lookup /不允许路由器缺省使用DNS解析命令 router(config)# Service password-encrypt /对所有在路由器上输入的口令进行暗文加密router(config)#line vty 0 4 /进入设置telnet服务模式 router(config-line)#password xxx /设置telnet的密码 router(config-line)#login /使能可以登陆 router(config)#line con 0 /进入控制口的服务模式 router(config-line)#password xxx /要设置console的密码 router(config-line)#login /使能可以登陆 2、接口配置: router(config)#int s0 /进入接口配置模式 serial 0 端口配置(如果是模块化的路由器前面加上槽位编号,例如serial0/0 代表这个路由器的0槽位上的第一个接口) router(config-if)#ip add xxx.xxx.xxx.xxx xxx.xxx.xxx.xxx /添加ip 地址和掩码router(config-if)#enca hdlc/ppp 捆绑链路协议 hdlc 或者 ppp 思科缺省串口封装的链路层协议是HDLC所以在show run配置的时候接口上的配置没有,如果要封装为别的链路层协议例如PPP/FR/X25就是看到接口下的enca ppp或者enca fr router(config)#int loopback /建立环回口(逻辑接口)模拟不同的本机网段 router(config-if)#ip add xxx.xxx.xxx.xxx xxx.xxx.xxx.xxx /添加ip 地址和掩码给环回口 在物理接口上配置了ip地址后用no shut启用这个物理接口反之可以用shutdown管理性的关闭接口 3、路由配置: (1)静态路由 router(config)#ip route xxx.xxx.xxx.xxx xxx.xxx.xxx.xxx 下一条或自己的接口router(config)#ip route 0.0.0.0 0.0.0.0 s 0 添加缺省路由 (2)动态路由 rip协议 router(config)#router rip /启动rip协议 router(config-router)#network xxx.xxx.xxx.xxx /宣告自己的网段 router(config-router)#version 2 转换为rip 2版本 router(config-router)#no auto-summary /关闭自动汇总功能,rip V2才有作用 router(config-router)# passive-int 接口名 /启动本路由器的那个接口为被动接口

思科2960交换机配置命令

思科2960交换机配置命令 交换机的端口工作模式一般可以分为三种:Access(普通模式),Multi(多vlan模式),Trunk(中继模式)。1、允许多个vlan的是multi模式,而不是trunk 模式。2、两个都设为trunk模式:一:如果在同一交换机上,则决不会在同一vlan;二:如果是两个交换机上,且两端口物理连接的话,共享vlan信息。但是这两个端口已经被使用,所以只能说,使用与这两个端口相同vlan的端口的计算机是同一虚拟局域网。3、access和multi模式下,端口用于计算机;trunk 模式下,端口用于交换机间连接。所以access和trunk没有可比性。 交换机基本状态: 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 ;返回命令

nb思科交换机常用命令

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 module/port] [detail] 在基于CLI的交换机上启用和浏览CDP信息: switch(enable) set cdp {enable|disable} module/port 为了查看Cisco邻接设备的CDP通告信息: switch(enable) show cdp neighbors[module/port] [vlan|duplex|capabilities|detail] 5.基于IOS的交换机的端口描述: switch(config-if)# description description-string 基于CLI的交换机的端口描述: switch(enable)set port name module/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}

CISCO基本命令

端口速度:设置端口速度为:100Mbps/s 半双工模式 Switch# configure terminal Switch(config)# interface range gigabitethernet0/1 - 2 Switch(config-if-range)# speed 100 Switch(config-if)# duplex half 定义端口聚合并存储到NVRAM:定义名称为enet_list的端口组。 Switch# configure terminal Switch(config)# define interface-range enet_list gigabitethernet0/1 - 2 Switch(config)# end Switch# show running-config | include define Switch# define interface-range enet_list gigabitethernet0/1 – 2 Switch# configure terminal Switch(config)# no define interface-range enet_list Switch(config)# end Switch# show run | include define Switch# 设置端口类型: Switch(config-if)media-type auto-select | rj45 | sfp Switch#show interfaces interface-id transceiver properties

思科交换机配置命令大全

思科交换机配置命令大全 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

相关主题
文本预览
相关文档 最新文档