企业的不同用户拥有相同的业务,且位于不同的网段。现在相同业务的用户所属的 VLAN 不相同,需要实现不同 VLAN 中的用户相互通信。
1、拓扑图
2、LSW1配置
创建VLAN并配置VLAN地址
<Huawei>undo terminal monitor Info: Current terminal monitor is off. <Huawei>sys Enter system view, return user view with Ctrl+Z. [Huawei]sysname SWA [SWA]vlan batch 101 102 Info: This operation may take a few seconds. Please wait for a moment...done. [SWA]int vlan 101 [SWA-Vlanif101]ip add 1.1.1.254 24 [SWA-Vlanif101]quit [SWA]int vlan 102 [SWA-Vlanif102]ip add 2.2.2.254 24 [SWA-Vlanif102]quit [SWA]
将端口加入指定VLAN
[SWA]int g0/0/1 [SWA-GigabitEthernet0/0/1]port link-type access [SWA-GigabitEthernet0/0/1]port default vlan 101 [SWA-GigabitEthernet0/0/1]quit [SWA]int g0/0/2 [SWA-GigabitEthernet0/0/2]port link-type access [SWA-GigabitEthernet0/0/2]port default vlan 102 [SWA-GigabitEthernet0/0/2]quit [SWA]
3、测试
PC1ping PC2,可以ping通,实现VLAN间通信。
读书和健身总有一个在路上