《21利用三层交换机路由功能实现不同VLAN互通.docx》由会员分享,可在线阅读,更多相关《21利用三层交换机路由功能实现不同VLAN互通.docx(4页珍藏版)》请在三一办公上搜索。
1、21利用三层交换机路由功能实现不同VLAN互通2.1 利用三层交换机路由功能实现不同VLAN互通 一个公司或单位的局域网中,进行VLAN的划分是为了防止病毒的传播和相同部门的隔离,提高安全性,可是最终要都实现全部互通,以保证局域网内的互联功能,所以不仅要实现相同VLAN的互通也要实现不同的VLAN互通。 1.掌握如何在三层交换机上进行SVI口的配置方法。 2.掌握三层交换机上直连路由的形成原理。 3.了解路由的作用和掌握查看路由表的方法。 三层交换机一台、二层交换机二台、PC机2台、直连线2根、交叉线2根。 1.如上图建网络拓扑,PC1的IP是192.168.1.6/16,网关192.168.
2、1.254;PC2的IP为192.168.2.6/16,网关192.168.2.254;子网掩码都是:255.255.0.0,测试两台PC机的通信情况(互通)。 2.设置交换机的提示符名分别为SW1(三层)和SW2、SW3。 3.配置二层交换机,分别在两个二层交换机上创建VLAN 100和VLAN 200,并将PC1移入VLAN 100,PC2移入VLAN100。测试两台PC机的通信情况(不通)。 4.在三层交换机SW1上设置VLAN 100和VLAN 200,在交换机间启用Trunk链路,保证VLAN能够实现跨越交换机的通信。测试两台PC机的通信情况(互通)。 5.如下图,改建网络拓扑,PC
3、1仍为VLAN 100,PC2移入VLAN200。测试两台PC机的通信情况(不通)。 6.配置三层交换机,为SVI口配置IP地址,VLAN 100:192.168.1.254,VLAN 200:192.168.2.254,子网掩码都是:255.255.255.0,实现直连路由功能。两个PC的子网掩码也要改成255.255.255.0,要与默认网关的子网掩码一致,路由才能起作用,最终实现PC1和PC2相互通信。 7.最后把配置以及ping的结果截图打包,以“学号姓名”为文件名,提交作业。 1.SVI口配置IP地址: SW1(config)#interface vlan 100 SW1(confi
4、g-VLAN)#ip address 192.168.1.254 255.255.255.0 SW1(config-VLAN)#no shutdown SW1(config-VLAN)#exit SW1(config)#interface vlan 200 SW1(config-VLAN)#ip address 192.168.2.254 255.255.255.0 SW1(config-VLAN)#no shutdown 2.查看路由表信息: SW1#show ip route 1.SW1#show ip route Codes: C - connected, S - static, I -
5、 IGRP, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area * -
6、 candidate default, U - per-user static route, o - ODR P - periodic downloaded static route Gateway of last resort is not set C 192.168.1.0/24 is directly connected, Vlan100 C 192.168.2.0/24 is directly connected, Vlan200 2.SW1#show running-config Building configuration. Current configuration : 1147
7、 bytes version 12.2 no service password-encryption hostname SW1 ip ssh version 1 port-channel load-balance src-mac interface FastEthernet0/1 switchport mode trunk interface FastEthernet0/2 switchport mode trunk interface FastEthernet0/3 interface FastEthernet0/4 interface FastEthernet0/5 interface F
8、astEthernet0/6 interface FastEthernet0/7 interface FastEthernet0/8 interface FastEthernet0/9 interface FastEthernet0/10 interface FastEthernet0/11 interface FastEthernet0/12 interface FastEthernet0/13 interface FastEthernet0/14 interface FastEthernet0/15 interface FastEthernet0/16 interface FastEthe
9、rnet0/17 interface FastEthernet0/18 interface FastEthernet0/19 interface FastEthernet0/20 interface FastEthernet0/21 interface FastEthernet0/22 interface FastEthernet0/23 interface FastEthernet0/24 interface GigabitEthernet0/1 interface GigabitEthernet0/2 interface Vlan1 no ip address shutdown interface Vlan100 ip address 192.168.1.254 255.255.255.0 interface Vlan200 ip address 192.168.2.254 255.255.255.0 ip classless line con 0 line vty 0 4 login end