《第5章 VLAN典型配置案例.ppt》由会员分享,可在线阅读,更多相关《第5章 VLAN典型配置案例.ppt(9页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、基于端口的VLAN典型配置组网需求:l如图所示,SwitchA和SwitchB分别连接了不同部门使用的Host1/Host2和Server1/Server2。l为保证部门间数据的二层隔离,现要求将Host1和Server1划分到VLAN100中,Host2和Server2划分到VLAN200中。并分别为两个VLAN设置描述字符为“Dept1”和“Dept2”。l在SwitchA上配置VLAN接口,对Host1发往Server2的数据进行三层转发。配置Switch A#创建VLAN100,并配置VLAN100的描述字符串为“Dept1”,将端口GigabitEthernet1/0/1加入到VLA
2、N100。system-viewSwitchAvlan100SwitchA-vlan100descriptionDept1SwitchA-vlan100portGigabitEthernet1/0/1SwitchA-vlan100quit#创建VLAN200,并配置VLAN200的描述字符串为“Dept2”。SwitchAvlan200SwitchA-vlan200descriptionDept2SwitchA-vlan200quit#创建VLAN100和VLAN200的接口,IP地址分别配置为192.168.1.1和192.168.2.1,用来对Host1发往Server2的报文进行三层转发
3、。SwitchAinterfaceVlan-interface100SwitchA-Vlan-interface100ipaddress192.168.1.124SwitchA-Vlan-interface100quitSwitchAinterfaceVlan-interface200SwitchA-Vlan-interface200ipaddress192.168.2.124 配置Switch B#创建VLAN100,并配置VLAN100的描述字符串为“Dept1”,将端口GigabitEthernet1/0/13加入到VLAN100。system-viewSwitchBvlan100Swi
4、tchB-vlan100descriptionDept1SwitchB-vlan100portGigabitEthernet1/0/13SwitchB-vlan100quit#创建VLAN200,并配置VLAN200的描述字符串为“Dept2”,将端口GigabitEthernet1/0/11和GigabitEthernet1/0/12加入到VLAN200。SwitchBvlan200SwitchB-vlan200descriptionDept2SwotchB-vlan200portGigabitEthernet1/0/11GigabitEthernet1/0/12SwitchB-vlan20
5、0quit配置Switch A和Switch B之间的链路由于SwitchA和SwitchB之间的链路需要同时传输VLAN100和VLAN200的数据,所以可以配置两端的端口为Trunk端口,且允许这两个VLAN的报文通过。#配置SwitchA的GigabitEthernet1/0/2端口。SwitchAinterfaceGigabitEthernet1/0/2SwitchA-GigabitEthernet1/0/2portlink-typetrunkSwitchA-GigabitEthernet1/0/2porttrunkpermitvlan100200#配置SwitchB的GigabitE
6、thernet1/0/10端口。SwitchBinterfaceGigabitEthernet1/0/10SwitchB-GigabitEthernet1/0/10portlink-typetrunkSwitchB-GigabitEthernet1/0/10porttrunkpermitvlan100200基于MAC的VLAN典型配置组网需求:l如图所示,SwitchA和SwitchB的GigabitEthernet1/0/1端口分别连接到两个会议室,Laptop1和Laptop2是会议用笔记本电脑,会在两个会议室间移动使用。lLaptop1和Laptop2分别属于两个部门,两个部门间使用VL
7、AN100和VLAN200进行隔离。现要求这两台笔记本电脑无论在哪个会议室使用,均只能访问自己部门的服务器,即Server1和Server2。lLaptop1和Laptop2的MAC地址分别为000d-88f8-4e71、0014-222c-aa69。SwitchA的配置#创建VLAN100和VLAN200,并将GigabitEthernet1/0/2配置为Trunk端口,允许VLAN100和VLAN200的报文通过。system-viewSwitchAvlan100SwitchA-vlan100quitSwitchAvlan200SwitchA-vlan200quitSwitchAinter
8、faceGigabitEthernet1/0/2SwitchA-GigabitEthernet1/0/2portlink-typetrunkSwitchA-GigabitEthernet1/0/2porttrunkpermitvlan100200SwitchA-GigabitEthernet1/0/2quit#将GigabitEthernet1/0/1配置为Hybrid端口,并使其在发送VLAN100和VLAN200的报文时去掉VLANTag。SwitchAinterfaceGigabitEthernet1/0/1SwitchA-GigabitEthernet1/0/1portlink-typ
9、ehybridSwitchA-GigabitEthernet1/0/1porthybridvlan100200untaggedSwitchA-GigabitEthernet1/0/1quit SwitchA的配置#创建Laptop1的MAC地址与VLAN100的关联,创建Laptop2的MAC地址与VLAN200的关联,开启GigabitEthernet1/0/1端口的MAC-VLAN功能。SwitchAmac-vlanmac-address000d-88f8-4e71vlan100SwitchAmac-vlanmac-address0014-222c-aa69vlan200SwitchAin
10、terfaceGigabitEthernet1/0/1SwitchA-GigabitEthernet1/0/1mac-vlanenableSwitchB的配置与SwitchA完全一致,这里不再赘述。Core Switch的配置#创建VLAN100和VLAN200,并将GigabitEthernet1/0/13和GigabitVLANEthernet1/0/14端口分别加入这两个VLAN。system-viewCoreSwitchvlan100CoreSwitch-vlan100portgigabitethernet1/0/13CoreSwitch-vlan100quitCoreSwitchvl
11、an200CoreSwitch-vlan200portgigabitethernet1/0/14CoreSwitch-vlan200quit#配置GigabitEthernet1/0/3和GigabitEthernet1/0/4端口为Trunk端口,均允许VLAN100和VLAN200的报文通过。CoreSwitchinterfaceGigabitEthernet1/0/3CoreSwitch-GigabitEthernet1/0/3portlink-typetrunkCoreSwitch-GigabitEthernet1/0/3porttrunkpermitvlan100200CoreSwitch-GigabitEthernet1/0/3quitCoreSwitchinterfaceGigabitEthernet1/0/4CoreSwitch-GigabitEthernet1/0/4portlink-typetrunkCoreSwitch-GigabitEthernet1/0/4porttrunkpermitvlan100200CoreSwitch-GigabitEthernet1/0/4quit杭州华三通信技术有限公司
限制150内