1.1 DHCP Server
1.1.1 拓撲
1.1.2 配置
1)配置接口IPspa
xNet#con torm
xNet(config)#interface ge48router
xNet(config-if)#ip address 192.168.15.1/24server
xNet(config-if)#enddns
xNet#接口
2)配置DHCP Server地址池,網段與ge48匹配ip
xNet#con t路由
xNet(config)#ip dhcp pool xxx //地址池it
xNet(dhcp-config)#network 192.168.15.0/24 //地址池網段設置io
xNet(dhcp-config)#range 192.168.15.100 192.168.15.110 //地址池添加範圍
xNet(dhcp-config)#default-router 192.168.15.1
xNet(dhcp-config)#dns-server 192.168.15.1
xNet(dhcp-config)#end
xNet#
3)打開DHCP Server服務
xNet#con t
xNet(config)#service dhcp
xNet(config)#end
xNet#
1.1.3 結果
1)利用DHCP Client去動態獲取IP
1.2 DHCP Relay
1.2.1 拓撲
1.2.2 配置
1)Server端添加一個其它網段的地址池
xNet#con t
xNet(config)#ip dhcp pool yyy
xNet(dhcp-config)#network 192.168.207.0/24
xNet(dhcp-config)#range 192.168.207.100 192.168.207.110
xNet(dhcp-config)#exit
xNet(config)#service dhcp
xNet(config)#end
xNet#
2)在中繼端配置好相關配置並啓動dhcp relay
xNet#con t
xNet(config)#ip dhcp relay server-ip 192.168.15.1
xNet(config)#ip dhcp relay information option
xNet(config)#ip dhcp relay information policy forward
xNet(config)#service dhcp relay
xNet(config)#end
xNet#
注:在Server端要回復外網段的地址時,須要配置路由,否則DHCP應答時找不到下一跳,該例配置一條靜態路由
xNet#con t
xNet(config)#ip route 192.168.207.0/24 192.168.15.207
xNet(config)#end
xNet#