三层交换机直连_第1页
三层交换机直连_第2页
三层交换机直连_第3页
三层交换机直连_第4页
三层交换机直连_第5页
已阅读5页,还剩12页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、目录:一、交换机登录密码设置二、三层交换机直连三、交换机划分 VLAN四、三层交换机 VLA N实验五、思科三层交换机配置实验一、交换机登录密码设置cisco 的 3560、 2960 交换机配置 telnet 的方法首先, 如果你要在别的 vlan 中也能够 telnet 那么 必须要有三层设备, 同时,在三层设备上 的 ip routing 必须开启,开启方式是,在 config 模式下 输入命令 ip routing 即可,然 后就可以在任何一个 vlan 中 用交换机的 ip 地址来登陆 具体方法如下1,设置管理 ip 就用来登陆交换机的 ipconf tint vlan 1ip ad

2、d2. 必须要设置 enalbe 密码 否则 telnet 时 会提示 交换机没有设置密码 无法 telnet conf tenab pass *3. 然后进入到 vty 模式下 开启交换机的远程 telnet 功能conf tline vty 0 4pass *loginSwitchenSwitch#config tEnter configuration commands, one per line. End with CNTL/Z.Switch(config)#enable password able输入 EN 时的密码Switch(config)#line cons 0Switch(co

3、nfig-line)#password lineSwitch(config-line)#loginSwitch(config-line)#line vty 0 4 Switch(config-line)#password vty Switch(config-line)#login Switch(config-line)#exit Switch(config)#exit %SYS-5-CONFIG_I: Configured from console by console Switch#copy running-config startup-config Destination filename

4、 startup-config? 2960 %Error copying nvram:2960 (Invalid argument) 登录时:User Access Verification输入密码 line输入密码 ablePassword:SwitchenPassword:、三层交换机直连3560 fa0/12960 fa0/2 (switch 1)3560 fa0/12960 fa0/2 (switch 2)3560 fa0/23560 fa0/2 ( 交换机直连 )VLAN 2 192.168.2.1VLAN 3 192.168.3.1VLAN 4 192.168.4.1VLAN 5

5、192.168.5.12960-sw1Fa0/1pc0网关:192.168.1.1IP: 192.168.1.22960-sw2Fa0/1pc1网关:192.168.2.1IP: 192.168.2.2Switch 35601SwitchenSwitch#config tEnter configuration commands, one per line. End with CNTL/Z.Switch(config)#inter fa0/1Switch(config-if)#no switchport%LINEPROTO-5-UPDOWN: Line protocol on Interface

6、 FastEthernet0/1, changed state to down%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to upSwitch(config-if)#ip address 192.168.1.1 255.255.255.0Switch(config-if)#no shutSwitch(config-if)#inter fa0/2Switch(config-if)#no switchport%LINEPROTO-5-UPDOWN: Line protocol on

7、Interface FastEthernet0/2, changed state to down%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/2, changed state to upSwitch(config-if)#ip address 192.168.3.1 255.255.255.0Switch(config-if)#no shutSwitch(config-if)#exitSwitch(config)#router ripSwitch(config-router)#network 192.168.1.0S

8、witch(config-router)#network 192.168.3.0Switch(config-router)#exitSwitch(config)#pc 1 网关 :192.168.1.1 IP:192.168.1.2Switch 3560-1SwitchenSwitch#config tEnter configuration commands, one per line. End with CNTL/Z.Switch(config)#inter fa0/1Switch(config-if)#no switchport%LINEPROTO-5-UPDOWN: Line proto

9、col on Interface FastEthernet0/1, changed state to down%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to upSwitch(config-if)#ip address 192.168.2.1 255.255.255.0Switch(config-if)#no shutSwitch(config-if)#inter fa0/2Switch(config-if)#no switchport %LINEPROTO-5-UPDOWN:

10、Line protocol on Interface FastEthernet0/2, changed state to down%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/2, changed state to upSwitch(config-if)#ip address 192.168.3.2 255.255.255.0 Switch(config-if)#no shutSwitch(config-if)#router ripSwitch(config-router)#network 192.168.2.0Sw

