二层交换机基本配置详解.doc
二层交换机常用配置命令

[Qd1w1_HuiYi-Ethernet1/0/21]packet-filter inbound ip-group 3000
注:禁止172.28.3.42访问218.74.122.66/74,先添加3000控制策略,设置策略内容,进入172.28.3.42对应的交换机端口,激活这一策略。
另:删除其中某一策略。
[Qd1w1_HuiYi-Ethernet1/0/21]undo packet-filter inbound ip-group 3000 rule 1
删除用户DHCP服务:
[Navigator]undo dhcp server ip-pool cyc
配备路由器DNS服务器地址:
[Navigator]dns server 218.74.122.74
ACL访问控制:
[Qd1w1_HuiYi]acl num 3000
[Qd1w1_HuiiYi-acl-adv-3000]rule 0 deny ip source 172.28.3.42 0 destination 218.74.122.66 0
[Navigator]local-user cyc(注“cyc”为新建用户)
[Navigator-luser-cyc]password cipher cyc(注"cyc"为新建用户密码)
[Navigator-luser-cyc]level 3(设置用户权限为3)
[Navigator-luser-cyc]service-type telnet(设置用户模式,作用环境为telnet)
二层交换机配置 (20页)

配置过程
■ 对Cisco3560的配置
■ 配置Cisco 2960
附录
■ 创建一个用户VLAN
注意: 1、指定的vlan id假如不存在, 就会创建该vlan,并进入VLAN配置 模式。 2、也可不显示创建vlan,当把端口划入某个vlan时,如果指定的 vlan不存在,也会自动创建该vlan。
■ 配置单个端口 ■ 配置多个端口
感谢您的聆听!
Switch type: Cisco 2960
配置线: Switch(Console)/PC(RS232)
直连线:
Switch(fastEthernet 0/1) / PC (fastEthernet0)
PC
配置过程
■ 为了通过网络对交换机进行管理,需对交换机设置Telnet登 录。配置步骤如下:
PC2: IP:192、168.1.3 Submask:255.255.255.0 default gateway:192.168.1.1
PC3: Switch_2 IP:192、168.1.4
Submask:255.255.255.0 default gateway:192.168
PC4: IP:192、168.1.5 Submask:255.255.255.0 default gateway:192.168
二层交换机配置
Cisco交换机的工作模式
■ Cisco交换机管理界面分成若干种不同的工作模式。用 户当前所处的工作模式决定了用户能够使用的命令。
■ 不同工作模式之间的切换
模式
提示符
用户模式 switch>
特权模式 switch#
全局配置模式 switch(config)#
说明
二层交换机结构和参数详解

二层交换机结构和参数详解(1)交换机的组成:交换机由CPU,内存,非易失性RAM,接口电路组成,和电脑终端一样,只是缺少显卡和显示器。
(2)交换机的操作系统:(3)端口:48*10/100/1000Base-T以太网端口,4*1000 Base-X SFP光口。
(备注:使用H3C S5000PV5-EI 系列千兆管理型交换机举例说明)表明此交换机有48个10/100/1000M自适应网口(有时也称为电口,因传输电信号而得名)和4个1000M光口(需要搭配光纤模块才能使用)(4)交换容量:336Gbps交换容量,又称背板带宽,是交换机接口处理器或接口卡和数据总线间所能吞吐的最大数据量。
一台交换机的交换容量越高,所能处理数据的能力就越强,但同时设计成本也会越高。
类似高速公路,路越宽,通信能力就越强。
要满足此交换机所有端口满速率全双工通信至少需要背板带宽为:48 X 1000Mbps X 2 + 4 X 1000Mbps X 2 = 104Gbps。
我们看到S5000PV5-EI这台交换机的交换容量官方标注为336Gbps,所以此交换机可以达到所有端口满速率全双工通信。
(5)包转发率:120Mpps交换机的包转发率表示交换机转发数据包的能力,其单位一般为pps(包/每秒)。
类似高速公路收费站,决定网络的实际性能。
要满足此交换机所有端口全线速通信(对于一个全双工千兆接口达到线速时要求:包转发率=1000Mbps/(84*8)=1.488Mpps)至少需要包转发率为:48 X 1.488Mpps + 4 X 1.488Mpps = 77.376 Mpps。
我们看到S5000PV5-EI这台交换机的包转发率官方标注为:120Mpps ,可以达到线速交换(数据包到达交换机端口后能直接转发出区)。
(6)管理端口:1个Console口Console口是我们配置刚出厂的交换机需要使用的一个管理口,需要用到Console线,如下图:(USB转Console调试线)(7)MAC地址表大小:8KMAC地址表用于存放MAC地址,够用就行,大容量对交换机性能没有提升。
佛山科学技术学院-计算机网络-二层交换机基本配置

