第三章GRE.VPN思维导图及MGRE实验

MGRE实验

实验需求

1、R5为IsP,.只能进行Ip地址配置,其所有地址均配为公有IP地址﹔

2、R1和R5间使用PPP的PAP认证,R5为主认证方﹔

3、R2与R5之间使用ppp的cHAp认证,R5为主认证方﹔R3与R5之间使用HDLc封装;

4、R1、R2、R3构建一个NGRE环境,R1为中心站点,R1、R4间为点到点的GRE;4、整个私有网络基本RIP全网可达;

5、所有Pc设置私有为源IP,可以访问Rs环回,达到全网通;

6、R3与R5之间使用HDLc封装

实验思路


1、配置路由器和PC端的IP 地址;
2、在私网出口的接口路由上配置静态缺省,实现公网通;
3、R1和R5间使用PPP认证,R5为主认证方;
4、R3与R5之间使用HDLc封装;
5、R1、R2、R3构建一个NGRE环境,R1为中心站点;
6、在R1和R4之间构建点到点的GRE——使两端的私网能够互访;
7、所有PC设置私有IP为源IP,可以访问R5环回。

实验步骤

1、配置路由器和pc端的IP地址
2、在私网出口的接口路由上配置静态缺省,实现公网通
[R1]ip route-static 0.0.0.0 0 15.1.1.5 
[R2]ip route-static 0.0.0.0 0 25.1.1.5 
[R3]ip route-static 0.0.0.0 0 35.1.1.5 
[R4]ip route-static 0.0.0.0 0 45.1.1.5 

ping一下看是否公网通

3、R1和R5间使用PPP认证,R5为主认证方
[R5-aaa]local-user da password cipher d12345
[R5-aaa]local-user da service-type ppp
[R5-aaa]quit
[R5]int s 3/0/0
[R5-Serial3/0/0]ppp authentication-mode pap
[R5-Serial3/0/0]quit
[R1]int s 4/0/0         
[R1-Serial4/0/0]ppp pap local-user  da password cipher d12345
[R1-Serial4/0/0]quit

认证测试

[R1-Serial4/0/0]shutdown 
[R1-Serial4/0/0]undo shutdown

3、R2与R5之间使用ppp的cHAp认证,R5为主认证方

[R5]aaa 
[R5-aaa]la  
[R5-aaa]lo  
[R5-aaa]local-user da pa    
[R5-aaa]local-user da password ci   
[R5-aaa]local-user da password cipher d12345
[R5-aaa]loca    
[R5-aaa]local-user da ser   
[R5-aaa]local-user da service-type ppp
[R5-aaa]quit
[R5]int s 3/0/1
[R5-Serial3/0/1]ppp chap au 
[R5-Serial3/0/1]ppp au  
[R5-Serial3/0/1]ppp authentication-mode chap 
[R5-Serial3/0/1]q
[R2]int s 4/0/0
[R2-Serial4/0/0]ppp chap us 
[R2-Serial4/0/0]ppp chap use    
[R2-Serial4/0/0]ppp chap user da
[R2-Serial4/0/0]ppp chap pa 
[R2-Serial4/0/0]ppp chap password ci    
[R2-Serial4/0/0]ppp chap password cipher d12345
[R2-Serial4/0/0]quit
[R2]int s 4/0/0

认证测试

[R2-Serial4/0/0]shutdown 
[R2-Serial4/0/0]undo shutdown

4、R3与R5之间使用HDLc封装;
[R5]int s 2/0/0 
[R5-Serial2/0/0]link-protocol hdlc
[R3]int s 4/0/0
[R3-Serial4/0/0]link-protocol hdlc
5、R1、R2、R3构建一个MGRE环境,R1为中心站点

(1)构建MGRE隧道

