PAP,CHAP,DHLC,MARE,RIP全网可达

HCIP 7.7作业 在这里插入图片描述
拓扑图
在这里插入图片描述

首先来讲R1-R5使用PPP的PAP认证
将R5设置为主认证方,对其设置用户和密码,用于R1拨号登录。

主认证方:
aaa
[R5-aaa]local-user xixi password cipher 12345
[R5-aaa]local-user huawei service-type ppp
[R5]interface Serial 4/0/0 连接客户端的接口
[R5-Serial4/0/0]link-protocol ppp
[R5-Serial4/0/0]ppp authentication-mode pap
[R5-Serial4/0/0]ip address 15.1.1.2 24

再使用 display ip interface brief查看情况
在这里插入图片描述
目前还是处于UP 状态所以我们要把该端口重新启动,即可完成认证

被认证方:
[R1-Serial4/0/0]ip address 15.1.1.1 24
此时我们去ping R5是ping不通的,所以要进行拨号认证
[R1-Serial4/0/0]ppp pap local-user xixi password cipher 12345
即R1和R5 pap认证完成

R2-R5 chap认证
和前面一样,R5位认证方 R2为被认证方

[R5-Serial4/0/1]ip address 25.1.1.2 24
[R2-Serial4/0/1]ip address 25.1.1.1 24
先给R5-R2分别分配地址,此时他们是互通的
现在我们给R5配置CHAP认证
[R5]aaa
[R5-aaa]loc
[R5-aaa]local-user haha password cipher huawei
[R5]interface Serial 4/0/1
[R5-Serial4/0/1]link-protocol ppp
[R5-Serial4/0/1]ppp authentication-mode chap
配置认证后,此时R5-R2是不通的,需通过R2进行拨号方可互通
[R2-Serial4/0/1]link-protocol ppp
[R2-Serial4/0/1]ppp chap user haha
[R2-Serial4/0/1]ppp chap password cipher huawei

R3-R5因为使用的是HDLC认证,所以要修改一下封装类型
[R5-Serial2/0/0]link-protocol hdlc
Warning: The encapsulation protocol of the link will be changed. Continue? [Y/N]
:y
[R3-Serial4/0/0]link-protocol hdlc
Warning: The encapsulation protocol of the link will be changed. Continue? [Y/N]
:y
再对其配置Ip
[R3-Serial4/0/0]ip address 35.1.1.1 24
[R5-Serial2/0/0]ip address 35.1.1.2 24

可以看到三个串口连击都互通了
在这里插入图片描述

根据题目给个路由配置相应的ip
R1:
[R1-GigabitEthernet0/0/0]ip address 192.168.1.1 24
R2:
[R2-GigabitEthernet0/0/0]ip address 192.168.2.1 24
R3:
[R3-GigabitEthernet0/0/0]ip address 192.168.3.1 24
R4:
[R4-GigabitEthernet0/0/1]ip address 192.168.4.1 24
[Huawei-GigabitEthernet0/0/0]ip address 45.1.1.1 24
R5:
[R5-LoopBack0]ip address 5.5.5.5 24
[R5-GigabitEthernet0/0/0]45.1.1.2 24
再给所有路由器(除了R5),配置缺省路由,使得全网可达
ip route-static 0.0.0.0 +0+ 下一跳

使用GRE连接R1和R4
[R1]int t0/0/0
[R1-Tunnel0/0/0]ip address 14.1.1.1 24
[R1-Tunnel0/0/0]tunnel-protocol gre
[R1-Tunnel0/0/0]source 15.1.1.1(自己的物理接口)
[R1-Tunnel0/0/0]description 45.1.1.1(对方的物理接口)
R4同理,只不过要将目标端口和源端口调换
在这里插入图片描述

R1-R2-R3使用MGRE连接,且R1为中心
[R1]int t0/0/1
[R1-Tunnel0/0/1]ip address 123.1.1.1 24
[R1-Tunnel0/0/1]tunnel-protocol gre p2mp (选择点到多点的类型)
[R1-Tunnel0/0/1]nhrp entry multicast dynamic(设置自己为中心站点)
[R1-Tunnel0/0/1]source 15.1.1.1(源端口)
[R1-Tunnel0/0/1]nhrp network-id 100(判断是否是同一个id)

R2:
[R2-Tunnel0/0/0]ip address 123.1.1.2 24
[R2-Tunnel0/0/0]source Serial 4/0/1
[R2-Tunnel0/0/0]tunnel-protocol gre p2mp
[R2-Tunnel0/0/0]nhrp network-id 100
[R2-Tunnel0/0/0]nhrp entry 123.1.1.1 15.1.1.1 register

R3:
[R3]interface t0/0/0
[R3-Tunnel0/0/0]ip address 123.1.1.3 24
[R3-Tunnel0/0/0]tunnel-protocol gre p2mp
[R3-Tunnel0/0/0]nhrp network-id 100
[R3-Tunnel0/0/0]nhrp entry 123.1.1.1 15.1.1.1 register
[R3-Tunnel0/0/0]source s4/0/0
测试结果:
在这里插入图片描述

在这里插入图片描述

用rip使其互通

[R1]rip 1
[R1-rip-1]version 2
[R1-rip-1]un summary
[R1-rip-1]network 192.168.1.0
[R1-rip-1]network 14.0.0.0
[R1-rip-1]network 123.0.0.0
[R1-rip-1]display ip routing-table
因为RIP的水平分割机制, 我们需要将其关闭,不然R3和R2不能互相学习
[R1]int t0/0/1
[R1-Tunnel0/0/1]undo rip split-horizon
在这里插入图片描述
R2和R3和R4同理,但不需要修改水平分割,且宣告时,只需要宣告自己的私有网段和vpn网段即可。

ping通结果
在这里插入图片描述
最后给各个电脑配置ip ,并连通即可
在这里插入图片描述

使所有私有网段连通R5环回
使用nat地址转换
R1-R4:
acl 200
rule per
rule permit soure 192.168.1.0 0.0.0.255
int s4/0/0
nat outbound 2000

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值