MGRE综合实验

1. 首先进行IP地址配置

R1 

R2

R3 

R4

R5

 

 2.要想公网地址可以互通,要在每条边界路由器上配置缺省路由指向isp

 3.验证公网是否互通

 4.R1和R5间使用PPP的PAP认证,R5为主认证方;R2于R5之间使用ppp的chap认证,R5为主认证方

R5:主认证方

[isp]aaa
[isp-aaa]local-user zt password cipher 123456
Info: Add a new user.
[isp-aaa]local-user zt service-type ppp
[isp-aaa]interface s3/0/0
[isp-Serial3/0/0]ppp authentication-mode pap   在s3/0/0接口上调用pap认证
[isp-Serial3/0/0]interface s3/0/1
[isp-Serial3/0/1]ppp authentication-mode chap  在s3/0/1接口上调用chap认证
[isp-Serial3/0/1]q

 R1

[r1]interface s4/0/0
[r1-Serial4/0/0]ppp pap local-user zt password cipher 123456 在S4/0/0接口上调用pap认证

 R2

[r2]interface s4/0/0
[r2-Serial4/0/0]ppp chap user zt
[r2-Serial4/0/0]ppp chap password cipher 123456 在接口S4/0/0接口上调用chap认证

5.验证是否成功认证(将接口关闭后再开启,成功通过验证)

[r1]int s4/0/0
[r1-Serial4/0/0]shutdown 
Apr  5 2022 16:13:42-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. 

[r1-Serial4/0/0]
[r1-Serial4/0/0]
Apr  5 2022 16:13:42-08:00 r1 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol PPP
 on the interface Serial4/0/0 has entered the DOWN state. 
[r1-Serial4/0/0]
Apr  5 2022 16:13:42-08:00 r1 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol PPP
 IPCP on the interface Serial4/0/0 has entered the DOWN state. 
[r1-Serial4/0/0]
Apr  5 2022 16:13:42-08:00 r1 %%01IFPDT/4/IF_STATE(l)[3]:Interface Serial4/0/0 h
as turned into DOWN state.
[r1-Serial4/0/0]
Apr  5 2022 16:13:42-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]display ip interface brief 
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 2
The number of interface that is DOWN in Physical is 4
The number of interface that is UP in Protocol is 2
The number of interface that is DOWN in Protocol is 4

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              192.168.1.1/24       up         up        
GigabitEthernet0/0/1              unassigned           down       down      
GigabitEthernet0/0/2              unassigned           down       down      
NULL0                             unassigned           up         up(s)     
Serial4/0/0                       15.0.0.1/24          *down      down      
Serial4/0/1                       unassigned           down       down      
[r1-Serial4/0/0]undo shutdown 

6.R3于R5之间使用HDLC封装(华为设备默认为ppp,因此需要到r3和r5上修改封装类型,修改该封装类型时,要记得给通讯双方都需要进行修改)

[isp]interface s4/0/0
[isp-Serial4/0/0]link-protocol hdlc
Warning: The encapsulation protocol of the link will be changed. Continue? [Y/N]
:y
Apr  5 2022 16:20:22-08:00 isp %%01IFNET/4/CHANGE_ENCAP(l)[0]:The user performed
 the configuration that will change the encapsulation protocol of the link and t
hen selected Y. 

7.r1和r4间为点到点的GRE

[r4]interface 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
Apr  5 2022 16:27:19-08:00 r4 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface Tunnel0/0/0 has entered the UP state. 

[r1]interface t0/0/0
[r1-Tunnel0/0/0]i 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
Apr  5 2022 16:25:26-08:00 r1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface Tunnel0/0/0 has entered the UP state. 

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

