HCIP MGRE实验 第三天

一、搭建实验拓扑

在这里插入图片描述

二、配置

[R4]int s3/0/0

[R4-Serial3/0/0]link-protocol hdlc 
Warning: The encapsulation protocol of the link will be changed. Continue? [Y/N]:y
Jul 22 2022 11:52:53-08:00 R4 %%01IFNET/4/CHANGE_ENCAP(l)[0]:The user performed the configuration that will change the encapsulation protocol of the link and then selected Y. 

[R4-Serial3/0/0]ip add 14.1.1.2 24
[R4-Serial3/0/0]
[R4-Serial3/0/0]int s3/0/1

[R4-Serial3/0/1]ppp authentication-mode pap
[R4-Serial3/0/1]ip add 24.1.1.2 24
[R4-Serial3/0/1]q  
[R4]aaa

[R4-aaa]local-user xixi privilege level 15 password cipher 123456
Info: Add a new user.

[R4-aaa]local-user xixi service-type ppp
[R4-aaa]

[R4-aaa]local-user haha privilege level 15 password cipher 654321
Info: Add a new user.
[R4-aaa]local-user haha service-type ppp
[R4-aaa]
[R4]int s4/0/0

[R4-Serial4/0/0]ppp authentication-mode chap 
[R4-Serial4/0/0]ip add 34.1.1.2 24

[R4]int s3/0/1
[R4-Serial3/0/1]shutdown 
[R4-Serial3/0/1]undo shutdown

[R4-Serial3/0/1]int s4/0/0
[R4-Serial4/0/0]shutdown 
[R4-Serial4/0/0]undo shutdown

<R4>display ip interface brief 
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 4
The number of interface that is DOWN in Physical is 4
The number of interface that is UP in Protocol is 1
The number of interface that is DOWN in Protocol is 7

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              unassigned           down       down      
GigabitEthernet0/0/1              unassigned           down       down      
GigabitEthernet0/0/2              unassigned           down       down      
NULL0                             unassigned           up         up(s)     
Serial3/0/0                       14.1.1.2/24          up         down      
Serial3/0/1                       24.1.1.2/24          up         down      
Serial4/0/0                       34.1.1.2/24          up         down      
Serial4/0/1                       unassigned           down       down      
<R4>
[R4-LoopBack0]ip add 4.4.4.4 24
[R1]int g0/0/2
[R1-GigabitEthernet0/0/2]ip add 192.168.1.1 24
[R1-GigabitEthernet0/0/2]int s4/0/0
[R1-Serial4/0/0]ip add 14.1.1.1 24

[R1-Serial4/0/0]link-protocol hdlc
[R2-GigabitEthernet0/0/2]ip add 192.168.2.1 24


[R2-GigabitEthernet0/0/2]int s4/0/0
[R2-Serial4/0/0]ip add 24.1.1.1 24

[R2-Serial4/0/0]ping 24.1.1.2
  PING 24.1.1.2: 56  data bytes, press CTRL_C to break
    Request time out
    Request time out
    Request time out
    Request time out
    Request time out

  --- 24.1.1.2 ping statistics ---
    5 packet(s) transmitted
    0 packet(s) received
    100.00% packet loss


[R2-Serial4/0/0]ppp pap local-user xixi password cipher 123456
[R2-Serial4/0/0]

[R2-Serial4/0/0]ping 24.1.1.2
  PING 24.1.1.2: 56  data bytes, press CTRL_C to break
    Reply from 24.1.1.2: bytes=56 Sequence=1 ttl=255 time=50 ms
    Reply from 24.1.1.2: bytes=56 Sequence=2 ttl=255 time=30 ms
    Reply from 24.1.1.2: bytes=56 Sequence=3 ttl=255 time=30 ms
    Reply from 24.1.1.2: bytes=56 Sequence=4 ttl=255 time=20 ms
    Reply from 24.1.1.2: bytes=56 Sequence=5 ttl=255 time=10 ms

  --- 24.1.1.2 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 10/28/50 ms

[R2-Serial4/0/0]
[R3]int g0/0/2
[R3-GigabitEthernet0/0/2]ip add 192.168.3.1 24

[R3-GigabitEthernet0/0/2]int s4/0/0
[R3-Serial4/0/0]ip add 34.1.1.1 24

[R3-Serial4/0/0]ppp chap user haha
[R3-Serial4/0/0]ppp chap password cipher 654321

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
缺省

[R1]ip route-static 0.0.0.0 0 14.1.1.2
[R2]ip route-static 0.0.0.0 0 24.1.1.2
[R3]ip route-static 0.0.0.0 0 34.1.1.2