佛⼭科学技术学院-计算机⽹络-⼆层交换机基本配置佛⼭科学技术学院实验报告课程名称计算机⽹络原理实验项⽬⼆层交换机基本配置⼀、实验⽬的1)掌握ip地址的分配和划分⼦⽹的⽅法;2)掌握⼆层交换机的启动和基本设置的操作;3)掌握配置⼆层交换机的常⽤命令;4)了解VLAN的概念及⼯作原理;5)能够实现跨⼆层交换机不同VLAN之间计算机的互通。
⼆、实验原理1)⼆层交换机的启动和基本设置的操作;2)实现跨交换机VLAN互访三、实验步骤⼀、常规连接配置交换机PC机1台,Console电缆1条,通过Console电缆把PC机的COM端⼝和交换机的Console端⼝连接起来, 如图2-1所⽰。
图2-1 实验组⽹图通过CONSOLE线连接交换机CONSOLE⼝,打开CRT软件,建⽴连接。
图2-2 CONSOLE配置⼆、实验室CII云教学平台环境10、VLAN的配置:(1)添加⼀个VLANS2126G(config)#vlan <1-4094> S2126G(config-vlan)#(2)为VLAN命名(可选)S2126G(config-vlan)#name 11、将交换机端⼝分配到VLAN(1)配置Port VLANSwitch(config-if)#switchport access vlan <1-4094>(2)配置Tag VLANSwitch(config-if)#switchport mode trunk12、配置本地(native)VLANSwitch(config-if)#switchport trunk native vlan <1-4094>13、从主⼲链路中清除VLANSwitch(config-if)#switchport trunk allowed vlan except14、VLAN的验证:(1)显⽰全部的VLAN:Switch#show vlan(2)显⽰单独的VLAN :Switch#show vlan id <1-4094>交换机配置实例说明:switch>enswitch#configure terminalswitch(config)#interface fastethernet 0/1 //进⼊F0/1的端⼝模式,也有可能是gigthernet接⼝,具体⽤show running-config 查看switch(config-if)#speed 10 //配置端⼝速率为10Mswitch(config-if)#duplex half //配置端⼝为半双⼯模式switch(config-if)#no shutdown //开启该端⼝,使端⼝转发数据switch(config-if)#exitswitch# show interface fastethernet 0/1 //查看F0/1的配置信息switch#show version //查看交换机的版本信息switch#show mac-address-table //查看交换机的MAC地址表,将交换机1-5端⼝连接PC1-8中的某⼏台,再查看地址表是否有变化?switch# configure terminalswitch(config)#interface vlan 1 //默认交换机所有端⼝都属于VLAN 1,通过查看交换机端⼝可以验证switch(config-if)#ip address 192.168.1.1 255.255.255.0switch(config-if)#no shutdownswitch(config-if)#exitswitch(config-if)#ping 192.168.1.2 //192.168.1.2为连接交换机端⼝的PC1主机,查看是否能够ping?随后,再连接⼀台PC2,配置同⽹段IP地址,两台主机互ping,验证结果,模拟实际通过交换机连接多台主机特别说明:后续所有涉及到对PC1-PC8配置验证IP地址,都必须在USB⽹卡上进⾏配置,学⽣PC机有两张⽹卡,其中PCI⽹卡主要⽤来连接外⽹,连接云平台;USB⽹卡连接内⽹,⽤来进⾏实验验证,如果需要对USB⽹卡的⽹关进⾏配置,需要将PCI⽹卡的⽹关删除,否则,会影响实验效果。
二层交换机的vlan配置

