利用华为路由器单臂路由的配置原理,可以使同一交换机上不同VLAN之间实现通信。 需要掌握以下基本概念: 链路类型 -交换机连接主机的端口为access链路; -交换机连接路由器的端口为trunk链路 子接口 -路由器的物理接口可以被划分为多个子接口; -每个子接口对应一个VLAN的网关 配置拓扑图如下所示:
The configuration on the switch is as follows:
[Sw]vlan Batch 10 20
[Sw]interface ETHERNET0/0/2
[Sw-ethernet0/0/10]port link-type Access
[Sw-ethernet0/0/10]port Default VLAN 10
[Sw]interface ETHERNET0/0/3
[Sw-ethernet0/0/10]port link-type Access
[Sw-ethernet0/0/10]port Default VLAN 20
Configure the following on the router:
First step: Sub-interface Configuration VLAN and gateway
[R]interface gigabitethernet 0/0/0.1
[r-gigabitethernet0/0/0.1]dot1q termination vid 10
[R-gigabitethernet0/0/0.1]ip address 192.168.10.254 24
[R]interface gigabitethernet 0/0/0.2
[r-gigabitethernet0/0/0.2]dot1q Termination vid 20
[R-gigabitethernet0/0/0.2]ip address 192.168.20.254 24
Step two: Turn on ARP broadcast (must be turned on) and DHCP function (IP can be configured manually)
[R1]interface g0/0/0.1
[R1-gigabitethernet0/0/0.1]arp Broadcast Enable
[R1-gigabitethernet0/0/0.1]dhcp Select interface
[R1]interface g0/0/0.2
[R1-gigabitethernet0/0/0.2]arp Broadcast Enable
[R1-gigabitethernet0/0/0.2]dhcp Select interface
Finally, check the IP address on PC1, PC2, and verify the test.
Ping test on two PCs, connecting
Verification Success!!!
Configuration complete
Huawei single-Arm routing configuration