一、拓撲圖如下
二、配置思路
1、啓動DHCP服務;
2、創建VLANIF接口,並配置VLANIF接口的IP地址;
3、使能VLANIF接口地址池;
4、配置地址池的相關屬性
三、操作步驟
1、啓動DHCP服務
[DHCPServer] dhcp enable
2、創建VLAN
[DHCPServer]vlan batch 10 20
3、配置接口並加入vlan
#配置GE0/0/1接口加入vlan10
[DHCPServer] interface gigabitethernet 0/0/1
[DHCPServer-GigabitEthernet0/0/1] port hybrid pvid vlan 10
[DHCPServer-GigabitEthernet0/0/1] port hybrid untagged vlan 10
[DHCPServer-GigabitEthernet0/0/1] quit
#配置GE0/0/2接口加入vlan20
[DHCPServer] interface gigabitethernet 0/0/2
[DHCPServer-GigabitEthernet0/0/2] port hybrid pvid vlan 20
[DHCPServer-GigabitEthernet0/0/2] port hybrid untagged vlan 20
[DHCPServer-GigabitEthernet0/0/2] quit
4、配置VLANIF接口IP地址
# 配置VLANIF10接口地址。
[DHCPServer] interface vlanif 10
[DHCPServer-Vlanif10] ip address 192.168.10.1 24
[DHCPServer-Vlanif10] quit
# 配置VLANIF11接口地址。
[DHCPServer] interface vlanif 20
[DHCPServer-Vlanif20] ip address 192.168.20.1 24
[DHCPServer-Vlanif20] quit
5、使能VLANIF接口地址池
# 配置VLANIF10接口下的客戶端從接口地址池中獲取IP地址。
[DHCPServer] interface vlanif 10
[DHCPServer-Vlanif10] dhcp select interface
[DHCPServer-Vlanif10] quit
# 配置VLANIF20接口下的客戶端從接口地址池中獲取IP地址。
[DHCPServer] interface vlanif 20
[DHCPServer-Vlanif11] dhcp select interface
[DHCPServer-Vlanif11] quit
6、配置接口地址池地址租用期限
# 配置VLANIF10接口地址租用期限爲30天。
[DHCPServer] interface vlanif 10
[DHCPServer-Vlanif10] dhcp server lease day 30
[DHCPServer-Vlanif10] quit
# 配置VLANIF20接口地址租用期限爲20天。
[DHCPServer] interface vlanif 20
[DHCPServer-Vlanif11] dhcp server lease day 20
[DHCPServer-Vlanif11] quit
7、驗證配置結果。
在DHCPServer上使用display ip pool interface命令用來查看接口地址池配置情況
配置完成,你學會了嗎,請繼續關注