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的环回




相关推荐
zhangphil41 分钟前
Windows环境Apache httpd 2.4 web服务器加载PHP8:Hello,world!
php·apache·httpd
枫叶丹43 小时前
【在Linux世界中追寻伟大的One Piece】进程信号
linux·运维·服务器
灯火不休ᝰ4 小时前
[win7] win7系统的下载及在虚拟机中详细安装过程(附有下载文件)
linux·运维·服务器
数云界7 小时前
如何在 DAX 中计算多个周期的移动平均线
java·服务器·前端
芒果作者9 小时前
dcatadmin 自定义登录页面
php
叫我龙翔9 小时前
【Linux】进程间关系与守护进程
linux·运维·服务器·计算机网络
S hh10 小时前
【Linux】进程地址空间
java·linux·运维·服务器·学习
萧鼎11 小时前
Python调试技巧:高效定位与修复问题
服务器·开发语言·python
GodK77711 小时前
IP 数据包分包组包
服务器·网络·tcp/ip
梁诚斌11 小时前
VSOMEIP代码阅读整理(1) - 网卡状态监听
运维·服务器·网络