[R1]int Tunnel 0/0/0
[R1-Tunnel0/0/0]ip add 10.1.2.1 24  
[R1-Tunnel0/0/0]tunnel-protocol gre p2mp
[R1-Tunnel0/0/0]source 15.1.1.1
[R1-Tunnel0/0/0]nhrp network-id 100
[R2]int Tunnel 0/0/0
[R2-Tunnel0/0/0]ip add 10.1.2.2 24
[R2-Tunnel0/0/0]tunnel-protocol gre p2mp 
[R2-Tunnel0/0/0]source 25.1.1.2
[R2-Tunnel0/0/0]nhrp network-id 100
[R2-Tunnel0/0/0]nhrp entry 10.1.2.1 15.1.1.1 register
[R3]int Tunnel 0/0/0
[R3-Tunnel0/0/0]ip add 10.1.2.3 24
[R3-Tunnel0/0/0]tunnel-protocol gre p2mp    
[R3-Tunnel0/0/0]source 35.1.1.3
[R3-Tunnel0/0/0]nhrp network-id 100
[R3-Tunnel0/0/0]nhrp entry 10.1.2.1 15.1.1.1 register 

在R1上查看是否获得了R2和R3的路由信息
[R1]dis nhrp peer all

 

2)配置路由协议(rip协议),并进入隧道口进行动态广播开启设置(模拟广播功能)、对进行了rip宣告的路由器关闭水平分割防环机制(总部不用)

[R1]rip 1
[R1-rip-1]v 2   
[R1-rip-1]undo summary 
[R1-rip-1]network 192.168.1.0
[R1-rip-1]network 10.0.0.0       #注意rip是主类宣告
[R2]rip 1
[R2-rip-1]v 2
[R2-rip-1]undo summary 
[R2-rip-1]network 192.168.2.0
[R2-rip-1]network 10.0.0.0
[R3]rip 1
[R3-rip-1]v 2
[R3-rip-1]undo summary 
[R3-rip-1]network 192.168.3.0
[R3-rip-1]network 10.0.0.0

查看是否配置成功

[R1]dis ip routing-table protocol rip

中心站点开启伪广播功能

[R1-Tunnel0/0/0]nhrp entry multicast dynamic
R1-R3关闭 水平分割机制(防环)

[R1-Tunnel0/0/0]undo rip split-horizon 
[R2-Tunnel0/0/0]undo rip split-horizon
[R3-Tunnel0/0/0]undo rip split-horizon 

测试:查看分支站点的rip路由表学习情况

测试R1-R3之间全网通

PC1pingPC2

PC1pingPC3

PC3pingPC2

6、在R1和R4之间构建点到点的GRE——使两端的私网能够互访
(1)在R1上创建Tunnel口,模式为GRE,源地址和目的地址为本端公网地址和对端公网地址

[R1]int t 0/0/1
[R1-Tunnel0/0/1]ip add 10.1.1.1 24
[R1-Tunnel0/0/1]tunnel-protocol gre
[R1-Tunnel0/0/1]source 15.1.1.1
[R1-Tunnel0/0/1]destination 45.1.1.4
(1)在R4上创建Tunnel口,模式为GRE,源地址和目的地址为本端公网地址和对端公网地址

[R4]int t 0/0/1
[R4-Tunnel0/0/1]ip add 10.1.1.4 24
[R4-Tunnel0/0/1]tunnel-protocol gre 
[R4-Tunnel0/0/1]source 45.1.1.4
[R4-Tunnel0/0/1]destination 15.1.1.1

查看隧道是否建成功

(3)在R1和R4上配置RIPv2宣告业务网段和Tunnel口网段,由于在构建MGRE环境的时候,R1已经配置过RIPV2了,所以这里只需要在R4上配置RIPV2

[R4]rip 1
[R4-rip-1]v 2
[R4-rip-1]network 192.168.4.0
[R4-rip-1]network 10.0.0.0

测试:PC1pingPC4

7、所有PC设置私有IP为源IP,可以访问R5环回。
私有IP访问公网环回使用NAT配置:

[R1]acl 2000    
[R1-acl-basic-2000]rule permit source 192.168.1.0 0.0.0.255
[R1-acl-basic-2000]quit
[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.0.255
[R2-acl-basic-2000]quit
[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.0.255
[R3-acl-basic-2000]quit
[R3]int s 4/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.0.255
[R4-acl-basic-2000]quit
[R4]int g0/0/0  
[R4-GigabitEthernet0/0/0]nat outbound 2000
查看一下是否能ping通R5的环回接口

PC1pingR5的环回接口

PC2pingR5的环回接口

PC3pingR5的环回接口

PC4pingR5的环回接口

  • 24
    点赞
  • 23
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值