1. 首页
  2. 思科3560交换机配置(交换机配置案例详解)

思科3560交换机配置(交换机配置案例详解)

简介:关于思科3560交换机配置(交换机配置案例详解)的相关疑问,相信很多朋友对此并不是非常清楚,为了帮助大家了解相关知识要点,小编为大家整理出如下讲解内容,希望下面的内容对大家有帮助!
如果有更好的建议或者想看更多关于技术大全及相关资讯,可以多多关注茶馆百科网。

今天,我们将详细了解Cisco交换机配置命令。

1. Cisco交换机基本配置命令

1:进入特权模式enable

switch enable

switch#

2:进入全局配置模式。配置终端

switch enable

Switch # c配置终端

switch(conf)#

3:交换机命名主机名aptech2950以“aptech2950”为例

switch enable

Switch # c配置终端

switch(conf)#hostname aptch-2950

aptech2950(conf)#

4:配置启用密码。enable password cisco以“cisco”为例

switch enable

Switch # c配置终端

switch(conf)#hostname aptch2950

aptech2950(conf)# enable password cisco

5: enable password enable secret ciscolab以“cicsolab”为例

switch enable

Switch # c配置终端

switch(conf)#hostname aptch2950

aptech2950(conf)# enable secret ciscolab

6:创建多个vlan

1. 创建多个vlan

Switchenable(进入特权模式)

Switch#vlan data(进入vlan配置模式)

Switch(vlan)#vlan 10 name IT (vlan 10)

Switch(vlan)#vlan 20 name HR (vlan 20)

Switch(vlan)#vlan 30 name FIN (vlan 30)

Switch(vlan)#vlan 40 name LOG (vlan 40)

Switch(vlan)#exit

7:设置vlan 1

switch enable

Switch # c配置终端

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设置网关地址

8:进入交换机的某个端口。interface fastehernet 0/17本节以端口17为例进行说明

switch enable

Switch # c配置终端

switch(conf)#hostname aptch2950

aptech2950(conf)# interface fastehernet 0/17

aptech2950(conf-if)#

9:查看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地址表自动老化时间

10: switch restore factory default恢复命令

switch enable

switch# erase startup-configure

switch# reload

11:设置双工模式

switch enable

Switch # c配置终端

switch2950(conf)#hostname aptch-2950

aptech2950(conf)# interface fastehernet 0/17以Port 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包的统计信息

“显示CDP邻居列表”列出与该设备相连的cisco设备

12:开关telnet远程登录设置:

switchen

Switch # c配置终端

switch(conf)#hostname aptech-2950

aptech2950(conf)#enable password 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

0

主机设置:

ip 192.168.1.2主机的ip地址必须与交换机端口的ip地址在同一网络中

netmask 255.255.255.0

gateway -way 192.168.1.1网关地址为交换机端口地址

运行:

telnet 192.168.1.1

进入telnet远程登录界面

password : edge

aptech2950en

password: cisco

aptech#

三层交换机用于实现不同vlan之间的通信

我们已经看到了思科交换机的基本配置命令。现在让我们看一下配置示例。

具体情况如下:

由于Pc1和pc2在不同的交换机上,且处于不同的vlan中,因此无法相互通信。那我该怎么办呢?

一台S3550-24(三层交换机),一台S2126, pc1在vlan10, pc2在vlan20,如下图所示。

vlan间通信的实验拓扑

配置如下:

1. 在SwitchA上创建VLAN 20,并将接口F0/15加入VLAN 20。

SwitchAenable

SwitchA#configure terminal

SwitchA(config)#vlan20 //创建VLAN 20

SwitchA(config-vlan)#name vlan20 //将VLAN 20命名为vlan20

SwitchA(config)#interface f0/15 //切换到f0/15配置模式

switchcha (config-if)#switchport access VLAN 20 //将F0/15端口接入VLAN 20

SwitchA #showvlan id 20 //是否创建了VLAN 20,并将F0/15端口加入到VLAN 20中。

2. 在SwitchA上将与SwitchB相连的端口(本例中为F0/24)设置为tag vlan模式。

SwitchAenable

SwitchA#configure terminal

SwitchA (config)#interface f0/24 //切换到接口配置模式

SwitchA (config-if)#switchport mode trunk //将F0/24端口设置为tag vlan模式

3.在SwitchB上创建VLAN 10,并将接口F0/5加入VLAN 10。

SwitchAenable

SwitchA#configure terminal

SwitchB(config)# VLAN 10 //创建VLAN 10

SwitchB (config-vlan)#name vlan10 //将VLAN 10命名为VLAN

SwitchB (config)#interface f0/5 //切换到接口f0/5的配置模式

SwitchB (config-if)#switchport access vlan10!将接口F0/5加入VLAN 10

switchb# show vlan id 10 //查看已创建vlan 10,并将F0/5端口加入vlan 10

4. 将tag vlan模式设置为SwitchB上与SwitchA相连的端口(本例中为F0/24)。

SwitchAenable

SwitchA#configure terminal

SwitchB (config)#interface f0/24 //进入接口配置模式

SwitchB (config-if)#switchport mode trunk //设置F0/24端口为tag vlan模式

SwitchB (config)#show interfaces f0/24 switch //检查f0/24接口是否设置为tag vlan模式。

5. 配置三层交换机,实现vlan间通信,并开启三层交换机路由功能

SwitchAenable

SwitchA#configure terminal

SwitchA(config)#ip routing //开启三层交换机路由功能

SwitchA(config) #interface vlan10 //创建虚拟接口vlan10

SwitchA(config-if) #ip address 192.168.10.254 255.255.255.0 //配置vlan10的虚拟接口ip地址

SwitchA(config) #interface vlan20 //创建虚拟接口vlan20

配置vlan20虚拟接口的ip地址

SwitchA(config-if) #ip address 192.168.20.254 255.255.255.0 //配置vlan20虚拟接口的ip地址

5. 配置默认网关

设置PC1的默认网关为192.168.10.254,PC2的默认网关为192.168.20.254

这样pc1和pc2就可以互相通信了。

本文主要介绍了关于思科3560交换机配置(交换机配置案例详解)的相关养殖或种植技术,栏目还介绍了该行业生产经营方式及经营管理,关注发展动向,注重系统性、科学性、实用性和先进性,内容全面新颖、重点突出、通俗易懂,全面给您讲解技术怎么管理的要点,是您致富的点金石。
以上文章来自互联网,不代表本人立场,如需删除,请注明该网址:http://23.234.50.4:8411/article/1579816.html