HCIP之MGRE基础实验

实验要求:

 实验拓扑图

一:IP配置

以R1为例

[r1]int g0/0/1
[r1-GigabitEthernet0/0/1]ip add 192.168.1.1 24
Aug 2 2023 20:38:20-08:00 r1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[r1-GigabitEthernet0/0/1]int s4/0/0
[r1-Serial4/0/0]ip add 14.1.1.1 24
[r1-Serial4/0/0]
[r1]ip rou
[r1]ip route
[r1]ip route-static 0.0.0.0 0 14.1.1.2

二:HDLC封装

以R1为例
[r1]int
[r1]interface s4/0/0
[r1-Serial4/0/0]lin
[r1-Serial4/0/0]link-protocol hdlc
Warning: The encapsulation protocol of the link will be changed. Continue? [Y/N]:y
Aug 2 2023 20:48:34-08:00 r1 %%01IFNET/4/CHANGE_ENCAP(l)[0]:The user performed
the configuration that will change the encapsulation protocol of the link and th
en selected Y.
[r1-Serial4/0/0]

三:ppp封装,pap认证,R2为主证方

R2上配置:
[ISP]aaa
[ISP-aaa]local-user xiao password cipher 123456
[ISP-aaa]local-user xiao service-type ppp
[ISP]int s4/0/1
[ISP-Serial4/0/1]ppp authentication-mode pap
R3上配置:
[R3]int s4/0/0
[R3-Serial4/0/0]ppp pap local-user xiao password cipher 123456 

四:ppp封装,chap认证,R2为主证方

R2上配置:
[ISP]aaa
[ISP-aaa]local-user gang password cipher 123456
[ISP-aaa]local-user gang service-type ppp
[ISP]int s3/0/0
[ISP-Serial3/0/0]ppp authentication-mode chap
R3上配置:
[R4]int s4/0/0
[R4-Serial4/0/0]ppp chap user gang
[R4-Serial4/0/0]ppp chap password cipher 123456

五:路由器之间构成mgre环境,仅r1ip地址固定。

(1)r1ip固定以及其他配置

[r1]int
[r1]interface tun
[r1]interface Tunnel 0/0/0
[r1-Tunnel0/0/0]ip add 192.168.4.1 24
[r1-Tunnel0/0/0]tun
[r1-Tunnel0/0/0]tunnel-protocol gre p2mp
[r1-Tunnel0/0/0]sou
[r1-Tunnel0/0/0]source 14.1.1.1
Aug 2 2023 21:15:58-08:00 r1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface Tunnel0/0/0 has entered the UP state.
[r1-Tunnel0/0/0]
[r1-Tunnel0/0/0]nh
[r1-Tunnel0/0/0]nhrp en
[r1-Tunnel0/0/0]nhrp entry mu
[r1-Tunnel0/0/0]nhrp entry multicast dyn
[r1-Tunnel0/0/0]nhrp entry multicast dynamic
[r1-Tunnel0/0/0]nh
[r1-Tunnel0/0/0]nhrp netw
[r1-Tunnel0/0/0]nhrp network-id 100

(2)r3和r4ip不固定(但是端口固定)图中的r2是充当isp

[r3]int
[r3]interface tun
[r3]interface Tunnel 0/0/0
[r3-Tunnel0/0/0]ip add 192.168.4.2 24
[r3-Tunnel0/0/0]tun
[r3-Tunnel0/0/0]tunnel-protocol gre p2mp
[r3-Tunnel0/0/0]sou
[r3-Tunnel0/0/0]source s
[r3-Tunnel0/0/0]source Serial 4/0/0
Aug 2 2023 21:19:12-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]
[r3-Tunnel0/0/0]nh
[r3-Tunnel0/0/0]nhrp en
[r3-Tunnel0/0/0]nhrp entry 192.168.4.1 14.1.1.1 re
[r3-Tunnel0/0/0]nhrp entry 192.168.4.1 14.1.1.1 register
[r3-Tunnel0/0/0]nh
[r3-Tunnel0/0/0]nhrp netw
[r3-Tunnel0/0/0]nhrp network-id 100
[r3-Tunnel0/0/0]q
 

[r4]int
[r4]interface tun
[r4]interface Tunnel 0/0/0
[r4-Tunnel0/0/0]ip add 192.168.4.3 24
[r4-Tunnel0/0/0]tun
[r4-Tunnel0/0/0]tunnel-protocol gre p2mp
[r4-Tunnel0/0/0]sourc
[r4-Tunnel0/0/0]source s
[r4-Tunnel0/0/0]source Serial 4/0/0
Aug 2 2023 21:21:59-08:00 r4 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface Tunnel0/0/0 has entered the UP state.
[r4-Tunnel0/0/0]
[r4-Tunnel0/0/0]nh
[r4-Tunnel0/0/0]nhrp en
[r4-Tunnel0/0/0]nhrp entry 192.168.4.1 14.1.1.1 re
[r4-Tunnel0/0/0]nhrp entry 192.168.4.1 14.1.1.1 register
[r4-Tunnel0/0/0]nhrp net
[r4-Tunnel0/0/0]nhrp network-id 100

六 内网使用rip获取路由,所有pc可以互相访问,并且可访问r2的环回。

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

[R3]rip
[R3-rip-1]version 2
[R3-rip-1]network 192.168.4.0
[R3-rip-1]network 192.168.2.0

[R4]rip
[R4-rip-1]version 2
[R4-rip-1]network 192.168.4.0
[R4-rip-1]network 192.168.3.0

测试
 

 

实验结束!!

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值