路由器基础配置之dhcp配置

我们将以上面的拓扑图为例,router9为dhcp的服务器,为pc4,5,6分配三个不同网段的地址,pool为要分配的三个地址池,我们要把pc4设置为12网段,pc5设置成34网段,pc6设置成56网段

首先为路由器分配ip地址

router9:

en  进入特权模式

config t  进入全局配置模式

interface s0/3/0

ip address 192.168.100.1 255.255.255.0

no shu

exit

interface g0/0

ip address 192.168.12.254 255.255.255.0

no shu

 

router10:

en  进入特权模式

config t  进入全局配置模式

interface s0/3/0

ip address 192.168.100.2 255.255.255.0

clock rate 6400

no shu

exit

interface s0/3/1

ip address 192.168.200.1 255.255.255.0

clock rate 6400

no shu

interface g0/0

ip address 192.168.34.254 255.255.255.0

no shu

 

router11:

en  进入特权模式

config t  进入全局配置模式

interface s0/3/0

ip address 192.168.200.2 255.255.255.0

no shu

exit

interface g0/0

ip address 192.168.56.254 255.255.255.0

no shu

ip地址分配完毕,现在配置rip路由,方便路由器之间的通信

router9

在全局配置模式下

router rip

ver 2

network 192.168.12.0

network 192.168.100.0

 

router10

在全局配置模式下

router rip

ver 2

network 192.168.34.0

network 192.168.100.0

network 192.168.200.0

 

router11

在全局配置模式下

router rip

ver 2

network 192.168.200.0

network 192.168.56.0

 

rip配置完毕,现在开始配置dhcp,拓扑图中的路由器为思科的2911,在模拟器中。dhcp是默认开启的,所以我们直接定义地址池即可

router9

在全局配置模式下

ip dhcp pool ccie  定义的地址池的名称

network 192.168.12.0 255.255.255.0  定义地址段

default-router 192.168.12.254  定义网关

exit

ip dhcp excluded-address 192.168.12.254 设置不分配的地址或者地址段,可写两个地址,这两个地址包括之间的地址都为排除的地址

ip dhcp pool qqq  在定义一个地址池

network 192.168.34.0 255.255.255.0

default-router 192.168.34.254

exit

ip dhcp excluded-address 192.168.34.254

ip dhcp pool abc 定义第三个地址池

network 192.168.56.0 255.255.255.0

default-router 192.168.56.254

exit

ip dhcp excluded-address 192.168.56.254

router9的dhcp配置完毕,pc4已经可以分配,但pc5和pc6在其他路由器之下,所以我们这里需要用到dhcp中继

router10

在全局配置模式下

interface g0/0

ip helper-address 192.168.100.1  离dhcp路由器最近的那个dhcp路由器上的接口

这样router10的中继就配置完毕了

router11

在全局配置模式下

interface g0/0

ip helper-address 192.168.100.1

这样router11的中继也配置完成了,接下来就可以开启pc机的dhcp功能获取地址了

 

转载于:https://www.cnblogs.com/wuhaohao/p/9267296.html

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值