One-arm routing (router-on-a-stick) refers to the configuration of sub-interfaces (or "logical interfaces", there is no real physical interface) on an interface of the router to realize different VLANs (virtual LAN) interconnection and intercommunication. ------Source Baidu Encyclopedia
Network structure topology diagram
Configuration process
Configuration of SW1
[Huawei]sysname SW1 //把设备名称改为SW1
[SW1]vlan 10 //创建vlan 10、20
[SW1-vlan10]vlan 20
[SW1]int e0/0/1 //进入PC和交换机相连的端口
[SW1-Ethernet0/0/1]port link-type access //将端口类型设置为access
[SW1-Ethernet0/0/1]port default vlan 10 //将端口划分给vlan 10
[SW1]int e0/0/2 //一样进入PC和交换机相连的端口进行配置
[SW1-Ethernet0/0/2]port link-type access
[SW1-Ethernet0/0/2]port default vlan 20
[SW1]int e0/0/3 //进入交换机和路由器相连的端口
[SW1-Ethernet0/0/3]port link-type trunk //将端口设置为trunk类型
[SW1-Ethernet0/0/3]port trunk allow-pass vlan all //并且允许所有的vlan通过
[SW1]display vlan //最后我们可以使用这个命令来查看我们划分的vlan
<SW1>save //最后记得一定要输入这个命令保存,否则设备重启全部配置都会丢失
R1 configuration
[Huawei]sysname R1 //修改设备名称
[R1]int g0/0/0.1 //进入物理端口的逻辑子接口
[R1-GigabitEthernet0/0/0.1]ip address 192.168.1.2 24 //IP地址为PC1的网关
[R1-GigabitEthernet0/0/0.1]dot1q termination vid 10 //使用dot1q将这个端口划分给vlan 10
[R1-GigabitEthernet0/0/0.1]arp broadcast enable //开启arp广播
[R1]int g0/0/0.2 //进入第二个逻辑子接口
[R1-GigabitEthernet0/0/0.2]ip address 192.168.2.2 24 //IP地址为PC2的网关IP地址
[R1-GigabitEthernet0/0/0.2]dot1q termination vid 20 //将端口划分给vlan 20
[R1-GigabitEthernet0/0/0.2]arp broadcast enable
Connectivity test So
far, the configuration of ensp single-arm routing is completed. If there is any error, please understand!