创建拓扑
先配置AR2
[Huawei]dhcp enable 开启DHCP
[Huawei]int g 0/0/1.1 进入子接口
[Huawei-GigabitEthernet0/0/1.1]dot1q terminatio vid 10 处理vlan 10报文
[Huawei-GigabitEthernet0/0/1.1]arp broadcast enable 开启接口处理arp广播报文
[Huawei-GigabitEthernet0/0/1.1]ip add 192.168.1.1 24 配置子接口ip
[Huawei-GigabitEthernet0/0/1.1]dhcp select global 选择全局地址池
[Huawei-ip-pool-vlan10]ip pool vlan10 创建地址池
[Huawei-ip-pool-vlan10]gateway-list 192.168.1.1 下发的网关(需要与子接口ip一致)
[Huawei-ip-pool-vlan10]network 192.168.1.0 mask 24 下发的网段及其子网掩码
[Huawei-ip-pool-vlan10]quit [Huawei]int g 0/0/1.2
[Huawei-GigabitEthernet0/0/1.2]dot1q terminatio vid 20
[Huawei-GigabitEthernet0/0/1.2]ip add 192.168.10.1 24
[Huawei-GigabitEthernet0/0/1.2]arp broadcast enable
[Huawei-GigabitEthernet0/0/1.2]dhcp select global
[Huawei-GigabitEthernet0/0/1.2]ip pool vlan20
[Huawei-ip-pool-vlan20]network 192.168.10.0 mask 24
[Huawei-ip-pool-vlan20]gateway-list 192.168.10.1
[Huawei-ip-pool-vlan20]
配置LSW1
vlan batch 10 20 创建vlan 10 和 vlan 20
interface GigabitEthernet0/0/1
port link-type trunk 接口模式改为trunk
port trunk allow-pass vlan 10 20 允许vlan 10,20通过
interface GigabitEthernet0/0/2
port link-type access
port default vlan 10
interface GigabitEthernet0/0/3
port link-type access p
ort default vlan 20