[r1-Tunnel0/0/0]int t0/0/1                         中心配置
[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
Apr  5 2022 16:30:09-08:00 r1 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP 
on the interface Tunnel0/0/1 has entered the UP state. 
[r1-Tunnel0/0/1]nhrp network-id  100
[r1-Tunnel0/0/1]nhrp entry multicast dynamic   nbma结构不支持广播和组播,因此需要开启伪广播
[r1-Tunnel0/0/1]undo rip split-horizon     关闭rip的水平分割,否则分支无法互相学习

[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 s4/0/0
Apr  5 2022 16:33:56-08:00 r2 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface Tunnel0/0/0 has entered the UP state. 
[r2-Tunnel0/0/0]nhrp network-id  100
[r2-Tunnel0/0/0]nhrp entry 192.168.5.1 15.0.0.1 register 

[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
Apr  5 2022 16:38:30-08:00 r3 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface Tunnel0/0/0 has entered the UP state. 
[r3-Tunnel0/0/0]nhrp entry 192.168.5.1 15.0.0.1 register 

9.开启rip协议

[r1]rip 1
[r1-rip-1]version 2
[r1-rip-1]network 192.168.1.0
[r1-rip-1]network 192.168.5.0
[r1-rip-1]network 192.168.6.0
[r1-rip-1]q
[r1]display ip routing-table protocol rip         验证是否相互学习到路由条目信息
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : RIP
         Destinations : 3        Routes : 3        

RIP routing table status : <Active>
         Destinations : 3        Routes : 3

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

    192.168.2.0/24  RIP     100  1           D   192.168.5.2     Tunnel0/0/1
    192.168.3.0/24  RIP     100  1           D   192.168.5.3     Tunnel0/0/1
    192.168.4.0/24  RIP     100  1           D   192.168.6.2     Tunnel0/0/0

RIP routing table status : <Inactive>
         Destinations : 0        Routes : 0

[r2]rip 1
[r2-rip-1]version 2
[r2-rip-1]network 192.168.2.0
[r2-rip-1]network 192.168.5.0
[r2-rip-1]q
[r2]display ip routing-table protocol rip
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : RIP
         Destinations : 4        Routes : 4        

RIP routing table status : <Active>
         Destinations : 4        Routes : 4

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

    192.168.1.0/24  RIP     100  1           D   192.168.5.1     Tunnel0/0/0
    192.168.3.0/24  RIP     100  2           D   192.168.5.1     Tunnel0/0/0
    192.168.4.0/24  RIP     100  2           D   192.168.5.1     Tunnel0/0/0
    192.168.6.0/24  RIP     100  1           D   192.168.5.1     Tunnel0/0/0

RIP routing table status : <Inactive>
         Destinations : 0        Routes : 0

[r3]rip 1
[r3-rip-1]v 2
[r3-rip-1]network 192.168.3.0
[r3-rip-1]network 192.168.5.0
[r3-rip-1]q

[r4]rip 1
[r4-rip-1]v 2
[r4-rip-1]network 192.168.4.0
[r4-rip-1]network 192.168.6.0
[r4-rip-1]q
[r4]display ip routing-table protocol rip
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : RIP
         Destinations : 4        Routes : 4        

RIP routing table status : <Active>
         Destinations : 4        Routes : 4

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

    192.168.1.0/24  RIP     100  1           D   192.168.6.1     Tunnel0/0/0
    192.168.2.0/24  RIP     100  2           D   192.168.6.1     Tunnel0/0/0
    192.168.3.0/24  RIP     100  2           D   192.168.6.1     Tunnel0/0/0
    192.168.5.0/24  RIP     100  1           D   192.168.6.1     Tunnel0/0/0

RIP routing table status : <Inactive>
         Destinations : 0        Routes : 0

10.整个PC可以访问R5环回  

     每个边界路由器的出接口上要开启nat转换

[r2]acl 2000
[r2-acl-basic-2000]rule permit source 192.168.2.0 0.0.0.255   抓取流量
[r2-acl-basic-2000]q
[r2]interface s4/0/0
[r2-Serial4/0/0]nat outbound 2000
[r2-Serial4/0/0]q

   验证

[r1]ping 192.168.2.1
  PING 192.168.2.1: 56  data bytes, press CTRL_C to break
    Reply from 192.168.2.1: bytes=56 Sequence=1 ttl=255 time=30 ms
    Reply from 192.168.2.1: bytes=56 Sequence=2 ttl=255 time=20 ms
    Reply from 192.168.2.1: bytes=56 Sequence=3 ttl=255 time=30 ms
    Reply from 192.168.2.1: bytes=56 Sequence=4 ttl=255 time=40 ms
    Reply from 192.168.2.1: bytes=56 Sequence=5 ttl=255 time=30 ms

  --- 192.168.2.1 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 20/30/40 ms

[r1]ping 192.168.4.1
  PING 192.168.4.1: 56  data bytes, press CTRL_C to break
    Reply from 192.168.4.1: bytes=56 Sequence=1 ttl=255 time=30 ms
    Reply from 192.168.4.1: bytes=56 Sequence=2 ttl=255 time=30 ms
    Reply from 192.168.4.1: bytes=56 Sequence=3 ttl=255 time=30 ms
    Reply from 192.168.4.1: bytes=56 Sequence=4 ttl=255 time=30 ms
    Reply from 192.168.4.1: bytes=56 Sequence=5 ttl=255 time=20 ms

  --- 192.168.4.1 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 20/28/30 ms

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值