)
一、实验目的1、理解单臂路由和三层交换机实现VLAN通信的应用场景2、掌握路由器子接口的配置方法3、掌握子接口封装VLAN的配置方法4、掌握测试多层交换网络连通性的方法二、实验要求1、使用三层交换机实现vlan间通信2、使用单臂路由实现vlan间通信三、实验内容1、使用三层交换机实现VLAN间通信根据要求建立拓扑如下图对交换机SW1、SW2和SW3的配置分别如下SW1:HuaweisysEnter system view, return user view with CtrlZ.[Huawei]undo info enaInfo: Information center is disabled.[Huawei]sysname SW1[SW1]vlan batch 10 20Info: This operation may take a few seconds. Please wait for a moment...done.[SW1]int vlan 10[SW1-Vlanif10]ip add 20.19.17.3 24[SW1-Vlanif10]int vlan 20[SW1-Vlanif20]ip add 20.19.18.2 24[SW1-Vlanif20]int g0/0/1[SW1-GigabitEthernet0/0/1]port link-type trunk[SW1-GigabitEthernet0/0/1]port trunk allow-pass vlan all[SW1-GigabitEthernet0/0/1]int g0/0/2[SW1-GigabitEthernet0/0/2]port link-type trunk[SW1-GigabitEthernet0/0/2]port trunk allow-pass vlan all[SW1-GigabitEthernet0/0/2]q[SW1]qSW2:HuaweisysEnter system view, return user view with CtrlZ.[Huawei]undo info enaInfo: Information center is disabled.[Huawei]sysname SW2[SW2]vlan 20[SW2-vlan20]int vlan 20[SW2-Vlanif20]int e0/0/2[SW2-Ethernet0/0/2]port link-type access[SW2-Ethernet0/0/2]port default vlan 20[SW2-Ethernet0/0/2]int e0/0/1[SW2-Ethernet0/0/1]port link-type trunk[SW2-Ethernet0/0/1]port trunk allow-pass vlan all[SW2-Ethernet0/0/1]q[SW2]qSW3:HuaweisysEnter system view, return user view with CtrlZ.[Huawei]undo info enaInfo: Information center is disabled.[Huawei]sysname SW3[SW3]vlan 10[SW3-vlan10]int vlan 10[SW3-Vlanif10]int e0/0/1[SW3-Ethernet0/0/1]port link-type access[SW3-Ethernet0/0/1]port default vlan 10[SW3-Ethernet0/0/1]int e0/0/3[SW3-Ethernet0/0/3]port link-type access[SW3-Ethernet0/0/3]port default vlan 10[SW3-Ethernet0/0/3]int e0/0/2[SW3-Ethernet0/0/2]port link-type trunk[SW3-Ethernet0/0/2]port trunk allow-pass vlan all[SW3-Ethernet0/0/2]q[SW3]q配置完毕后检查配置结果如下SW1SW2SW3用PC1 ping PC3结果如图用PC3 ping PC2结果如图结论使用三层交换机实现了VLAN间的通信。2、使用单臂路由实现VLAN间的通信根据要求建立拓扑如下图对交换机SW6和路由器R2的配置分别如下SW2和SW3的配置与在“三层交换机实现VLAN通信”中的配置相同因此不再赘述SW6HuaweiHuaweisysEnter system view, return user view with CtrlZ.[Huawei]undo info enaInfo: Information center is disabled.[Huawei]sysname SW1[Huawei]vlan batch 10 20[SW1]int g0/0/1[SW1-GigabitEthernet0/0/1]port link-type trunk[SW1-GigabitEthernet0/0/1]port trunk allow-pass vlan all[SW1-GigabitEthernet0/0/1]int g0/0/2[SW1-GigabitEthernet0/0/2]port link-type trunk[SW1-GigabitEthernet0/0/2]port trunk allow-pass vlan all[SW1-GigabitEthernet0/0/2]int g0/0/3[SW1-GigabitEthernet0/0/3]port link-type trunk[SW1-GigabitEthernet0/0/3]port trunk allow-pass vlan all[SW1-GigabitEthernet0/0/3]q[SW1]qR2:HuaweisysEnter system view, return user view with CtrlZ.[Huawei]undo info enaInfo: Information center is disabled.[Huawei]sysname R1[R1]int g0/0/0.1[R1-GigabitEthernet0/0/0.1]ip add 20.19.17.3 24[R1-GigabitEthernet0/0/0.1]dot1q ter vid 10[R1-GigabitEthernet0/0/0.1]arp bro ena[R1-GigabitEthernet0/0/0.1]int g0/0/0.2[R1-GigabitEthernet0/0/0.2]ip add 20.19.18.2 24[R1-GigabitEthernet0/0/0.2]dot1q ter vid 20[R1-GigabitEthernet0/0/0.2]arp bro ena[R1-GigabitEthernet0/0/0.2]q[R1]q配置结果展示如下SW6R2:用PC1 ping PC3结果如图用PC3 ping PC2结果如图