1教学目标(Objectives)1.介绍VLAN间路由(IntroducingInter-VLANRouting)2.VLAN互联问题及解决方案(Inter-VLANIssuesandSolutions)3.独臂路由器(ARouteronaStick)4.Trunk连接的路由器(Trunk-ConnectedRouters)5.配置VLAN间路由(ConfiguringInter-VLANRouting)2介绍VLAN间路由(IntroducingInter-VLANRouting)没有路由的辅助VLAN1和VLAN200不能通信。VLAN1and200cannotcommunicatewithoutassistanceofarouter.3介绍VLAN间路由(IntroducingInter-VLANRouting)为了路由在一个非Trunk环境下VLAN1和200的信息,路由器必须用一个接口连接在VLAN1中,用一个接口连接在VLAN200中。Toroutetrafficbetweenvlan1andvlan200inanon-vlan-trunkenvironment,aroutermustconnecttoaportinvlan1andaportinvlan200.4介绍VLAN间路由(IntroducingInter-VLANRouting)1.当在一个广播域中的主机想要访问在另一个广播域中的主机,必须通过路由器。Whenahostinonebroadcastdomainwishestocommunicatewithahostinanotherbroadcastdomain,aroutermustbeinvolved.2.如果一个VLAN跨越多个设备,在设备之间要用Trunk连接。IfaVLANspansacrossmultipledevicesatrunkisusedtointerconnectthedevices.5VLAN互联问题(Inter-VLANIssues)当多个VLAN连接到一起时,几个技术问题随之出现。WhenVLANsareconnectedtogether,severaltechnicalissueswillarise.1.端用户设备需要到达非本地主机Theneedforenduserdevicestoreachnon-localhosts2.不同vlan的主机需要通信TheneedforhostsondifferentVLANstocommunicate6VLAN互联解决方案(Inter-VLANSolutions)1.VLAN间通信可以通过逻辑的或者物理的连接来解决。Inter-VLANconnectivitycanbeachievedthrougheitherlogicalorphysicalconnectivity.2.逻辑连接涉及一个从交换机到路由器的单独Trunk连接Trunk链路携带多个VLAN的信息,这种拓扑称为独臂路由器。Logicalconnectivityinvolvesasingleconnection,ortrunk,fromtheswitchtotherouter.ThattrunkcansupportmultipleVLANs.Thistopologyiscalledarouteronastick.3.物理连接需要为每一个VLAN指定一个单独的物理接口。PhysicalconnectivityinvolvesaseparatephysicalconnectionforeachVLAN.7逻辑和物理连接(LogicalandPhysicalConnectivity)8独臂路由器(ARouteronaStick)9物理和逻辑接口(PhysicalandLogicalInterfaces)在传统情况下,有4个VLAN的网络需要交换机和路由器之间使用四个物理连接Inatraditionalsituation,anetworkwithfourVLANswouldrequirefourphysicalconnectionsbetweentheswitchandtheexternalrouter.随着技术的发展,向ISL变得应用更为广泛,网络设计者开始在交换机和路由器之间的连接使用Trunk。AstechnologiessuchasInter-SwitchLink(ISL)becamemorecommon,networkdesignersbegantousetrunklinkstoconnectrouterstoswitches.10ISLand802.1qISL和802.1Q是快速以太口链路Trunk链路的封装格式。ISLand802.1qareusedtotrunkVLANsoverFastEthernetlinks一个单一的ISL或802.1Q链路可以传输多个VLAN信息AsingleISLor802.1qlinkcansupportmultiplevlans11Trunk连接的路由器(Trunk-ConnectedRouters)在路由器的接口上封装ISL或802.1q,可以连接交换机的Trunk接口。AISLor802.1q-enabledinterfaceontherouterconnectstoatrunkportontheswitch.使用Trunk的主要好处是节省路由器和交换机的接口。不仅省钱,而且减少配置的复杂性。Theprimaryadvantageofusingatrunklinkisareductioninthenumberofrouterandswitchportsused.Notonlycanthissavemoney,itcanalsoreduceconfigurationcomplexity.12将物理接口划分为子接口(DividingPhysicalInterfacesintoSubinterfaces)13将物理接口划分为子接口(DividingPhysicalInterfacesintoSubinterfaces)14将物理接口划分为子接口(DividingPhysicalInterfacesintoSubinterfaces)1.子接口是在物理接口上的逻辑接口。Asubinterfaceisalogicalinterfacewithinaphysicalinterface.2.每一个子接口支持一个VLAN,可以指定一个IP地址EachsubinterfacesupportsoneVLAN,andisassignedoneIPaddress.3.为了完成VLAN间路由,必须为每个VLAN创建一个子接口InordertoroutebetweenVLANswithsubinterfaces,asubinterfacemustbecreatedforeachVLAN.15配置VLAN间路由(ConfiguringInter-VLANRouting)16配置VLAN间路由(ConfiguringInter-VLANRouting)17配置VLAN间路由(ConfiguringInter-VLANRouting)18配置VLAN间路由(ConfiguringInter-VLANRouting)1.在执行这些命令之前,每一个交换机和路由器都要确认它们支持VLAN封装。Beforeanyofthesecommandsareimplemented,eachrouterandswitchshouldbecheckedtoseewhichVLANencapsulationstheysupport.2.为了正确的完成VLAN间路由,所有的路由器和交换机必须支持相同的封装。Inorderforinter-VLANroutingtoworkproperly,alloftheroutersandswitchesinvolvedmustsupportthesameencapsulation.19在物理接口上定义子接口(DefineSubinterfacesonaPhysicalInterface)1.定义子接口Identifytheinterface.2.定义VLAN封装DefinetheVLANencapsulation.3.配置IP地址AssignanIPaddresstotheinterface.20VLAN通过三层交换实现VLAN路由(Inter-VLANRoutingbyLayer3Switching)1.打开路由功能(enablerouting)Switch(config)#iprouting2.为该接口分配一个IP地址(configuringIPaddressforSVI)interfacevlan11ipaddress10.1.1.254255.255.255.0interfacef0/1noswitchportipaddress10.1.1.254255.255.255.021思考题(Questions)1.VLAN间的通信要借助第层的设备?2.VLAN互联问题及解决方案分别是什么?3.什么是逻辑和物理连接?4.什么是独臂路由器?5.支持VLAN封装的两种方法是什么?6.使用Trunk的好处是什么?7.在物理接口上定义子接口的步骤是什么?