11、itch(config-router)#network 192.168.3.0 Switch(config-router)#exitSwitch(config)#pc 2 网关 :192.168.2.1 IP:192.168.2.2三、交换机划分 VLAN说明:一台3560交换机vlan 10IP:192.168.10.1 端口: fa0/1 - 9vlan 20IP:192.168.20.1 端口: fa0/10 - 20pc0网关:192.168.10.1IP:192.168.10.2vlan 10pc1网关:192.168.10.1IP:192.168.10.3vlan 10pc2网关:

12、192.168.20.1IP:192.168.20.2vlan 20pc3网关:192.168.20.1IP:192.168.20.3vlan 20SwitchenSwitch#config tEnter configuration commands, one per line. End with CNTL/Z.Switch(config)#vlan 10Switch(config-vlan)#exitSwitch(config)#inter vlan 10%LINK-5-CHANGED: Interface Vlan10, changed state to upSwitch(config-i

13、f)#ip address 192.168.10.1 255.255.255.0Switch(config-if)#exitSwitch(config)#inter fa0/1Switch(config-if)#switchport mode accessSwitch(config-if)#switchport access vlan 10(config-if)#exitSwitch(config-if)#inter fa0/2Switch(config-if)#switchport mode accessSwitch(config-if)#switchport access vlan 10S

14、witch(config)#vlan 20Switch(config-vlan)#exitSwitch(config)#inter vlan 20Switch(config-if)#ip address 192.168.20.1 255.255.255.0Switch(config-if)#exitSwitch(config)#inter fa0/10Switch(config-if)#switchport mode accessSwitch(config-if)#switchport access vlan 20Switch(config-if)#inter fa0/11Switch(con

15、fig-if)#switchport mode accessSwitch(config-if)#switchport access vlan 20Switch(config-if)#exitSwitch(config)#exitSwitch(config)# Switch# show vlanpc 1 fa0/1网关 :192.168.10.1 IP:192.168.10.2pc 2 fa0/2网关 :192.168.10.1 IP:192.168.10.3pc 3 fa0/10网关 :192.168.20.1 IP:192.168.20.2pc 4 fa0/11网关 :192.168.20.

16、1 IP:192.168.20.3四、三层交换机 VLA N实验将鼠标移动到连线的绿色点上即可看到两端对应端口3560 Gig0/12960 Gig1/1 (switch 1)3560 Gig0/22960 Gig1/1 (switch 2)VLAN 2 192.168.2.1VLAN 3 192.168.3.1VLAN 4 192.168.4.12960-sw1Fa0/1Fa0/2pc1-1 vlanpc1-2 vlanVLAN 5 192.168.5.12 网关: 192.168.2.1 IP : 192.168.2.23 网关: 192.168.3.1 IP : 192.168.3.22

17、960-sw2Fa0/1pc2-1 vlan: 4 网关: 192.168.4.1 IP: 192.168.4.2Fa0/2pc2-2 vlan: 5 网关: 192.168.5.1 IP: 192.168.5.2一、配置 35601、在3560上配置VLAN以及相关信息Switchen Switch#config t Enter configuration commands, one per line. End with CNTL/Z.Switch(config)#exit %SYS-5-CONFIG_I: Configured from console by console Switch#

18、vlan database% 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 2VLAN 2 added:Name: VLAN0002Switch(vlan)#vlan 3 VLAN 3 added:Name: VLAN0003Switch(vlan)

19、#vlan 4 VLAN 4 added:Name: VLAN0004Switch(vlan)#vlan 5VLAN 5 added:Name: VLAN0005Switch(vlan)#exitAPPLY completed. ExitingSwitch#config tEnter configuration commands, one per line. End with CNTL/Z. Switch(config)#inter vlan 2%LINK-5-CHANGED: Interface Vlan2, changed state to upSwitch(config-if)# Swi

20、tch(config-if)#ip address 192.168.2.1 255.255.255.0Switch(config-if)#no shut Switch(config-if)#inter vlan 3%LINK-5-CHANGED: Interface Vlan3, changed state to upSwitch(config-if)# Switch(config-if)#ip address 192.168.3.0 255.225.255.0Bad mask 0xFFE1FF00 for address 192.168.3.0Switch(config-if)#ip add

