一.实验目的
学习配置DHCP服务器,并配置中继
二.实验拓扑
一.实验步骤
1.为服务器配置DHCP相关配置
2.配置DHCP中继
3.让客户端自动获取
四.实验内容
DHCP server
<H3C>system-view
[H3C]sysname ZJDHCP
[ZJDHCP]interface GigabitEthernet 0/0
[ZJDHCP-GigabitEthernet0/0]ip address 1.1.1.1 24
[ZJDHCP-GigabitEthernet0/0]undo shutdown
[ZJDHCP-GigabitEthernet0/0]quit
[ZJDHCP]dhcp enable
[ZJDHCP]dhcp server ip-pool 1
[ZJDHCP-dhcp-pool-1]network 2.2.2.10 mask 255.255.255.0
[ZJDHCP-dhcp-pool-1]gateway-list 2.2.2.1
[ZJDHCP-dhcp-pool-1]dns-list 2.2.2.254
[ZJDHCP-dhcp-pool-1]forbidden-ip 2.2.2.1 2.2.2.254
[ZJDHCP-dhcp-pool-1]expired day 20
[ZJDHCP-dhcp-pool-1]quit
[ZJDHCP]ip route-static 0.0.0.0 0.0.0.0 1.1.1.2
DHCP中继
<ZJZJ>system-view
[ZJZJ]sysname ZJZJ
[ZJZJ]interface GigabitEthernet 0/0
[ZJZJ-GigabitEthernet0/0]IP address 1.1.1.2 24
[ZJZJ-GigabitEthernet0/0]undo shutdown
[ZJZJ-GigabitEthernet0/0]quit
[ZJZJ]dhcp enable
[ZJZJ]interface GigabitEthernet 0/1
[ZJZJ-GigabitEthernet0/1]ip address 2.2.2.1 24
[ZJZJ-GigabitEthernet0/1]undo shutdown
[ZJZJ-GigabitEthernet0/1]dhcp server apply ip-pool 1 //指定接口引用的地址池
[ZJZJ-GigabitEthernet0/1]dhcp relay server-address 1.1.1.1 //在DHCP中继上指定DHCP服务器的地址
[ZJZJ-GigabitEthernet0/1]dhcp select relay //指定接口工作在DHCP中继模式
客户端
<H3C>system-view
[H3C]sysname PC
[PC]interface GigabitEthernet 0/0
[PC-GigabitEthernet0/0]ip address dhcp-alloc //自动获取IP