ISP-VPN实验

文章目录

ISP-VPN实验

一,实验拓扑

初始拓扑:

最终拓扑:

二、实验要求

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规划

根据实验要求可知,假定用192.168.1.0/24到192.168.6.0六个网段作为R1到PC1、R2到PC2、R3到PC3、R4到PC4、MGRE网段、GRE网段的网段:

复制代码
192.168.1.0/24  ---> R1到PC1
192.168.2.0/24  ---> R2到PC2
192.168.3.0/24  ---> R3到PC3
192.168.4.0/24  ---> R4到PC4
192.168.5.0/24  ---> MGRE网段
192.168.6.0/24  ---> GRE网段
192.168.7.0/24  ---> 备用网段

四、实验配置

1、IP配置

R1的配置
复制代码
[r1]interface Serial 4/0/0
[r1-Serial4/0/0]ip add 15.0.0.1 24
[r1]int g 0/0/0
[r1-GigabitEthernet0/0/0]ip add 192.168.1.254 24
R2的配置
复制代码
[r2]interface Serial 4/0/0
[r2-Serial4/0/0]ip add 25.0.0.2 24
[r2]int g 0/0/0
[r2-GigabitEthernet0/0/0]ip add 192.168.2.254 24
R3的配置
复制代码
[r3]interface Serial 4/0/0
[r3-Serial4/0/0]ip add 35.0.0.3 24
[r3]int g 0/0/0
[r3-GigabitEthernet0/0/0]ip add 192.168.3.254 24
R4的配置
复制代码
[r4]interface GigabitEthernet 0/0/1
[r4-GigabitEthernet0/0/1]ip add 45.0.0.4 24
[r4-GigabitEthernet0/0/1]int g 0/0/0
[r4-GigabitEthernet0/0/0]ip add 192.168.4.254 24
R5的配置
复制代码
[r5]int s 3/0/0
[r5-Serial3/0/0]ip add 15.0.0.5 24
[r5-Serial3/0/0]int s 3/0/1
[r5-Serial3/0/1]ip add 25.0.0.5 24 
[r5-Serial3/0/1]int s 4/0/0
[r5-Serial4/0/0]ip add 35.0.0.5 24 
[r5-Serial4/0/0]int g 0/0/0
[r5-GigabitEthernet0/0/0]ip add 45.0.0.5 24
[r5]int l 0
[r5-LoopBack0]ip add 5.5.5.1 24

2、配置缺省路由

给r1---r4都配置一条缺省路由指向公网,使分支与公网环回网络连通。

复制代码
[r1]ip route-static 0.0.0.0 0 15.0.0.5
[r2]ip route-static 0.0.0.0 0 25.0.0.5
[r3]ip route-static 0.0.0.0 0 35.0.0.5
[r4]ip route-static 0.0.0.0 0 45.0.0.5

3、认证与被认证配置

R1和R5间使用PPP的PAP认证,R5为主认证方;

复制代码
认证方:
[r5]aaa	
[r5-aaa]local-user huawei password cipher 123456
Info: Add a new user.
[r5-aaa]local-user huawei service-type ppp	
[r5]int s 3/0/0
[r5-Serial3/0/0]ppp authentication-mode pap

被认证方:
[r1-Serial4/0/0]ppp pap local-user huawei password cipher 123456

R2于R5之间使用PPP的chap认证,R5为主认证方;

复制代码
认证方:
[r5-aaa]local-user nanjing password cipher 654321
Info: Add a new user.
[r5-aaa]local-user nanjing service-type ppp 
[r5-aaa]q
[r5]int s 3/0/1
[r5-Serial3/0/1]ppp authentication-mode chap 

被认证方:
[r2]int s 4/0/0
[r2-Serial4/0/0]ppp chap user nanjing
[r2-Serial4/0/0]ppp chap password cipher 654321

4、HDLC封装

R3于R5之间使用HDLC封装。

复制代码
[r3]int s 4/0/0	
[r3-Serial4/0/0]link-protocol hdlc 

[r5]int s 4/0/0
[r5-Serial4/0/0]link-protocol hdlc 

5、构建MGRE和GRE

R1/R2/R3构建一个MGRE环境,R1为中心站点;

复制代码
中心站点:
[r1]interface Tunnel 0/0/0
[r1-Tunnel0/0/0]ip add 192.168.5.1 24
[r1-Tunnel0/0/0]tunnel-protocol gre p2mp   ---> 修改接口的封装协议为MGRE
[r1-Tunnel0/0/0]source 15.0.0.1            ---> 规定封装源15.0.0.1
[r1-Tunnel0/0/0]nhrp network-id 100        ---> 创建NHRP域

分支站点:
[r2]interface Tunnel 0/0/0
[r2-Tunnel0/0/0]ip add 192.168.5.2 24	
[r2-Tunnel0/0/0]tunnel-protocol gre p2mp 	
[r2-Tunnel0/0/0]source Serial 4/0/0	     ---> 规定封装源为s4/0/0接口的IP地址
[r2-Tunnel0/0/0]nhrp network-id 100      ---> 加入中心创建的NHRP域
[r2-Tunnel0/0/0]nhrp entry 192.168.5.1 15.0.0.1 register   --->找中心上报映射信息(第一个IP为隧道地址,第二个为物理地址)