21、ress 192.168.3.1 255.255.255.0Switch(config-if)#inter vlan 4%LINK-5-CHANGED: Interface Vlan4, changed state to upSwitch(config-if)#Switch(config-if)#ip address 192.168.4.1 255.255.255.0Switch(config-if)#no shutSwitch(config-if)#inter vlan 5%LINK-5-CHANGED: Interface Vlan5, changed state to upSwitch(

22、config-if)#Switch(config-if)#ip address 192.168.5.1 255.255.255.0Switch(config-if)#no shutSwitch(config-if)#exit2、3560 上配置 trunk ( 注:这里使用的 Packet Tracer 由于不支持通过 switchport trunk encapsolution 命令指定 trunk 协议,默认 )Switch(config)#inter gi0/1Switch(config-if)#shutdown%LINK-5-CHANGED: Interface GigabitEthe

23、rnet0/1, changed state to administratively down%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1, changed state to downSwitch(config-if)#switchport modeSwitch(config)#inter gi0/1Switch(config-if)#shutdownSwitch(config-if)#switchport mode trunkSwitch(config-if)#switchport trunk allow

24、ed vlan 1-5Switch(config-if)#no shut%LINK-5-CHANGED: Interface GigabitEthernet0/1, changed state to up %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan2, changed state to up %LINEPROTO-5-UPDOWN: Line protocol

25、on Interface Vlan3, changed state to up %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan4, changed state to up %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan5, changed state to upSwitch(config-if)#inter gi0/2Switch(config-if)#shutdown %LINK-5-CHANGED: Interface GigabitEthernet0/2, changed

26、state to administratively down%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/2, changed state to downSwitch(config-if)#switchport mode trunkSwitch(config-if)#switchport trunk allowed vlan 1-5Switch(config-if)#no shut%LINK-5-CHANGED: Interface GigabitEthernet0/2, changed state to up

27、 %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/2, changed state to upSwitch(config-if)#exit Switch(config)#exit%SYS-5-CONFIG_I: Configured from console by console Switch#show inter trunkPortGig0/1Gig0/2ModeEncapsulation StatusNative vlanon802.1q trunking1on802.1q trunking1PortVlan

28、s allowed on trunkGig0/11-5Gig0/21-5PortVlans allowed and active in management domainGig0/11,2,3,4,5Gig0/21,2,3,4,5PortVlans in spanning tree forwarding state and not prunedGig0/11,2,3,4,5Gig0/21,2,3,4,5Switch#3、二层交换机配置Switch2960-1SwitchenSwitch#config tEnter configuration commands, one per line. En

29、d with CNTL/Z.Switch(config)#inter gi1/1Switch(config-if)#shutdown %LINK-5-CHANGED: Interface GigabitEthernet1/1, changed state to administratively down%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/1, changed state to downSwitch(config-if)#switchport mode trunkSwitch(config-if)#sw

30、itchport trunk allowed vlan 1-5 Switch(config-if)#no shut%LINK-5-CHANGED: Interface GigabitEthernet1/1, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/1, changed state to upSwitch(config-if)#inter range fa 0/1 - 9 Switch(config-if-range)#switchport access vlan 2%

31、 Access VLAN does not exist. Creating vlan 2 Switch(config-if-range)#inter range fa 0/10 - 20 Switch(config-if-range)#switchport access vlan 2 Switch(config-if-range)#inter range fa 0/10 - 20 Switch(config-if-range)#switchport access vlan 3 % Access VLAN does not exist. Creating vlan 3 Switch(config

32、-if-range)#Switch2960-2SwitchenSwitch#config tEnter configuration commands, one per line. End with CNTL/Z.Switch(config)#inter gi1/1 Switch(config-if)#shutdown%LINK-5-CHANGED: Interface GigabitEthernet1/1, changed state to administratively down%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitE

33、thernet1/1, changed state to downSwitch(config-if)#switchport mode trunkSwitch(config-if)#switchport trunk allowed vlan 1-5 Switch(config-if)#no shut%LINK-5-CHANGED: Interface GigabitEthernet1/1, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/1, changed state to

