思科,DHCP Relay 中继代理,自动分配IP地址。

今天下午没课,自己做了一个实验项目。

1.连接DHCP拓扑图:

2.设置服务器Server0的配置及DHCPP中继配置,如下:服务器本机IP :192.168.2.1;子网掩码:255.255.255.0;网关:192.168.2.254;域名解析服务:192.168.2.1。

 

3.配置DHCP服务器。开启DHCP服务,设置serverPool,默认网关:192.168.2.254;DNS:192.168.2.1;起始IP:192.168.2.10;最大分配用户100,点击save保存。
 

 

添加一个serverPool-1,默认网关:192.168.1.254;DNS:192.168.1.1;起始IP:192.168.1.10;最大分配用户100,点击add添加新地址池。

 

4.配置路由器信息,根据拓扑图路由器Router0连接带192.168.1.0网段。
(1)点击路由器,进入physical,关闭路由器电源,点击HWIC-2T给路由器添加一块HWIC-2T模块,接通路由器电源。如图:
 

 

 

(2)Router1配置如下:


         --- System Configuration Dialog ---

Continue with configuration dialog? [yes ]: no


Press RETURN to get started!



Router>en
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#int f0/0     //配置端口
Router(config-if)#ip add 192.168.2.254  255.255.255.0       //设置端口IP
Router(config-if)#no shut            //开启端口
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up

Router(config-if)#int se0/1/0     //配置串行口
Router(config-if)#ip add 10.1.1.2 255.255.255.0   //设置端口IP
Router(config-if)#no shut      //开启端口
%LINK-5-CHANGED: Interface Serial0/1/0, changed state to down
Router(config-if)#exit      //退出当前配置
Router(config)#ip route 192.168.1.0 255.255.255.0 10.1.1.1   //192.168.1.0网段的数据包交给10.1.1.1端口处理。或者是说要找192.168.1.0网段去10.1.1.1端口找。

 

(3)Router0配置如下:


    --- System Configuration Dialog ---

Continue with configuration dialog? [yes ]: no


Press RETURN to get started!



Router>en
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#int f0/0       //配置端口
Router(config-if)#ip add 192.168.1.254   255.255.255.0   //设置端口IP
Router(config-if)#ip helper-address 192.168.2.1   //把端口fa0/0的DHCP服务申请交给192.168.2.1服务器处理。
Router(config-if)#no shut     //开启端口
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up

Router(config)#int se0/1/0    // 配置串行口
Router(config-if)#ip add 10.1.1.1 255.255.255.0   //设置端口IP
Router(config-if)#no shut     //开启端口
%LINK-5-CHANGED: Interface Serial0/1/0, changed state to up

Router(config-if)#exit
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/1/0, changed state to up

Router(config)#ip route 192.168.2.0 255.255.255.0 10.1.1.2    //192.168.2.0网段的数据包交给10.1.1.2端口处理。或者是说要找192.168.2.0网段去10.1.1.2端口找。

 

 

5.测试PC自动获取IP。
 

 

 

在拓扑图的基础上要再加一个192.168.3.0网段如下图应该怎么设置呢?
 

1.之前的配置不变。在服务器DHCP服务中再添加一个新的地址池,如下图:

 

 

2.配置路由器信息。


(1)Router1配置如下:


Router>en
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#ip route 192.168.3.0 255.255.255.0 10.1.1.1  //192.168.3.0网段的数据包交给10.1.1.1端口处理。或者是说要找192.168.3.0网段去10.1.1.1端口找。
Router(config)#

(2)Router0配置如下:


Router(config)#
Router(config)#int f0/1         //设置端口
Router(config-if)#ip add 192.168.3.254 255.255.255.0    //设置端口IP
Router(config-if)#ip helper-address 192.168.2.1    //把端口fa0/1的DHCP服务申请交给192.168.2.1服务器处理。
Router(config-if)#no shut    // 开启端口
%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up

Router(config-if)#

 

3.测试PC 自动获取IP。

其他的连接方式跟以上类似。
 

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

容浔˙

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值