dhcp 配置
R1配置dhcp
[Huawei]sys R1
[R1]dhcp enable
[R1]ip pool dhcp_name
[R1-ip-pool-dhcp_name]network 192.168.0.1 mask 24
[R1-ip-pool-dhcp_name]gateway-list 192.168.0.1
[R1-ip-pool-dhcp_name]static-bind ip-add 192.168.0.2 mac-address 5489-98EA-26AA //绑定mac地址所分配的地址
[R1-ip-pool-dhcp_name]q
[R1-GigabitEthernet0/0/0]ip add 192.168.0.1 24
[R1-GigabitEthernet0/0/0]dhcp select global
R2配置dhcp
[Huawei] sys R2
[R2]dhcp enable
[R2]ip pool dhcp_r2
[R2-ip-pool-dhcp_r2]network 172.16.0.1 mask 24
[R2-ip-pool-dhcp_r2]gateway-list 172.16.0.1
[R2-ip-pool-dhcp_r2]q
[R2]int g0/0/0
[R2-GigabitEthernet0/0/0]ip add 172.16.0.1 24
[R2-GigabitEthernet0/0/0]dhcp select global
dhcp snooping 配置
sw下配置
[Huawei]sys SW
[SW]dhcp enable
[SW]dhcp snooping enable
//接口下开启
[SW]int e 0/0/1
[SW-Ethernet0/0/1]dhcp snooping enable
[SW-Ethernet0/0/1]int e 0/0/3
[SW-Ethernet0/0/3]dhcp snooping en
[SW-Ethernet0/0/3]int e0/0/01
[SW-Ethernet0/0/1]dhcp snooping en
//指定信任端口
[SW-Ethernet0/0/1]dhcp snooping trusted