34、upSwitch(config-if)#inter range fa 0/1 - 9 Switch(config-if-range)#switchport access vlan 4% Access VLAN does not exist. Creating vlan 4 Switch(config-if-range)#inter range fa 0/10 - 20 Switch(config-if-range)#switchport access vlan 5% Access VLAN does not exist. Creating vlan 5 Switch(config-if-ran

35、ge)#五、思科三层交换机配置实验3560 fa0/12960 fa0/15 (switch 1)3560 fa0/22960 fa0/15 (switch 2)VLAN 2 192.168.2.1VLAN 3 192.168.3.12960-sw1Fa0/1pc1-1 vlan:2网关:192.168.2.1IP:192.168.2.2Fa0/2pc1-2 vlan:3网关:192.168.3.1IP:192.168.3.22960-sw2Fa0/1pc2-1 vlan:4网关:192.168.4.1IP:192.168.4.2Fa0/2pc2-2 vlan:5网关:192.168.5.1I

36、P:192.168.5.21、 3560 交换机的配置创建VTP域SwitchenSwitch#config tEnter configuration commands, one per line. End with CNTL/Z.Switch(config)#hostname 35603560(config)#exit%SYS-5-CONFIG_I: Configured from console by console 3560#vlan data% Warning: It is recommended to configure VLAN from config mode, as VLAN

37、database mode is being deprecated. Please consult user documentation for configuring VTP/VLAN in config mode.3560(vlan)#vtp serverDevice mode already VTP SERVER.3560(vlan)#vtp domain syChanging VTP domain name from NULL to sy3560(vlan)#vtp password ciscoSetting device VLAN database password to cisco

38、 3560(vlan)#exitAPPLY completed. Exiting3560#配置中继3560#config tEnter configuration commands, one per line. End with CNTL/Z. 3560(config)#int range fa0/1 - 2 3560(config-if-range)#switchport mode trunk%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to down%LINEPROTO-5-UP

39、DOWN: Line protocol on Interface FastEthernet0/1, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/2, changed state to down%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/2, changed state to up3560(config-if-range)#end %SYS-5-CONFIG_I: Configured from co

40、nsole by console 3560#vlan data% 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.创建 VLAN3560(vlan)#vlan 2 VLAN 2 added:Name: VLAN0002 3560(vlan)#vlan 3 VLAN 3 added:Nam

41、e: VLAN00033560(vlan)#exit APPLY completed.Exiting3560#show vtp statu VTP Version : 2 Configuration Revision: 2Maximum VLANs supported locally : 1005Number of existing VLANs: 7VTP Operating ModeVTP Domain NameVTP Pruning ModeVTP V2 ModeVTP Traps GenerationMD5 digest: Server: sy: Disabled: Disabled:

42、Disabled: 0xBB 0x59 0x98 0xCF 0x69 0xAA 0x53 0x02Configuration last modified by 0.0.0.0 at 3-1-93 00:15:00 Local updater ID is 0.0.0.0 (no valid interface found) 3560#conf tEnter configuration commands, one per line. End with CNTL/Z. 3560(config)#ip routing 3560(config)#int vlan 2 %LINK-5-CHANGED: I

43、nterface Vlan2, changed state to up %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan2, changed state to up 3560(config-if)#ip address 192.168.2.1 255.255.255.0 3560(config-if)#no shut3560(config-if)#exit 3560(config)#int vlan 3 %LINK-5-CHANGED: Interface Vlan3, changed state to up %LINEPROTO-5-U

44、PDOWN: Line protocol on Interface Vlan3, changed state to up 3560(config-if)#ip address 192.168.3.1 255.255.255.0 3560(config-if)#no shut3560(config-if)#end %SYS-5-CONFIG_I: Configured from console by console 3560#2、 2960 交换机命名为 2960-sw1创建VTP域SwitchenSwitch#config tEnter configuration commands, one

45、per line. End with CNTL/Z.Switch(config)#hostname 2960-sw12960-sw1(config)#exit%SYS-5-CONFIG_I: Configured from console by console 2960-sw1#vlan data% Warning: It is recommended to configure VLAN from config mode, as VLAN database mode is being deprecated. Please consult user documentation for confi

