小编教你思科交换机配置命令有哪些。

怎么配置CISCO交换机?如果没有经常配置交换机的经验,很多命令就会忘记,正如思科交换机配置使用的命令,因为是英文界面,我们需要一个对照,如果你在找这些命令可以阅读下文中提供的步骤,了解思科交换机配置命令有哪些。

思科交换机配置命令有哪些?怎么配置CISCO交换机?

思科交换机配置方法:

一、注意事项:

1、交换机启动需要大约4-5分钟;

2、网线插入交换机接口从黄变为绿需要大约1-2分钟,即进入正常工作模式;

3、建议使用XP系统进行操作,2003默认没有安装超级终端,需要使用安装光盘添加该工具才有;

4、请严格按照以下步骤进行,背景灰色字体为交换机显示信息,蓝色字体为配置命令。

二、准备工作:

1、先保持交换机断电状态;

2、使用调试串口线连接笔记本电脑的串口与交换机背面的CONSOLE接口;

3、打开超级终端:

开始 → 所有程序 → 附件 → 超级终端;

配置超级终端:

名称 → cisco

选择com1或com2(请依照实际情况进行选择)

修改每秒位数为9600

应用 → 确定 → 回车;

三、初始配置:

1、给交换机通电;

2、片刻后会看到交换机的启动信息,直到出现以下配置选项:

Would you like to terminate autoinstall? [yes/no]: no

Would you like to enter the initial configuration dialog? [yes/no]:no

Would you like to terminate autoinstall? [yes/no]: no

四、出现命令窗口:

Switch>

五、备份出厂配置:

Switch>en 进入特权模式

Switch#copy running-config sfbak-config

Destination filename [sfbak-config]?回车

片刻后会出现:

1204 bytes copied in 0.529 secs (2276 bytes/sec)

表示文件备份成功。

六、配置账号密码:

Switch#configure terminal 进入配置子模式

Switch(config)#enable password cisco 设置PASSWORD密码为cisco

Switch(config)#enable secret cisco 设置SECRET密码为cisco

Switch(config)#exit

片刻后会出现:

00:11:26: %SYS-5-CONFIG_I: Configured from console by console

表示将配置保存到了内存中,在后面的配置过程中会出现类似的信息,属于正常现象。

七、创建VLAN:

Switch#show vlan 查看VLAN信息,默认有一个VLAN 1,并且所有端口都属于它

Switch#vlan database 进入VLAN子模式

片刻后会出现:

% Warning: It is recommended to configure VLAN from config mode,

as VLAN database mode is being deprecated. Please consult user

documentation for configuring VTP/VLAN in config mode.

属于正常的警告信息。

Switch(vlan)#vlan 2 创建VLAN2

片刻后会出现:

VLAN 2 added:

Name: VLAN0002

表示VLAN创建成功。

Switch(vlan)#vlan 3 创建VLAN3

Switch(vlan)#exit

八、为VLAN设置IP地址:

为VLAN2设置IP地址

Switch#configure terminal 进入配置子模式

Switch(config)#interface vlan 2 配置IP,VLAN2

Switch(config-if)#ip address 133.37.125.5 255.255.255.0 设置交换机IP(具体IP请依照实际情况设置)

Switch(config-if)#exit

为VLAN3设置IP地址

Switch(config)#interface vlan 3 配置IP,VLAN3

Switch(config-if)#ip address 192.168.1.5 255.255.255.0 设置交换机IP(具体IP请依照实际情况设置)

Switch(config-if)#exit

九、为VLAN划分交换机接口:

配置1-12号电口为VLAN2

Switch(config)#interface range fastEthernet 0/1 - 12 进入F0/1 到 F0/12

Switch(config-if)#Switchport mode access 设成静态VLAN访问模式

Switch(config-if)#Switchport access vlan 2 将此口分给VLAN2

Switch(config-if)#exit

===================

配置13-24号电口为VLAN3

Switch(config)#interface range fastEthernet 0/13 - 24 进入F0/13 到 F0/24

Switch(config-if)#Switchport mode access 设成静态VLAN访问模式

Switch(config-if)#Switchport access vlan 3 将此口分给VLAN3

Switch(config-if)#exit

===================

配置1号光口为VLAN-2

Switch(config)#interface GigabitEthernet 0/1 进入G0/1

Switch(config-if)#Switchport mode access 设成静态VLAN访问模式

Switch(config-if)#Switchport access vlan 2 将此口分给VLAN2

Switch(config-if)#exit

===================

配置2号光口为VLAN-3

Switch(config)#interface GigabitEthernet 0/2 进入G0/2

Switch(config-if)#Switchport mode access 设成静态VLAN访问模式

Switch(config-if)#Switchport access vlan 3 将此口分给VLAN3

Switch(config-if)#exit

Switch(config)#exit

十、关闭VLAN1:

Switch#configure terminal 进入配置子模式

Switch(config)#interface vlan 1 配置VLAN1

Switch(config-if)#shutdown 关闭VLAN1

Switch(config-if)#exit