首先,说明一下本例子。
vlan之间通讯需要用到的设备有:二层交换机两个(当然三层也可以,不过很贵~~),路由器/3层交换机一台(支持802.1q协议),pc4台。
试验环境为Cisco虚拟软件packet trcer 4.1二层交换机:首先要明白一点,对于vlan通讯来说,二层交换机上vlan没有必要配ip地址,唯一需要的是vlan1(配置的ip地址为管理地址)。
其次,二层交换机没有ip地址。
当然vlan可以设置ip,但是端口什么的没有ip。
虽然这点很简单,但是,很多人经常忘记,至少我身边的同学好多都不知道这个事实。
还有,这点很重要,二层交换机只能同一时刻存在一个vlan。
最后,要保证vlan之间可以相互通讯的前提,就是二层与路由的接口要设置为trunk模式。
路由器:由于要实现vlan之间通讯,所以路由器需要用到802.1q协议,来封装端口。
(下面开始配置)S1:vlan 1 :IP :10.1.0.2/16vlan 10: name--V1 下属pc:IP:192.168.1.x/24 网关 192.168.1.254/24vlan 20: name--V2 下属pc:IP:192.168.2.x/24 网关 192.168.2.254/24S2:vlan1:IP:10.2.0.2/16vlan 30: name--V3 下属pc:IP:192.168.3.x/24 网关 192.168.3.254/24vlan 40: name--V4 下属pc:IP:192.168.4.x/24 网关 192.168.4.254/24R1:F0/0:IP:10.1.0.1/16虚接口地址:F0/0.1: IP:192.168.1.254/24F0/0.2: IP:192.168.2.254/24F0/1:IP:10.2.0.1/16虚接口地址:F0/1.1: IP:192.168.3.254/24F0/1.2: IP:192.168.4.254/24拓扑图如下:S1配置如下:Switch>enSwitch#conf tEnter configuration commands, one per line. End with CNTL/Z.Switch(config)#hostSwitch(config)#hostname S1S1(config)#vlan 10S1(config-vlan)#name V1S1(config-vlan)#exitS1(config)#vlan 20S1(config-vlan)#name V2S1(config-vlan)#int vlan 1S1(config-if)#ip address 10.1.0.2 255.255.0.0S1(config-if)#no shut%LINK-5-CHANGED: Interface Vlan1, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan1, changed state to up S1(config-if)#int f0/2S1(config-if)#switchport mode accessS1(config-if)#switchport access vlan 10S1(config-if)#no shutS1(config-if)#int f0/3S1(config-if)#switchport mode accessS1(config-if)#switchport access vlan 20S1(config-if)#no shutS1(config-if)#int f0/1S1(config-if)#switchport mode trunkS1(config-if)#switchport trunk allowed vlan allS1(config-if)#no shutS1(config-if)#end%SYS-5-CONFIG_I: Configured from console by consoleS1#sh vlanVLAN Name Status Ports---- -------------------------------- --------- ------------------------------- 1 default active Fa0/1, Fa0/4, Fa0/5, Fa0/6Fa0/7, Fa0/8, Fa0/9, Fa0/10Fa0/11, Fa0/12, Fa0/13, Fa0/14Fa0/15, Fa0/16, Fa0/17, Fa0/18Fa0/19, Fa0/20, Fa0/21, Fa0/22Fa0/23, Fa0/2410 V1 active Fa0/220 V2 active Fa0/31002 fddi-default active1003 token-ring-default active1004 fddinet-default active1005 trnet-default activeVLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------ 1 enet 100001 1500 - - - - - 0 010 enet 100010 1500 - - - - - 0 020 enet 100020 1500 - - - - - 0 01002 enet 101002 1500 - - - - - 0 01003 enet 101003 1500 - - - - - 0 01004 enet 101004 1500 - - - - - 0 01005 enet 101005 1500 - - - - - 0 0S2设置如上:Switch>enSwitch#conf tEnter configuration commands, one per line. End with CNTL/Z.Switch(config)#hostname S2S2(config)#vlan 30S2(config-vlan)#name V3S2(config-vlan)#no shut^% Invalid input detected at '^' marker.S2(config-vlan)#vlan 40S2(config-vlan)#name V4S2(config-vlan)#int vlan 1S2(config-if)#ip address 10.2.0.2 255.255.0.0S2(config-if)#no shut%LINK-5-CHANGED: Interface Vlan1, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan1, changed state to upS2(config-if)#int f0/2S2(config-if)#swit m aS2(config-if)#swit access vlan 30S2(config-if)#no shutS2(config-if)#int f0/3S2(config-if)#swit m aS2(config-if)#swit a vlan 40S2(config-if)#no shutS2(config-if)#int f0/1S2(config-if)#swit m tS2(config-if)#swit trunk allowed vlan allS2(config-if)#no shutS2(config-if)#end%SYS-5-CONFIG_I: Configured from console by consoleS2#sh vlanVLAN Name Status Ports---- -------------------------------- --------- ------------------------------- 1 default active Fa0/1, Fa0/4, Fa0/5, Fa0/6Fa0/7, Fa0/8, Fa0/9, Fa0/10Fa0/11, Fa0/12, Fa0/13, Fa0/14Fa0/15, Fa0/16, Fa0/17, Fa0/18Fa0/19, Fa0/20, Fa0/21, Fa0/22Fa0/23, Fa0/2430 V3 active Fa0/240 V4 active Fa0/31002 fddi-default active1003 token-ring-default active1004 fddinet-default active1005 trnet-default activeVLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------1 enet 100001 1500 - - - - - 0 030 enet 100030 1500 - - - - - 0 040 enet 100040 1500 - - - - - 0 01002 enet 101002 1500 - - - - - 0 01003 enet 101003 1500 - - - - - 0 01004 enet 101004 1500 - - - - - 0 01005 enet 101005 1500 - - - - - 0 0路由器R1设置如下:Router>enableRouter#conf tEnter configuration commands, one per line. End with CNTL/Z.Router(config)#hostname R1R1(config)#R1(config)#int f0/0R1(config-if)#ip address 10.1.0.1 255.255.0.0R1(config-if)#no shut%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to upR1(config-if)#int f0/1R1(config-if)#ip address 10.1.1.1 255.255.0.0% 10.1.0.0 overlaps with FastEthernet0/0R1(config-if)#ip address 10.2.0.1 255.255.0.0R1(config-if)#no shut%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to upR1(config-if)#int f0/0.1%LINK-5-CHANGED: Interface FastEthernet0/0.1, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0.1, changed state to upR1(config-subif)#encapsulation dot1q 10R1(config-subif)#ip address 192.168.1.254 255.255.255.0R1(config-subif)#no shutR1(config-subif)#int f0/0.2%LINK-5-CHANGED: Interface FastEthernet0/0.2, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0.2, changed state to upR1(config-subif)#encapsulation dot1q 20R1(config-subif)#ip address 192.168.2.254 255.255.255.0R1(config-subif)#no shutR1(config-subif)#int f0/1.1%LINK-5-CHANGED: Interface FastEthernet0/1.1, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1.1, changed state to upR1(config-subif)#encapsulation dot1q 30R1(config-subif)#ip address 192.168.3.254 255.255.255.0R1(config-subif)#no shutR1(config-subif)#int f0/1.2%LINK-5-CHANGED: Interface FastEthernet0/1.2, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1.2, changed state to upR1(config-subif)#encapsulation dot1q 40R1(config-subif)#ip address 192.168.4.254 255.255.255.0R1(config-subif)#no shutR1(config-subif)#end%SYS-5-CONFIG_I: Configured from console by consoleR1#show ip routeCodes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGPi - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area* - candidate default, U - per-user static route, o - ODRP - periodic downloaded static routeGateway of last resort is not set10.0.0.0/16 is subnetted, 2 subnetsC 10.1.0.0 is directly connected, FastEthernet0/0C 10.2.0.0 is directly connected, FastEthernet0/1C 192.168.1.0/24 is directly connected, FastEthernet0/0.1C 192.168.2.0/24 is directly connected, FastEthernet0/0.2C 192.168.3.0/24 is directly connected, FastEthernet0/1.1C 192.168.4.0/24 is directly connected, FastEthernet0/1.2现在,可以设置PC的属性了,别忘了四处ping下,检查是否设置成功。
二层交换机配置