46、guring VTP/VLAN in config mode.2960-sw1(vlan)#vtp clientSetting device to VTP CLIENT mode.2960-sw1(vlan)#vtp domain syChanging VTP domain name from NULL to sy2960-sw1(vlan)#vtp password ciscoSetting device VLAN database password to cisco2960-sw1(vlan)#exitAPPLY completed.Exiting2960-sw1#toto%LINEPRO

47、TO-5-UPDOWNLi:ne protocol on Interface FastEthernet0/15, changed state down%LINEPROTO-5-UPDOWNLi:ne protocol on Interface FastEthernet0/15, changed state up配置中继2960-sw1#conf tEnter configuration commands, one per line. End with CNTL/Z. 2960-sw1(config)#int f0/152960-sw1(config-if)#switchport mode tr

48、unk2960-sw1(config-if)#end%SYS-5-CONFIG_I: Configured from console by console 2960-sw1#show vtp statuVTP Version : 2Configuration Revision : 2Maximum VLANs supported locally : 255Number of existing VLANs: 7VTP Operating Mode: ClientVTP Domain Name: syVTP Pruning Mode: DisabledVTP V2 Mode : DisabledV

49、TP Traps Generation: DisabledMD5 digest: 0xBB 0x59 0x98 0xCF 0x69 0xAA 0x53 0x02Configuration last modified by 0.0.0.0 at 3-1-93 00:15:00 2960-sw1#conf tEnter configuration commands, one per line. End with CNTL/Z. 2960-sw1(config)#int f0/12960-sw1(config-if)#switchport mode access2960-sw1(config-if)

50、#switchport access vlan 22960-sw1(config-if)#end%SYS-5-CONFIG_I: Configured from console by console2960-sw1# 3、 2960 交换机创建VTP域Switchen Switch#config t Enter configuration commands, one per line. End with CNTL/Z.Switch(config)#hostname 2960-sw2 2960-sw2(config)#exit%SYS-5-CONFIG_I: Configured from co

51、nsole by console 2960-sw2#vlan data% 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.2960-sw2(vlan)#vtp clientSetting device to VTP CLIENT mode. 2960-sw2(vlan)#vtp doma

52、in syChanging VTP domain name from NULL to sy 2960-sw2(vlan)#vtp password ciscoSetting device VLAN database password to cisco 2960-sw2(vlan)#toto%LINEPROTO-5-UPDOWNLi:ne protocol on InterfaceFastEthernet0/15,changed statedown%LINEPROTO-5-UPDOWNLi:ne protocol on InterfaceFastEthernet0/15,changed stat

53、eup2960-sw2(vlan)#exit APPLY completed.Exiting配置中继2960-sw2#conf tEnter configuration commands, one per line. End with CNTL/Z. 2960-sw2(config)#int f0/152960-sw2(config-if)#switchport mode trunk2960-sw2(config-if)#end%SYS-5-CONFIG_I: Configured from console by console2960-sw2#show vtp statuVTP Versio

54、n: 2Configuration Revision : 2Maximum VLANs supported locally : 255Number of existing VLANs : 7VTP Operating ModeVTP Domain NameVTP Pruning ModeVTP V2 ModeVTP Traps GenerationMD5 digest: Client: sy: Disabled: Disabled: Disabled: 0xBB 0x59 0x98 0xCF 0x69 0xAA 0x53 0x02Configuration last modified by 0

55、.0.0.0 at 3-1-93 00:15:002960-sw2#conf tEnter configuration commands, one per line. End with CNTL/Z. 2960-sw2(config)#int f0/12960-sw2(config-if)#switchport mode access2960-sw2(config-if)#switchport access vlan 3 2960-sw2(config-if)#SwitchenSwitch#config tEnter configuration commands, one per line.

56、End with CNTL/Z.Switch(config)#hostname c3560c3560(config)#exit%SYS-5-CONFIG_I: Configured from console by console c3560#vlan data% 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.c3560(vlan)#vlan 2VLAN 2 added:Name: VLAN0002c3560(vlan)#vlan 3VLAN 3 added:Name: VLAN0003c3560(vlan)#exitAPPLY completed.Exitingc3560#config

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论