Switch(config)#exit

Switch#show interface fastethernet0/1 status 查看F0/1网口状态

Switch#show interface fastethernet0/1 查看F0/1网口详细配置

Switch#show running-config 查看全局配置

十一、配置默认网关:

Switch#configure terminal 进入配置子模式

Switch(config)#ip default-gateway 133.37.125.4

Switch(config)#exit

十二、设置使可以远程telnet登陆:

Switch#configure terminal 进入配置子模式

Switch(config)#line vty 0 4

Switch(config-line)#password cisco

Switch(config-line)#login

Switch(config-line)#exit

Switch(config)#exit

十三、保存当前配置:

Switch#copy running-config startup-config

Destination filename [startup-config]?回车

片刻后出现:

Building configuration...

[OK]

表示当前配置保存成功。

十四、交换机配置情况图示:

配置完成,目前整个交换机配置情况如下:

思科交换机配置命令有哪些?怎么配置CISCO交换机?

十五、其它相关知识:

1、交换机与交换机/路由器间级联通信:

当级联的设备端口设置了trunk或划分了VLAN等情况,可能需要修改级联端口的工作模式为trunk模式才能实现相互之间的通信。

如果是与电口级联,可以修改1号网口为trunk工作模式,使用该接口进行级联:

Switch#configure terminal 进入配置子模式

Switch(config)#interface fastethernet0/1 进入F0/1口

Switch(config-if)#switchport trunk encapsulation dot1q

Switch(config-if)#switchport mode trunk 设成TRUNK口

Switch(config-if)#switchport trunk allowed vlan all 允许所有VLAN从此口通过

Switch(config-if)#exit

Switch(config)#exit

2、如果是与光纤接口级联,可以修改1号光纤接口为trunk工作模式,使用该接口进行级联:

Switch#configure terminal 进入配置子模式

Switch(config)#interface GigabitEthernet 0/1 进入G0/1

Switch(config-if)#switchport trunk encapsulation dot1q

Switch(config-if)#switchport mode trunk 设成TRUNK口

Switch(config-if)#switchport trunk allowed vlan all 允许所有VLAN从此口通过

Switch(config-if)#exit

Switch(config)#exit

执行后请按照第13步中的描述保存当前配置。

3、WEB方式检查交换机状态:

如果需要对交换机的状态进行实施查看,可以通过URL:http://192.168.1.5 或 http://133.37.125.5

账号:admin

密码:cisco

登陆后进行查看。

4、恢复交换机出厂设置:

Switch>en 进入特权模式

Switch#write erase

Erasing the nvram filesystem will remove all configuration files! Continue? [confirm]回车

[OK]

Erase of nvram: complete

00:36:19: %SYS-7-NV_BLOCK_INIT: Initialized the geometry of nvram

Switch# reload

Proceed with reload? [confirm]回车

00:36:59: %SYS-5-RELOAD: Reload requested by console. Reload Reason: Reload Command.

片刻之后,交换机会进行重启,并在重启后恢复为出厂设置。

5、远程通过telnet登陆交换机终端:

将本机IP设置为与交换机VLAN2或VLAN3同一个网段;

开始 → 运行 → cmd;

执行telnet 133.37.125.5 或 telnet 192.168.1.5 即可。

以上便是关于思科交换机配置的一些命令,对于只需要配置一整栋民居或网吧电脑的用户而言已经足够用了。

本文来自网络投稿,来自作者春天。不代表酷牛教程立场,如若转载,请注明出处:https://www.xukn.com/344808.html

(0)
春天春天
上一篇 2023-06-16 17:15
下一篇 2023-06-16 17:15

相关推荐

  • 分享交换机和路由器的区别有哪些

    日常生活中无论是工作学习,还是娱乐休闲,都离不开网络。那想要网络好,路由器是必不可少的,此外交换机也是和网络有关的一种设备。交换机是什么?交换机和路由器有什么区别吗?下面小编就来给...

    2023-07-13
    0160
  • 分享交换机接无线路由器的设置方法。

    现在是网络信息时代,上网的人越来越多,然而路由器已成为连接网络最常用的设备。那么你们知道交换机接无线路由器怎么设置吗?设置交换机接无线路由器有什么方法吗?现在小编就和大家说一下交换...

    2023-06-13 PC教程
    0220
  • 教你Win7如何配置交换机实现共同上网

    交换机是什么?交换机是一种用于电(光)信号转发的网络设备,如果大家想要实现共同上网,那么就需要配置交换机。应该还有很多人不知道怎么配置交换机吧。那么这里小编就来教教大家具体的方法。...

    2023-07-12
    0170
  • 小编教你Win7系统路由器怎么当交换机用。

    路由器是我们很常见的一个外部设备,有了它我们就可以使用到WiFi,但是有些人为了省钱想把路由器当做交换机,那么要怎么做呢?Win7系统路由器要怎么当交换机用呢?不懂的朋友赶紧看看小...

    2023-06-12 PC教程
    0210

发表回复

登录后才能评论