使用ensp搭建下图的实验环境,配置单臂路由 实现vlan 10与vlan 20互通
分别给PC1 和PC2配置IP地址、子网掩码和网关
进入系统视图,给交换机配置vlan
检查vlan是否创建成功 命令:display vlan
配置access接口,给端口配置Vlan
[Huawei]int e0/0/2
[Huawei-Ethernet0/0/1]port link-type access
[Huawei-Ethernet0/0/1]port default vlan 10
[Huawei-Ethernet0/0/1]int e0/0/2
[Huawei-Ethernet0/0/2]port link-type access
[Huawei-Ethernet0/0/2]port default vlan 20
配置trunk接口
[Huawei-GigabitEthernet0/0/1]port link-type trunk
允许通过trunk接口的vlan
[Huawei-GigabitEthernet0/0/1]port trunk allow-pass vlan 10 20
配置路由器信息
进入端口视图
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R
[R]int g0/0/0.1 (子接口)
定义g0/0/0.1子接口与vlan10相关联
[R-GigabitEthernet0/0/0.1]dot1q termination vid 10
为子接口配置IP地址
[R-GigabitEthernet0/0/0.1]ip address 10.10.0.1 24
处理ARP消息(华为设备默认不处理,需要打开)
[R-GigabitEthernet0/0/0.1]arp broadcast enable
[R-GigabitEthernet0/0/0.1]int g0/0/0.2
[R-GigabitEthernet0/0/0.2]dot1q terminat
[R-GigabitEthernet0/0/0.2]dot1q termination vid 20
[R-GigabitEthernet0/0/0.2]ip address 10.20.0.1 24
[R-GigabitEthernet0/0/0.2]arp broadcast enable
测试,两个vlan的主机互ping 看是否正常
经测试, 试验成功
原文地址:https://blog.51cto.com/14310201/2388289
时间: 2024-10-03 22:38:51