测试

<R1>ping 24.1.1.1
  PING 24.1.1.1: 56  data bytes, press CTRL_C to break
    Reply from 24.1.1.1: bytes=56 Sequence=1 ttl=254 time=40 ms
    Reply from 24.1.1.1: bytes=56 Sequence=2 ttl=254 time=40 ms
    Reply from 24.1.1.1: bytes=56 Sequence=3 ttl=254 time=40 ms
    Reply from 24.1.1.1: bytes=56 Sequence=4 ttl=254 time=20 ms
    Reply from 24.1.1.1: bytes=56 Sequence=5 ttl=254 time=20 ms

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


<R1>ping 34.1.1.1
  PING 34.1.1.1: 56  data bytes, press CTRL_C to break
    Reply from 34.1.1.1: bytes=56 Sequence=1 ttl=254 time=40 ms
    Reply from 34.1.1.1: bytes=56 Sequence=2 ttl=254 time=20 ms
    Reply from 34.1.1.1: bytes=56 Sequence=3 ttl=254 time=30 ms
    Reply from 34.1.1.1: bytes=56 Sequence=4 ttl=254 time=30 ms
    Reply from 34.1.1.1: bytes=56 Sequence=5 ttl=254 time=20 ms

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

<R1>
[R1]int Tunnel 0/0/0
[R1-Tunnel0/0/0]ip add 10.1.1.1 24
[R1-Tunnel0/0/0]tunnel-protocol gre p2mp
[R1-Tunnel0/0/0]source 14.1.1.1
[R1-Tunnel0/0/0]nhrp entry multicast dynamic 
[R1-Tunnel0/0/0]nhrp network-id 100
[R2]int Tunnel 0/0/0
[R2-Tunnel0/0/0]ip add 10.1.1.2 24
[R2-Tunnel0/0/0]tunnel-protocol gre p2mp 
[R2-Tunnel0/0/0]source s4/0/0
[R2-Tunnel0/0/0]nhrp entry 10.1.1.1 14.1.1.1 register 
[R2-Tunnel0/0/0]nhrp network-id 100

RIP

[R1]rip 1        
[R1-rip-1]version 2
[R1-rip-1]network 192.168.1.0
[R1-rip-1]network 10.0.0.0   

[R2]rip 1
[R2-rip-1]version 2
[R2-rip-1]network 192.168.2.0
[R2-rip-1]network 10.0.0.0   
[R3]rip 1
[R3-rip-1]version 2
[R3-rip-1]network 192.168.3.0
[R3-rip-1]network 10.0.0.0

关闭水平分割

[R1]int t0/0/0
[R1-Tunnel0/0/0]undo rip split-horizon

rip选路不佳,使用静态

[R3]ip route-static 192.168.2.0 24 10.1.1.2
[R3]display ip routing-table   
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 18       Routes : 18       

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

        0.0.0.0/0   Static  60   0          RD   34.1.1.2        Serial4/0/0
       10.0.0.0/8   RIP     100  1           D   10.1.1.1        Tunnel0/0/0
       10.1.1.0/24  Direct  0    0           D   10.1.1.3        Tunnel0/0/0
       10.1.1.3/32  Direct  0    0           D   127.0.0.1       Tunnel0/0/0
     10.1.1.255/32  Direct  0    0           D   127.0.0.1       Tunnel0/0/0
       34.1.1.0/24  Direct  0    0           D   34.1.1.1        Serial4/0/0
       34.1.1.1/32  Direct  0    0           D   127.0.0.1       Serial4/0/0
       34.1.1.2/32  Direct  0    0           D   34.1.1.2        Serial4/0/0
     34.1.1.255/32  Direct  0    0           D   127.0.0.1       Serial4/0/0
      127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0
      127.0.0.1/32  Direct  0    0           D   127.0.0.1       InLoopBack0
127.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0
    192.168.1.0/24  RIP     100  1           D   10.1.1.1        Tunnel0/0/0
    192.168.2.0/24  Static  60   0          RD   10.1.1.2        Tunnel0/0/0
    192.168.3.0/24  Direct  0    0           D   192.168.3.1     GigabitEthernet0/0/2
    192.168.3.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet0/0/2
  192.168.3.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet0/0/2
255.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0

[R3]
[R2]ip route-static 192.168.3.0 24 10.1.1.3

nat

[R1]acl 2000
[R1-acl-basic-2000]rule permit source 192.168.1.0 0.0.0.255
[R1]int s4/0/0
[R1-Serial4/0/0]nat out
[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]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]int s4/0/0
[R3-Serial4/0/0]nat outbound 2000
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值