MGRE综合实验

一、实验要求

1,R5为 ISP ,只能进行 IP 地址配置;其所有地址均配为公有 IP 地址
2,R1和R5间使用 PPP 的 PAP 认证,R5为主认证方;R2于R5之间使用 PpP 的 chap 认证,R5为主认证方;R3于R5之间使用 HDLC 封装。
3,R1/R2/R3构建一个 MGRE 环境,R1为中心站点;R1、R4间为点到点的 GRE 。
4,整个私有网络基于 RIP 全网可达
5,所有 PC 设置私有 IP 为源 IP ,可以访问R5环回 

二、IP的配置

r1

[r1]interface Serial 4/0/0	
[r1-Serial4/0/0]ip address 15.0.0.1 24
[r1-Serial4/0/0]int g0/0/0
[r1-GigabitEthernet0/0/0]ip address 192.168.1.1 24 
[r1-GigabitEthernet0/0/0]qu

r2

[r2]interface Serial 4/0/0 
[r2-Serial4/0/0]ip address 25.0.0.1 24
[r2-Serial4/0/0]int g0/0/0
[r2-GigabitEthernet0/0/0]ip address 192.168.2.1 24
[r2-GigabitEthernet0/0/0]qu

r3

[r3]interface Serial 4/0/0
[r3-Serial4/0/0]ip address 35.0.0.1 24
[r3-Serial4/0/0]int g0/0/0
[r3-GigabitEthernet0/0/0]ip address 192.168.3.1 24
[r3-GigabitEthernet0/0/0]qu

r4

[r4]int g0/0/0
[r4-GigabitEthernet0/0/0]ip address 45.0.0.1 24
[r4-GigabitEthernet0/0/0]int g0/0/1
[r4-GigabitEthernet0/0/1]ip address 192.168.4.1 24

r5

[r5]sys isp
[isp]interface Serial 3/0/0
[isp-Serial3/0/0]ip address 15.0.0.2 24
[isp-Serial3/0/0]int s 3/0/1
[isp-Serial3/0/1]ip address 25.0.0.2 24
[isp-Serial3/0/1]int s 4/0/0
[isp-Serial4/0/0]ip address 35.0.0.2 24 
[isp-Serial4/0/0]int g0/0/0
[isp-GigabitEthernet0/0/0]ip address 45.0.0.2 24
[isp-GigabitEthernet0/0/0]int l0
[isp-LoopBack0]ip address 5.5.5.5 24
[isp-LoopBack0]q

三、实验内容

1.R1和R5间使用 PPP 的 PAP 认证,R5为主认证方;R2于R5之间使用 PpP 的 chap 认证,R5为主认证方;R3于R5之间使用 HDLC 封装。

[r1]int s 4/0/0
[r1-Serial4/0/0]ppp pap ? 	
[r1-Serial4/0/0]ppp pap local-user admin ?
[r1-Serial4/0/0]ppp pap local-user admin password ?	
[r1-Serial4/0/0]ppp pap local-user admin password cipher 123456	
[r1-Serial4/0/0]shutdown 
[r1-Serial4/0/0]undo shutdown 
[r1-Serial4/0/0]ping 15.0.0.2

因为PPP会话一次性会话是一次性会话,不会因为中途配置而中断会话,所以需要重新打开接口测试  

[r2]int s 4/0/0
[r2-Serial4/0/0]ppp chap user admin
[r2-Serial4/0/0]ppp chap password ?
[r2-Serial4/0/0]ppp chap password cipher 123456
[r2-Serial4/0/0]shutdown
[r2-Serial4/0/0]undo shut	
[r2-Serial4/0/0]undo shutdown
[r2-Serial4/0/0]ping 25.0.0.2

[r3]int s4/0/0
[r3-Serial4/0/0]link-protocol ?	
[r3-Serial4/0/0]link-protocol hdlc 
Warning: The encapsulation protocol of the link will be changed. Continue? [Y/N]
:y
[r3]display interface Serial4/0/0

[isp]int s4/0/0
[isp-Serial4/0/0]lim	
[isp-Serial4/0/0]lin	
[isp-Serial4/0/0]link-protocol hd	
[isp-Serial4/0/0]link-protocol hdlc 
Warning: The encapsulation protocol of the link will be changed. Continue? [Y/N]
:y

记着写缺省

