- 使能DHCP服务
[LSW1]dhcp enable - 配置接口加入VLAN
[LSW1]vlan batch 10 20
[LSW1-GigabitEthernet0/0/1]port link-type hybrid
[LSW1-GigabitEthernet0/0/1]port hybrid pvid vlan 10
[LSW1-GigabitEthernet0/0/1]port hybrid untagged vlan 10
[LSW1-GigabitEthernet0/0/2]port link-type hybrid
[LSW1-GigabitEthernet0/0/2]port hybrid pvid vlan 20
[LSW1-GigabitEthernet0/0/2]port hybrid untagged vlan 20 - 配置VLANIF接口IP地址
[LSW1]int Vlanif 10
[LSW1-Vlanif10]ip add 10.1.1.1 24
[LSW1-Vlanif10]int Vlanif 20
[LSW1-Vlanif20]ip add 10.1.2.1 24 - 配置接口地址池
[LSW1-Vlanif10]dhcp select interface
[LSW1-Vlanif10]dhcp server lease day 30
[LSW1-Vlanif10]dhcp server domain-name abc.com
[LSW1-Vlanif10]dhcp server dns-list 8.8.8.8
[LSW1-Vlanif10]dhcp server static-bind ip-address 10.1.1.100 mac-address 5489-9F7-40E7
[LSW1-Vlanif20]dhcp select interface
[LSW1-Vlanif20]dhcp server lease day 2
[LSW1-Vlanif20]dhcp server domain-name abc.com
[LSW1-Vlanif20]dhcp server dns-list 8.8.8.8 - 配置DHCP数据保存功能,设备发生故障时,可以在系统重启后,执行命令dhcp server database recover,从存储设备文件恢复DHCP数据
[LSW1]dhcp server database enable - PC选择DHCP方式获取IP地址
- 验证配置
华为设备配置为DHCP服务器
最新推荐文章于 2024-09-27 13:28:07 发布