当前位置:网站首页>MGRE综合实验

MGRE综合实验

2022-08-02 07:18:00 羊腿大大

配置需求:

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

实验配置:

1.网段分配

AR1-AR4内部地址依次为192.168.1.0/24-192.168.4.0/24
与AR5之间的网段依次为15.0.0.1/24-45.0.0.1/24
因为要配置MGRE和GRE,所以AR1、AR2和AR3之间的虚拟通道ip为192.168.5.0/24
AR1和AR4之间的虚拟通道ip为192.168.6.0/24

配置IP地址

R1:

R2:

R3:

R4:

 

R5:

 在搭建MGRE环境之前要先将公网做通在每台路由器上做缺省指向ISP

[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.02
[r4]ip route-static 0.0.0.0 0 45.0.0.2

PAP:

AR5作为主认证方提供用户和密码:

[isp]aaa
[isp-aaa]local-user ytdd password cipher 123456
Info: Add a new user.
[isp-aaa]local-user  ytdd service-type ppp

开启pap认证:

[isp]int s3/0/0
[isp-Serial3/0/0]ppp authentication-mode pap 

AR1找AR5进行认证:

[r1]int s4/0/0
[r1-Serial4/0/0]ppp pap  local-user  ytdd password cipher  123456

关闭接口进行验证:

[r1-Serial4/0/0]shutdown 
Jul 12 2022 01:01:18-08:00 r1 %%01PPP/4/PHYSICALDOWN(l)[0]:On the interface Seri
al4/0/0, PPP link was closed because the status of the physical layer was Down. 
Jul 12 2022 01:01:18-08:00 r1 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol PPP
 on the interface Serial4/0/0 has entered the DOWN state. 
Jul 12 2022 01:01:18-08:00 r1 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol PPP
Jul 12 2022 01:01:18-08:00 r1 %%01IFPDT/4/IF_STATE(l)[3]:Interface Serial4/0/0 h
as turned into DOWN state.
Jul 12 2022 01:01:18-08:00 r1 %%01RM/4/IPV4_DEFT_RT_CHG(l)[4]:IPV4 default Route
 is changed. (ChangeType=Delete, InstanceId=0, Protocol=Static, ExitIf=Unknown, 
Nexthop=15.0.0.2, Neighbour=0.0.0.0, Preference=1006632960, Label=NULL, Metric=0
[r1-Serial4/0/0]undo shutdown 

CHAP:

同上:提供用户和密码

[isp]int s 3/0/1
[isp-Serial3/0/1]ppp authentication-mode  chap 

 AR2找AR5进行认证:

[r2]int s4/0/0
[r2-Serial4/0/0]ppp chap  user  ytdd  
[r2-Serial4/0/0]ppp chap  password  cipher 123456
验证:

 HDLC:

 AR5上串口一个up一个down,说明两个接口都需要改成HDLC

[isp-Serial4/0/0]link-protocol hdlc 

 2.搭建MGRE环境

 后续网路因为基于RIP全网可达,所以要开启伪广播

[r1-Tunnel0/0/0]nhrp  entry  multicast dynamic 

创建tunnel隧道

[r2]int t    
[r2]int Tunnel 0/0/0
[r2-Tunnel0/0/0]
[r2-Tunnel0/0/0]ip add 192.168.5.2 24
  开 gre p2mp
[r2-Tunnel0/0/0]tunnel-protocol  gre p2mp 
[r2-Tunnel0/0/0]source Serial 4/0/0
  进入到100的域中
[r2-Tunnel0/0/0]nhrp network-id 100
进行注册
[r2-Tunnel0/0/0]nhrp entry 192.168.5.1 15.0.0.1 register 

AR3:

[r3]
[r3]int t0/0/0
[r3-Tunnel0/0/0]
[r3-Tunnel0/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 

 3.搭建GRE环境

[r1]int t0/0/1
[r1-Tunnel0/0/1]ip add 192.168.6.1 24
[r1-Tunnel0/0/1]tunnel-protocol gre 
出接口:
[r1-Tunnel0/0/1]source 15.0.0.1
目标(真实的物理接口)
[r1-Tunnel0/0/1]description 45.0.0.1

[r4]int t0/0/0
[r4-Tunnel0/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.01
[r4-Tunnel0/0/0]description 15.0.0.01


4.配置RIP在整个私有网段

[r1]rip 
[r1-rip-1]v 2
[r1-rip-1]ne    
[r1-rip-1]network  192.168.1.0
[r1-rip-1]n    
[r1-rip-1]network  192.168.5.0
[r1-rip-1]n    
[r1-rip-1]network  192.168.6.0

。。。。。。

检查RIP路由表发现一些路由没得

关闭水平分割:[r1-Tunnel0/0/0]undo rip split-horizon

5.做nat,在四台设备出接口上做nat

[r1]acl 2000
[r1-acl-basic-2000]rule permit  source 192.168.0.0 0.0.255.255
[r1-acl-basic-2000]q
[r1]int s4/0/0 
[r1-Serial4/0/0]nat outbound 2000

[r2]acl 2000 
[r2-acl-basic-2000]rule permit source 192.168.0.0 0.0.255.255
[r2-acl-basic-2000]q
[r2]int s4/0/0  
[r2-Serial4/0/0]nat outbound  2000

[r3]
[r3]acl 2000
[r3-acl-basic-2000]rule permit source 192.168.0.0 0.0.255.255
[r3-acl-basic-2000]q
[r3]int s4/0/0 
[r3-Serial4/0/0]nat  outbound  2000

[r4]
[r4]acl 2000  
[r4-acl-basic-2000]rule permit source 192.168.0.0 0.0.255.255
[r4-acl-basic-2000]q
[r4]int g0/0/0
[r4-GigabitEthernet0/0/0]nat  outbound  2000

原网站

版权声明
本文为[羊腿大大]所创,转载请带上原文链接,感谢
https://blog.csdn.net/ytdd66/article/details/125712964