目录
单臂路由概念
单臂路由实验
路由器配置
交换机配置
实验验证
基于Eth-Trunk的单臂路由
路由器配置
交换机配置
实验验证
单臂路由概念
单臂路由技术能让路由器的一个物理接口对应不同VLAN数据的实质是把物理接口分成若干个子接口,这些子接口通过封装802.1q标记,以识别不同VLAN的TAG标记。
目的:不同vlan之间进行通信,让路由器的一个接口能接收不同vlan的数据。
单臂路由实验
路由器配置
[Huawei]inter g0/0/0.10
[Huawei-GigabitEthernet0/0/0.10]ip add 192.168.10.254 24
#使用dot1q协议封装,该接口属于vlan10
[Huawei-GigabitEthernet0/0/0.10]dot1q termination vid 10
#子接口没有开启arp广播功能,通信需要ARP解析,所以需要ARP广播功能
[Huawei-GigabitEthernet0/0/0.10]arp broadcast enable
# GigabitEthernet0/0/0.20也是如此
[Huawei-GigabitEthernet0/0/0.20]ip add 192.168.20.254
[Huawei-GigabitEthernet0/0/0.20]dot1q termination vid 20
[Huawei-GigabitEthernet0/0/0.20]arp broadcast enable
交换机配置
[SW1]vlan batch 10 20
[SW1]interface GigabitEthernet0/0/1
[SW1-GigabitEthernet0/0/1]port link-type access
[SW1-GigabitEthernet0/0/1]port default vlan 10[SW1]interface GigabitEthernet 0/0/2
[SW1-GigabitEthernet0/0/2]port link-type access
[SW1-GigabitEthernet0/0/2]port default vlan 20[SW1]interface GigabitEthernet 0/0/3
[SW1-GigabitEthernet0/0/3]port link-type trunk
[SW1-GigabitEthernet0/0/3]port trunk allow-pass vlan 10 20
实验验证
PC1 ping PC2
基于Eth-Trunk的单臂路由
Eth-Trunk 不了解的可以先看我之前的一篇文章
Eth-trunk的介绍以及实验配置-CSDN博客
路由器配置
[AR1]interface Eth-Trunk 1
[AR1-Eth-Trunk1]undo portswitch #转换为三层接口
[AR1-Eth-Trunk1]mode lacp-static #设置为动态lacp协议
[AR1-Eth-Trunk1]trunkport GigabitEthernet 0/0/0 to 0/0/2 #添加端口成员
Info: This operation may take a few seconds. Please wait for a moment...done.[AR1]interface Eth-Trunk1.10
[AR1-Eth-Trunk1.10]dot1q termination vid 10
[AR1-Eth-Trunk1.10]ip address 192.168.10.254 24
[AR1-Eth-Trunk1.10]arp broadcast enable[AR1]inter Eth-Trunk1.20
[AR1-Eth-Trunk1.20]dot1q termination vid 20
[AR1-Eth-Trunk1.20]ip add 192.168.20.254 24
[AR1-Eth-Trunk1.20]arp broadcast enable
交换机配置
[SW1]vlan batch 10 20
Info: This operation may take a few seconds. Please wait for a moment...done.
[SW1]interface GigabitEthernet 0/0/1
[SW1-GigabitEthernet0/0/1]port link-type access
[SW1-GigabitEthernet0/0/1]port default vlan 10[SW1]interface GigabitEthernet 0/0/2
[SW1-GigabitEthernet0/0/2]port link-type access
[SW1-GigabitEthernet0/0/2]port default vlan 20[SW1]interface Eth-Trunk 1
[SW1-Eth-Trunk1]port link-type trunk
[SW1-Eth-Trunk1]port trunk allow-pass vlan 10 20
[SW1-Eth-Trunk1]mode lacp-static
[SW1-Eth-Trunk1]trunkport GigabitEthernet 0/0/3 to 0/0/5
实验验证
PC1 PIng PC2