Switch(Config)#interface vlan 30
Switch(Config-If-Vlan30)#ip address 192.168.30.100 255.255.255.0
l 设置TRUNK端口
与二层交换机相连接的三层交换机的端口必须设置为TRUNK端口。
3、终端PC的配置
每一台终端PC都要将网关设置为:属于本VLAN的三层交换机VLAN接口的IP地址。
二、利用三层交换机实现VLAN间路由
1、 三层交换机的配置
l 创建相应的VLAN
Switch(Config)#vlan 10
Switch(Config)#vlan 20
Switch(Config)#vlan 30
l 创建VLAN接口并设置IP地址;
Switch(Config)#interface vlan 10
Switch(Config-If-Vlan10)#ip address 192.168.10.100 255.255.255.0
Switch(Config)#interface vlan 20
Switch(Config-If-Vlan20)#ip address 192.168.20.100 255.255.255.0
2、二层交换机的配置
与路由器相连接的二层交换机的端口必须设置为TRUNK端口。
Switch(Config)# Int f0/5
Switch(Config-if)# Switchport mode trunk
3、终端PC的配置
每一台终端PC都要将网关设置为:属于本VLAN的路由器子接口的IP地址。
Switch(Config)#Int f0/1
二层交换机基本配置命令

二层交换机基本配置命令二层交换机是指只支持OSI第二层(数据链路层)交换技术的交换机,二层交换技术发展比较成熟,二层交换机属数据链路层设备,可以识别数据包中的MAC地址信息,根据MAC地址进行转发,并将这些MAC地址与对应的端口记录在自己内部的一个地址表中。
下面给大家介绍二层交换机基本配置命令,一起来了解一下吧!二层交换机基本配置命令1、进入特权模式switch> (用户模式)进入特权模式 enableswitch> enable 按回车键Enterswitch# (特权模式 )2、进入全局配置模式进入全局配置模式 configure terminalswitch#configure terminal 按回车键EnterSwitch(config)# (全局配置模式)3、交换机命名交换机命名 hostname CY3C_HTLZYQ_P6ZHSA (以CY3C_HTLZYQ_P6ZHSA为例)Switch(config)#hostname CY3C_HTLZYQ_P6ZHSA 按回车键EnterCY3C_HTLZYQ_P6ZHSA(config)#4、创建Vlan创建VlanCY3C_HTLZYQ_P6ZHSA(config)#Vlan +n (n代表Vlan编号正常范围2―1000)按回车键EnterCY3C_HTLZYQ_P6ZHSA(config-vlan)#name +名字 (给Vlan创建个名字)5、创建管理Vlan和管理IP地址创建管理Vlan和管理IP地址CY3C_HTLZYQ_P6ZHSA(config)#Vlan +nCY3C_HTLZYQ_P6ZHSA(config-vlan)#name +名字 (根据自己想要的结果命名)按exit退出CY3C_HTLZYQ_P6ZHSA(config)#interface Vlan +n (n代表Vlan编号正常范围2―1000)按回车键EnterCY3C_HTLZYQ_P6ZHSA(config-if)#ip address +管理ip地址 +子网掩码按回车键EnterCY3C_HTLZYQ_P6ZHSA(config-if)#no shutdown (开启 Vlan)6、设定此交换端口为trunk口设定此交换端口为trunk口CY3C_HTLZYQ_P6ZHSA(config)#interface +端口(比如F0/1) 按回车键EnterCY3C_HTLZYQ_P6ZHSA(config-if)#switchport mode trunk ( 设定此交换端口为trunk即中继端口)按回车键EnterCY3C_HTLZYQ_P6ZHSA(config-if)#no shutdown7、把端口划分到Vlan内把端口划分到Vlan内CY3C_HTLZYQ_P6ZHSA(config)#interface +端口【(比如F0/5) ( 把单个端口划分到Vlan内)】CY3C_HTLZYQ_P6ZHSA(config-if)#switchport mode access (设定f 0/1端口的接入类型为接入端口即access ports.)CY3C_HTLZYQ_P6ZHSA(config-if)#switchport access vlan +n ((把此端口即接入端口划分到vlan n中,n为vlan 号)按回车键EnterCY3C_HTLZYQ_P6ZHSA(config-if-range)#no shutdown或者CY3C_HTLZYQ_P6ZHSA(config)#interface range +端口【(比如FO/5 - 10 ) 把多个端口同时划分到一个Vlan内】CY3C_HTLZYQ_P6ZHSA(config-if-range)#switchport mode accessCY3C_HTLZYQ_P6ZHSA(config-if-range)#switchport access Vlan +n (n 代表Vlan编号正常范围2―1000)按回车键EnterCY3C_HTLZYQ_P6ZHSA(config-if-range)#no shutdown8、配置交换机远程密码配置交换机远程密码CY3C_HTLZYQ_P6ZHSA(config)#enable password cisco (配置使能密码:cisco)CY3C_HTLZYQ_P6ZHSA(config)#line vty 0 5CY3C_HTLZYQ_P6ZHSA(config-line)#password cisco (配置用户密码:cisco)CY3C_HTLZYQ_P6ZHSA(config-line)#loginCY3C_HTLZYQ_P6ZHSA#write (进行配置保存,避免交换机断电后配置消失)9、一些查看交换机的'简单命令一些查看交换机的简单命令(1):show run 查看交换机配置信息(2):show Vlan 查看Vlan详细信息(3):show ip interface brief 查看接口信息(4):show cdp nerghbors 显示直连的相邻cisco设备及其详细信息(5):show cdp neighbors detail 显示ip地址和IOS版本和类型,并且包括show cdp neighbor命令的所有信息。
华为二层交换机开局配置实例讲解

