配置dhcp具体命令:
dhcp#configureterminal
//进入全局模式
dhcp(config)#servicedhcp
//启用dhcp服务
dhcp(config)#noipdhcpconflictlogging
//关闭dhcp日志记录
dhcp(config)#ipdhcppoolctocio
//配置dhcp服务器的名称为ctocio
dhcp(dhcp-config)#network192.168.2.0255.255.255.0
//配置dhcp服务器可分配的网段
dhcp(dhcp-config)#default-router192.168.2.1
//配置默认网关为192.168.2.1
dhcp(dhcp-config)#dns-server192.168.2.1
//配置dns为192.168.2.1
dhcp(dhcp-config)#exit
//退出dhcp配置模式
dhcp(config)#ipdhcpexcluded-address192.168.2.2192.168.2.10
//配置dhcp排除分配的地址
dhcp(config)#exit
//退出全局模式
dhcp(config)#showrun
//查看路由配置
客户端获取ip
在另一个和此路由器相连的路由器上,如果要为某个端口设置ip地址,通过下面的命令就可从dhcp服务器中获取ip地址。
client#configureterminal
//进入全局模式
dhcp(config)#interfacefastethernet0/1
//进入fastethernet0/1接口
dhcp(config-if)#ipaddressdhcp
//从dhcp获取ip地址
interfacefastethernet0/0assigneddhcpaddress192.168.2.11,mask255.255.255.0,hostnamer2这样的提示,客户端获取ip成功,这样避免配置专门的dhcp服务器,方便网络管理。
您可能感兴趣的文章:
如您对本文有疑问或者有任何想说的,请点击进行留言回复,万千网友为您解惑!
网友评论