r3的配置与r2相同:
[r3]int t 0/0/0
[r3-Tunnel0/0/0]ip add 192.168.5.3 24	
[r3-Tunnel0/0/0]tunnel-protocol gre p2mp 	
[r3-Tunnel0/0/0]source Serial 4/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 

查看r1、r2、r3之间的映射关系:


R1、R4间为点到点的GRE;

复制代码
[r1]int t 0/0/1               ---> 创建新的隧道接口
[r1-Tunnel0/0/1]ip add 192.168.6.1 24	   ---> 配置隧道接口的IP地址
[r1-Tunnel0/0/1]tunnel-protocol gre        
[r1-Tunnel0/0/1]source 15.0.0.1            ---> 定义封装中源地址信息
[r1-Tunnel0/0/1]destination 45.0.0.4       ---> 定义封装中目的地址信息

[r4]int t 0/0/0
[r4-Tunnel0/0/0]ip add 192.168.6.2 24
[r4-Tunnel0/0/0]tunnel-protocol gre 
[r4-Tunnel0/0/0]source 45.0.0.4
[r4-Tunnel0/0/0]destination 15.0.0.1

6、整个私有网络基于RIP全网可达

复制代码
R1配置:
[r1-Tunnel0/0/0]nhrp entry multicast dynamic    ---> 在中心开启伪广播
[r1]rip 1
[r1-rip-1]version 2
[r1-rip-1]network 192.168.1.0              ---> 宣告r1到PC1的网段
[r1-rip-1]network 192.168.5.0              ---> 宣告隧道网段
[r1-rip-1]network 192.168.6.0

R2配置:
[r2]rip 1
[r2-rip-1]version 2
[r2-rip-1]network 192.168.2.0              ---> 宣告r2到PC2的网段
[r2-rip-1]network 192.168.5.0              ---> 宣告隧道网段

R3配置:
[r3]rip 1
[r3-rip-1]version 2
[r3-rip-1]network 192.168.3.0              ---> 宣告r3到PC3的网段
[r3-rip-1]network 192.168.5.0              ---> 宣告隧道网段

R4配置:
[r4]rip 1
[r4-rip-1]version 2
[r4-rip-1]network 192.168.4.0              ---> 宣告r4到PC4的网段
[r4-rip-1]network 192.168.5.0              ---> 宣告隧道网段

查看路由表:


配置easyIP:

复制代码
[r1-rip-1]acl 2000
[r1-acl-basic-2000]rule 10 permit source 192.168.1.0 0.0.0.255
[r1]int s 4/0/0	
[r1-Serial4/0/0]nat outbound 2000

[r2-rip-1]acl 2000
[r2-acl-basic-2000]rule 10 permit source 192.168.2.0 0.0.0.255
[r2]int s 4/0/0
[r2-Serial4/0/0]nat outbound 2000

[r3-rip-1]acl 2000
[r3-acl-basic-2000]rule 10 permit source 192.168.3.0 0.0.0.255
[r3]int  s 4/0/0
[r3-Serial4/0/0]nat outbound 2000

[r4]acl 2000	
[r4-acl-basic-2000]rule 10 permit  source 192.168.4.0 0.0.0.255
[r4]int g 0/0/1
[r4-GigabitEthernet0/0/1]nat outbound 2000

7、查看路由配置和PC端配置

R1

R2

R3

R4

R5

PC1

PC2

PC3

PC4

8、PC端pingR5的环回




相关推荐
BingoGo1 天前
当你的 PHP 应用的 API 没有限流时会发生什么?
后端·php
JaguarJack1 天前
当你的 PHP 应用的 API 没有限流时会发生什么?
后端·php·服务端
BingoGo2 天前
OpenSwoole 26.2.0 发布:支持 PHP 8.5、io_uring 后端及协程调试改进
后端·php
JaguarJack2 天前
OpenSwoole 26.2.0 发布:支持 PHP 8.5、io_uring 后端及协程调试改进
后端·php·服务端
Sinclair3 天前
简单几步,安卓手机秒变服务器,安装 CMS 程序
android·服务器
JaguarJack3 天前
推荐 PHP 属性(Attributes) 简洁读取 API 扩展包
后端·php·服务端
BingoGo3 天前
推荐 PHP 属性(Attributes) 简洁读取 API 扩展包
php
Rockbean4 天前
用40行代码搭建自己的无服务器OCR
服务器·python·deepseek
茶杯梦轩4 天前
CompletableFuture 在 项目实战 中 创建异步任务 的核心优势及使用场景
服务器·后端·面试
JaguarJack4 天前
告别 Laravel 缓慢的 Blade!Livewire Blaze 来了,为你的 Laravel 性能提速
后端·php·laravel