业务名称二层交换机接入工程业务需求描述根据用户需求,二层交换机,现在无管理VLAN和管理地址,为了便于管理申请机房给下数据。
接入机房:。
数据资源:管理地址:221.221.73.254 网关:221.221.73.225 掩码:255.255.255.224 管理VLAN:144 光路资源:期望完成时间:2013-03-04反馈结果(具体调测资源情况)拟稿人李传输联系人发出时间2013-02-25 数据联系人调测人签字交换联系人完成日期线路联系人>sys#vlan 144quitinterface Vlanif 144 // Vlanif 即vlan interface可能因交换机版本、型号不同不太一样,也有可能是Vlan-interface,可以输入interface ?,然后根据交换机的提示再输入。
ip address 221.221.73.254 255.255.255.224quitip route-static 0.0.0.0 0.0.0.0 221.221.73.225#interface **** //上联口的端口号,根据交换机版本、型号不同不太一样,如百兆端口ethernet 0/0/24,或者千兆端口GigabitEthernet 1/2/1,具体情况看上联口是哪个,再输入interface ethernet ?(或者interface gigabitethernet ?)来输入后面的数字。
port link-type trunkport trunk allow-pass vlan 144undo port trunk allow-pass vlan 1配置到这里,ping一下网关,如果能ping通就可以远程管理了,return到>下,save,Y。
后面为创建telnet用户名、密码、登录方式,根据交换机不同不太一样,可以尝试配置第一种:#aaalocal-user admin password simple adminlocal-user admin privilege level 3local-user admin service-type telnetuser-interface vty 0 4authentication-mode aaa第二种:#local-user adminpassword simple adminservice-type telnetlevel 3user-interface vty 0 4authentication-mode schemeprotocol inbound telnet。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
二层交换机基本配置詳解
二层交换机基本配置詳解的方法
1、进入特权模式
switch (用户模式)
进入特权模式enable
switch enable 按回车键Enter
switch# (特权模式)
2、进入全局配置模式
进入全局配置模式configure terminal
switch#configure terminal 按回车键Enter
Switch(config)# (全局配置模式)
3、交换机命名
交换机命名hostname CY3C_HTLZYQ_P6ZHSA (以CY3C_HTLZYQ_P6ZHSA为例)
Switch(config)#hostname CY3C_HTLZYQ_P6ZHSA 按回车键Enter
CY3C_HTLZYQ_P6ZHSA(config)#
4、创建Vlan
创建Vlan
CY3C_HTLZYQ_P6ZHSA(config)#Vlan +n (n代表Vlan编号正常范围2 1000)按回车键Enter
CY3C_HTLZYQ_P6ZHSA(config-vlan)#name +名字(给Vlan创建个名字)
5、创建管理Vlan和管理IP地址
创建管理Vlan和管理IP地址
CY3C_HTLZYQ_P6ZHSA(config)#Vlan +n
CY3C_HTLZYQ_P6ZHSA(config-vlan)#name +名字(根据自己想要的结果命名)按exit退出
CY3C_HTLZYQ_P6ZHSA(config)#interface Vlan +n (n代表Vlan编号正常范围2 1000)按回车键Enter
CY3C_HTLZYQ_P6ZHSA(config-if)#ip address +管理ip地址+子网掩码按回车键Enter
CY3C_HTLZYQ_P6ZHSA(config-if)#no shutdown (开启Vlan)
6、设定此交换端口为trunk口
设定此交换端口为trunk口
CY3C_HTLZYQ_P6ZHSA(config)#interface +端口(比如F0/1) 按回车键Enter
CY3C_HTLZYQ_P6ZHSA(config-if)#switchport mode trunk ( 设定此交换端口为trunk即中继端口)按回车键Enter
CY3C_HTLZYQ_P6ZHSA(config-if)#no shutdown
7、把端口划分到Vlan内
把端口划分到Vlan内
CY3C_HTLZYQ_P6ZHSA(config)#interface +端口【(比如F0/5) ( 把单个端口划分到Vlan内)】
CY3C_HTLZYQ_P6ZHSA(config-if)#switchport mode access (设定f 0/1端口的接入类型为接入端口即access ports.)
CY3C_HTLZYQ_P6ZHSA(config-if)#switchport access vlan +n ((把此端口即接入端口划分到vlan n中,n为vlan 号)按回车键Enter
CY3C_HTLZYQ_P6ZHSA(config-if-range)#no shutdown
或者CY3C_HTLZYQ_P6ZHSA(config)#interface range +端口【(比如FO/5 - 10 ) 把多个端口同时划分到一个Vlan内】
CY3C_HTLZYQ_P6ZHSA(config-if-range)#switchport mode access
CY3C_HTLZYQ_P6ZHSA(config-if-range)#switchport access Vlan +n (n代表Vlan编号正常范围2 1000)按回车键Enter
CY3C_HTLZYQ_P6ZHSA(config-if-range)#no shutdown
8、配置交换机远程密码
配置交换机远程密码
CY3C_HTLZYQ_P6ZHSA(config)#enable password cisco (配置使能密码:cisco)
CY3C_HTLZYQ_P6ZHSA(config)#line vty 0 5
CY3C_HTLZYQ_P6ZHSA(config-line)#password cisco (配置用户密码:cisco) CY3C_HTLZYQ_P6ZHSA(config-line)#login
CY3C_HTLZYQ_P6ZHSA#write (进行配置保存,避免交换机断电后配置消失) 9、一些查看交换机的简单命令
一些查看交换机的简单命令
(1):show run 查看交换机配置信息
(2):show Vlan 查看Vlan详细信息
(3):show ip interface brief 查看接口信息
(4):show cdp nerghbors 显示直连的相邻cisco设备及其详细信息
(5):show cdp neighbors detail 显示ip地址和IOS版本和类型,并且包括show cdp neighbor命令的所有信息。
看了二层交换机基本配置詳解还看了:
1.华为二层交换机基本配置命令有哪些
2.Cisco交换机基本配置方法
3.思科交换机配置教程详解
4.思科交换机基本配置实例讲解
5.不同交换机上的Vlan划分和配置
6.Cisco交换机基本配置的方法。