[r1]ip route-static 0.0.0.0 0 15.0.0.2
[r2]ip route-static 0.0.0.0 0 25.0.0.2
[r3]ip route-static 0.0.0.0 0 35.0.0.2
[r4]ip route-static 0.0.0.0 0 45.0.0.2

 

 2.R1/R2/R3构建一个 MGRE 环境,R1为中心站点;R1、R4间为点到点的 GRE 。

GRE:

创建Tunnel虚拟接口

[r1]interface Tunnel 0/0/0
[r1-Tunnel0/0/0]ip address 192.168.6.1 24	
[r1-Tunnel0/0/0]tunnel-protocol gre ---封装方式
[r1-Tunnel0/0/0]source 15.0.0.1
[r1-Tunnel0/0/0]destination 45.0.0.1
[r1-Tunnel0/0/0]qu
[r4]int t0/0/0
[r4-Tunnel0/0/0]ip address 192.168.6.2 24	
[r4-Tunnel0/0/0]tunnel-protocol gre 
[r4-Tunnel0/0/0]source 45.0.0.1
[r4-Tunnel0/0/0]destination 15.0.0.1
[r4-Tunnel0/0/0]qu

隧道两端接口已经接通用r4来ping一下192.168.6.1 

  MGRE:

[r1]int t0/0/1
[r1-Tunnel0/0/1]ip add	
[r1-Tunnel0/0/1]ip address 192.168.5.1 24      
[r1-Tunnel0/0/1]tunnel-protocol gre p2mp       //定义封装
[r1-Tunnel0/0/1]source 15.0.0.1
[r1-Tunnel0/0/1]nhrp network-id 100             //创建域
[r1-Tunnel0/0/1]nhrp entry multicast dynamic         //开启微广播
[r2]int t0/0/0
[r2-Tunnel0/0/0]ip address 192.168.5.2 24	
[r2-Tunnel0/0/0]tunnel-protocol gre p2mp 	
[r2-Tunnel0/0/0]source Serial 4/0/0	
[r2-Tunnel0/0/0]nhrp network-id 100
[r2-Tunnel0/0/0]nhrp entry 192.168.5.1 15.0.0.1 re
[r3]int t0/0/0	
[r3-Tunnel0/0/0]ip address 192.168.5.3 24	
[r3-Tunnel0/0/0]tunnel-protocol gre p2mp 
[r3-Tunnel0/0/0]source s4/0/0
[r3-Tunnel0/0/0]nhrp network-id 100	
[r3-Tunnel0/0/0]nhrp entry 192.168.5.1 15.0.0.1 register 

 3. RIP 全网可达

[r1]rip
[r1-rip-1]v 2
[r1-rip-1]network 192.168.1.0
[r1-rip-1]n	
[r1-rip-1]network 192.168.5.0
[r1-rip-1]network 192.168.6.0
[r2] rip
[r2-rip-1]v 2
[r2-rip-1]network 192.168.2.0
[r2-rip-1]network 192.168.5.0
[r3]rip
[r3-rip-1]v 2
[r3-rip-1]network 192.168.3.0
[r3-rip-1]network 192.168.5.0
[r4]rip
[r4-rip-1]v 2
[r4-rip-1]network 192.168.4.0
[r4-rip-1]network 192.168.6.0

打开路由信息发现r2与r3没有对方的路由信息由于RIP的水平分割导致的,所以还需要在NFS隧道接口上关闭水平分割

[r1-Tunnel0/0/1]undo rip split-horizon

再次查看,R2和R3就有对方路由了

 此时rip全网可达

4.所有 PC 设置私有 IP 为源 IP ,可以访问R5环回 

进行NAT配置

[r1]acl 2000
[r1-acl-basic-2000]rule permit source 192.168.1.0 0.0.255.255
[r1-acl-basic-2000]qu
[r1]int s4/0/0	
[r1-Serial4/0/0]nat outbound 2000
[r2]acl 2000
[r2-acl-basic-2000]rule permit source 192.168.2.0 0.0.255.255
[r2-acl-basic-2000]q
[r2]int s4/0/0
[r2-Serial4/0/0]nat outbound 2000

[r3]acl 2000	
[r3-acl-basic-2000]rule permit source 192.168.3.0 0.0.255.255
[r3-acl-basic-2000]q
[r3]int s4/0/0	
[r3-Serial4/0/0]nat outbound 2000
[r4]acl 2000
[r4-acl-basic-2000]rule permit source 192.168.4.0 0.0.255.255
[r4-acl-basic-2000]q
[r4]int g0/0/0
[r4-GigabitEthernet0/0/0]nat outbound 2000
[r4-GigabitEthernet0/0/0]qu

 

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值