H3C-DHCP中继服务器前言一、实验拓扑二、配置需求三、配置步骤四、验证
前言
当企业内部网络规模较大时,通常被划分为多个不同的子网,网络内配置了VLAN,VLAN隔离了广播,而DHCP协议使用广播。DHCP中继代理其可以实现再不同子网和物理网段之间处理和转发dhcp信息的功能。下面是用华三模拟器模拟DHC中继和MAC地址绑定的实验。
一、实验拓扑 二、配置需求
1.按图示配置IP地址、VLAN等基础配置。
2.DHCP 服务器能够通过核心为vlan10、vlan20的主机分配地址。
3.指定终端主机获取的IP地址,即MAC地址绑定。
1.基础配置:配置IP地址、vlan等配置;
DHCP服务器基础配置:[DHCP-server]vlan 100[DHCP-server-vlan100]int vlan 100[DHCP-server-Vlan-interface100]ip add 192.168.100.254 24[DHCP-server-Vlan-interface100]int g1/0/1[DHCP-server-GigabitEthernet1/0/1]port access
核心交换机基础配置:[HX]vlan 10[HX-vlan10]vlan 20[HX-vlan20]vlan 100[HX-vlan100]int vlan 10[HX-Vlan-interface10]ip add 192.168.10.1 24[HX-Vlan-interface10]int vlan 20[HX-Vlan-interface20]ip add 192.168.20.1 24[HX-Vlan-interface20]int vlan 100[HX-Vlan-interface100]ip add 192.168.100.1 24[HX-Vlan-interface100]int g1/0/1[HX-GigabitEthernet1/0/1]port link-type trunk[HX-GigabitEthernet1/0/1]port trunk permit vlan 10 20 100[HX-GigabitEthernet1/0/1]undo port trunk permit vlan 1
接入交换机配置:[JR]vlan 10[JR-vlan10]vlan 20[JR-vlan20]vlan 100[JR-vlan100]int g1/0/1[JR-GigabitEthernet1/0/1]port link-type trunk[JR-GigabitEthernet1/0/1]int g1/0/4[JR-GigabitEthernet1/0/4]port access vlan 100[JR-GigabitEthernet1/0/4]int g1/0/2[JR-GigabitEthernet1/0/2]port access vlan 10[JR-GigabitEthernet1/0/2]int g1/0/5[JR-GigabitEthernet1/0/5]port access vlan 10[JR-GigabitEthernet1/0/5]int g1/0/3[JR-GigabitEthernet1/0/3]port access vlan 20[JR-GigabitEthernet1/0/3]int g1/0/6[JR-GigabitEthernet1/0/6]port access vlan 20
2.路由配置
DHCP服务器配置静态路由,是DHCP服务器与vlan10、vlan20网段互通;[DHCP-server]ip route-static 192.168.10.0 24 192.168.100.1[DHCP-server]ip route-static 192.168.20.0 24 192.168.100.1
3.DHCP 配置
DHCP服务器开启DHCP功能,并创建VLAN 10、VLAN 20的DHCP服务;[DHCP-server]dhcp enable[DHCP-server]dhcp server ip-pool vlan10[DHCP-server-dhcp-pool-vlan10] gateway-list 192.168.10.254[DHCP-server-dhcp-pool-vlan10] network 192.168.10.0 mask 255.255.255.0[DHCP-server-dhcp-pool-vlan10] dns-list 114.114.114.114 8.8.8.8[DHCP-server-dhcp-pool-vlan10]dhcp server ip-pool vlan20[DHCP-server-dhcp-pool-vlan20] gateway-list 192.168.20.1[DHCP-server-dhcp-pool-vlan20] network 192.168.20.0 mask 255.255.255.0[DHCP-server-dhcp-pool-vlan20] dns-list 114.114.114.114 8.8.8.8
核心交换机开启DHCP和DHCP中继,并指定DHCP服务器的IP地址;[HX]dhcp enable[HX]int vlan 10[HX-Vlan-interface10] dhcp select relay[HX-Vlan-interface10] dhcp relay server-address 192.168.100.254[HX-Vlan-interface10]interface Vlan-interface20[HX-Vlan-interface20] dhcp select relay[HX-Vlan-interface20] dhcp relay server-address 192.168.100.254
4.MAC地址绑定
DHCP服务器上配置MAC地址和IP地址绑定;[DHCP-server]dhcp server ip-pool vlan10[DHCP-server-dhcp-pool-vlan10]static-bind ip-address 192.168.10.100 mask 255.255.255.0 hardware-address 66b0-06bd-0306[DHCP-server-dhcp-pool-vlan10]dhcp server ip-pool vlan20[DHCP-server-dhcp-pool-vlan20]static-bind ip-address 192.168.20.100 mask 255.255.255.0 hardware-address 66b0-0886-0406
四、验证 1.DHCP服务器上查看地址分配情况:
2.终端的地址分配有三种情况分别是Auto(C )、static(C )、static(F)
Auto(C):表示IP地址为终端自动获取;static(C):表示IP地址为静态绑定;static(F):无效静态绑定,终端已获取IP地址或终端不在线;#此例为终端已获取IP地址,只需让终端重新获取地址即可;
3.终端自动获取地址;