路由器配置DHCP服务器实例解析
路由器配置要求:
企业内部计算机使用DHCP的方式获得IP 地址设置 DHCP 的地址为192.168.1.0/24 网络地址设置默认网关为 192.168.1.1,域名为ewao.cn,DNS 服务为61.128.114.133 IP 地址有效期为2 天
路由器配置如下:
Router(config)#int f0/0 Router(config-if)#ip add 192.168.1.1 255.255.255.0 Router(config-if)#no sh Router(config-if)#exit Router(config)#ip dhcp excluded-address 192.168.1.1 //需要排除路由器的接口既网关地址 Router(config)#ip dhcp pool DHCP //创建DHCP池 Router(dhcp-config)#network 192.168.1.0 /24 //宣告可分配网段 Router(dhcp-config)#default-Router 192.168.1.1 //设置客户端的默认网关 Router(dhcp-config)#dns-server 61.128.114.133 //设置客户端DNS地址 Router(dhcp-config)#lease 2 //地址租期 Router(dhcp-config)#domain-name ewao.cn //客户端所在域 Router(dhcp-config)#end
客户端配置:
路由器配置之IPV6的DHCP服务器配置:
Router(config)#ipv6 unicast-routing Router(config)#ipv6 cef Router(config)#ipv6 dhcp pool v6 Router(config-dhcp)# prefix-delegation pool v6pool Router(config-dhcp)# dns-server 2001:470:20::2 Router(config-dhcp)# domain-name ewao.cn Router(config-dhcp)#end
随之采用的IPV6技术也需要在客户端做相应配置。
路由器配置之验证:
Router#show ip dhcp database Router#show ip dhcp binding Bindings from all pools not associated with VRF: IP address Client-ID/ Lease expiration Type Hardware address/ User name 192.168.1.214 0100.e04c.3900.d1 Mar 07 2002 11:39 PM Automatic 192.168.1.215 01f0.def1.16c1.11 Mar 07 2002 07:27 PM Automatic 192.168.1.216 0100.26c7.6a28.1a Mar 07 2002 08:07 PM Automatic 192.168.1.219 01c4.4619.75b9.c0 Mar 07 2002 04:52 PM Automatic 192.168.1.221 0100.3018.b003.f1 Mar 07 2002 05:22 PM Automatic 192.168.1.222 0152.4153.2000.0c29. Mar 07 2002 04:48 PM Automatic 7ded.8700.0000.0000. 00 192.168.1.223 0152.4153.2000.0c29. Mar 07 2002 04:48 PM Automatic 7ded.8700.0001.0000. 00 192.168.1.224 0152.4153.2000.0c29. Mar 07 2002 04:48 PM Automatic 7ded.8700.0002.0000. 00 192.168.1.225 0152.4153.2000.0c29. Mar 07 2002 04:48 PM Automatic 7ded.8700.0003.0000. 00 192.168.1.226 0152.4153.2000.0c29. Mar 07 2002 04:48 PM Automatic 7ded.8700.0004.0000. 00 192.168.1.227 0152.4153.2000.0c29. Mar 07 2002 04:48 PM Automatic 7ded.8700.0005.0000. 00 192.168.1.228 0152.4153.2000.0c29. Mar 07 2002 04:48 PM Automatic 7ded.8700.0006.0000. 00 192.168.1.229 0152.4153.2000.0c29. Mar 07 2002 04:48 PM Automatic 7ded.8700.0007.0000. 00 192.168.1.230 0152.4153.2000.0c29. Mar 07 2002 04:48 PM Automatic 7ded.8700.0008.0000. 00 192.168.1.231 0152.4153.2000.0c29. Mar 07 2002 04:48 PM Automatic 7ded.8700.0009.0000. 00 192.168.1.232 0100.242c.54b5.9b Mar 07 2002 05:49 PM Automatic 192.168.1.235 018c.a982.9e8e.f8 Mar 08 2002 12:42 AM Automatic 192.168.1.236 01f0.def1.6045.74 Mar 07 2002 06:41 PM Automatic 192.168.1.241 0100.1f3c.0dee.82 Mar 08 2002 12:33 AM Automatic 192.168.1.242 0100.2710.f29b.20 Mar 08 2002 01:48 AM Automatic 192.168.1.244 0100.1b24.79ac.bc Mar 07 2002 10:56 PM Automatic 192.168.1.246 0188.ae1d.7426.51 Mar 07 2002 09:59 PM Automatic 192.168.1.249 0100.26c7.43ff.60 Mar 08 2002 01:19 AM Automatic
由于我们测试的设备开启了IPv4到IPv6的tunnel技术,即能够访问IPv6的网络也能同时访问IPv4网络的技术,所以在show ip dhcp binding时,会看到一些IPv6的地址被分配出来了。
路由器配置之故障排除:
相关推荐
diediexiaomi 2020-08-11
thlm0 2020-06-08
wq0 2020-05-25
服务器端攻城师 2020-04-14
HHLee 2020-02-17
huangzonggui 2020-02-16
xcznb 2020-02-13
vanturman 2020-01-23
leodengzx 2020-01-06
huangzonggui 2019-12-14
huangzonggui 2019-12-06
sapliang 2019-12-06
leodengzx 2019-12-07
OwenJi 2019-12-02
thlm0 2019-11-30
thlm0 2019-11-11
agou专家书院 2019-11-08
jzhf0 2015-05-04
zhangzhicheng 2008-04-25
xcznb 2007-12-19
charthyf 2007-12-13
鹏鹏之家 2007-11-28
thone00 2007-11-14
犇骉 2007-10-26
gxpgxp 2007-08-10
tianshijianbing 2008-04-18
sxlongwork 2019-10-12
书弋江山 2011-02-13
amorfait 2010-11-09
xcznb 2010-10-04
勿六七 2010-08-29
wenshifang 2010-08-27
云端轻躺 2010-08-23
sdfshfh 2010-04-16
勿六七 2009-10-31