2层交换机和3层交换机来实现不同网段的互联

上传人:豆浆 文档编号:31200485 上传时间:2018-02-05 格式:DOC 页数:4 大小:34KB
返回 下载 相关 举报
2层交换机和3层交换机来实现不同网段的互联_第1页
第1页 / 共4页
2层交换机和3层交换机来实现不同网段的互联_第2页
第2页 / 共4页
2层交换机和3层交换机来实现不同网段的互联_第3页
第3页 / 共4页
2层交换机和3层交换机来实现不同网段的互联_第4页
第4页 / 共4页
亲,该文档总共4页,全部预览完了,如果喜欢就下载吧!
资源描述

《2层交换机和3层交换机来实现不同网段的互联》由会员分享,可在线阅读,更多相关《2层交换机和3层交换机来实现不同网段的互联(4页珍藏版)》请在金锄头文库上搜索。

1、2 层交换机和 3 层交换机来实现不同网段的通信技术原理:三层交换机具有网络层的功能,实现 vlan 相互访问的原理是:利用 3 层交换机的路由功能,通过识别数据包的 IP 地址,查找路由表进行进行选路转发。三层交换机利用直接路由可以实现不同 vlan 之间的互相访问。三层交换机给接口配置 IP 地址,采用 SVI (交换虚拟接口)的方式实现 VLAN 间互连,SVI 是指为交换机中的 VLAN 创建虚拟接口,并且配置 IP 地址。实验过程:实验拓扑图:看附图pc0.pc1 分别和 switch0 相连,并且 pc0 和 f0/2 相连, pc1 和 f0/3 相连,3 层交换机和 2 层交换

2、机通过 f0/1 相连,三层交换机的 f0/2 口和 pc2 的 fastethernet 相连.给 2 个 pc 机输入 IP 地址pc0: 192.168.1.2255.255.255.0192.168.1.1pc1: 192.168.2.2255.255.255.0192.168.2.1pc2: 192.168.1.3255.255.255.0192.168.1.1在 2 层交换机上划分 2 个 vlan (vlan 2,和 vlan 3)然后把 f0/2 划分到 vlan 2f0/3 划分到 vlan 3然后把 f0/24 口 设置为 trunk 模式。命令如下:Switchenabl

3、eSwitch#config terminalEnter configuration commands, one per line. End with CNTL/Z.Switch(config)#vlan 2Switch(config-vlan)#name vlan2Switch(config-vlan)#exitSwitch(config)#vlan 3 Switch(config-vlan)#name vlan3Switch(config-vlan)#exitSwitch(config)#interface f0/2Switch(config-if)#switchport mode acc

4、essSwitch(config-if)#switchport access vlan 2Switch(config-if)#exitSwitch(config)#interface f0/3Switch(config-if)#switchport mode access Switch(config-if)#switchport access vlan 3Switch(config-if)#exitSwitch(config)#interface f0/1Switch(config-if)#switchport mode trunkSwitch(config-if)#exit Switch(c

5、onfig)#exitSwitch#%SYS-5-CONFIG_I: Configured from console by consoleSwitch#show 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/24, Gig1/1, Gi

6、g1/22 vlan2 active Fa0/23 vlan3 active Fa0/31002 fddi-default act/unsup 1003 token-ring-default act/unsup 1004 fddinet-default act/unsup 1005 trnet-default act/unsup VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2- - - - - - - - - - -1 enet 100001 1500 - - - - - 0 02 enet 100002

7、 1500 - - - - - 0 03 enet 100003 1500 - - - - - 0 01002 fddi 101002 1500 - - - - - 0 0 Switch#3 层交换机进行配置:SwitchenableSwitch#configure terminalEnter configuration commands, one per line. End with CNTL/Z.Switch(config)#vlan 2Switch(config-vlan)#exitSwitch(config)#vlan 3Switch(config-vlan)#exitSwitch(c

8、onfig)#interface fa 0/1Switch(config-if)#switchport mode trunkCommand rejected: An interface whose trunk encapsulation is Auto can not be configured to trunk mode.Switch(config-if)#exitSwitch(config)#interface vlan 2%LINK-5-CHANGED: Interface Vlan2, changed state to up%LINEPROTO-5-UPDOWN: Line proto

9、col on Interface Vlan2, changed state to upSwitch(config-if)#ip address 192.168.1.1 255.255.255.0Switch(config-if)#no shutdownSwitch(config-if)#exitSwitch(config)#interface vlan 3%LINK-5-CHANGED: Interface Vlan3, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan3, changed state

10、 to upSwitch(config-if)#ip address 192.168.2.1 255.255.255.0Switch(config-if)#no shutdownSwitch(config-if)#exitSwitch(config)#interface fa 0/2Switch(config-if)#switchport mode accessSwitch(config-if)#switchport access vlan 2Switch(config-if)#endSwitch#%SYS-5-CONFIG_I: Configured from console by cons

11、oleSwitch#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 setC 192.168.1.0/24 is directly connected, Vlan2C 192.168.2.0/24 is directly connected, Vlan3Switch#

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 行业资料 > 其它行业文档

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号