MGRE实验

一,配置ip

r1

r1]interface g0/0/0
[r1-GigabitEthernet0/0/0]ip address 192.168.1.1 24 
[r1]interface Serial 3/0/0	
[r1-Serial3/0/0]ip address 15.1.1.1 24

 r2

[r2]interface g0/0/0
[r2-GigabitEthernet0/0/0]ip address 192.168.2.1 24
[r2]interface Serial 3/0/0	
[r2-Serial3/0/0]ip address 25.1.1.1 24

 r3

[r3]interface g0/0/0
[r3-GigabitEthernet0/0/0]ip address 192.168.3.1 24
[r3]interface  Serial 3/0/0
[r3-Serial3/0/0]ip address 35.1.1.1 24

r4

[r4]interface g0/0/0
[r4-GigabitEthernet0/0/0]ip address 192.168.4.1 24
[r4]interface g0/0/1
[r4-GigabitEthernet0/0/1]ip address 45.1.1.1 24

r5

[r5]interface Serial 3/0/1
[r5-Serial3/0/1]ip address 15.1.1.2 24
[r5]interface Serial 3/0/0
[r5-Serial3/0/0]ip address 25.1.1.2 24
[r5-Serial3/0/1]int s 2/0/0
[r5-Serial2/0/0]ip address 35.1.1.2 24
[r5]interface g0/0/0
[r5-GigabitEthernet0/0/0]ip address 45.1.1.2 24
[r5]interface LoopBack 0
[r5-LoopBack0]ip address 5.5.5.5 24
二,认证
1,r1与r5之间

r5

[r5]aa		
[r5-aaa]local-user xx password cipher yy
[r5-aaa]local-user xx service-type ppp
[r5-aaa]int s3/0/1
[r5-Serial3/0/1]link-protocol ppp
[r5-Serial3/0/1]ppp authentication-mode  pap

r1


[r1]in s3/0/0
[r1-Serial3/0/0]ppp pap local-user  xx password cipher yy

[r1]aaa
[r1-aaa]local-user xx password cipher yy
[r1-aaa]in s3/0/0
[r1-Serial3/0/0]ppp authentication-mode  pap

r5

[r5]interface Serial 3/0/1
[r5-Serial3/0/1]ppp pap local-user xx password cipher yy
2,r2与r5之间

r2

[r2]interface Serial 3/0/0	
[r2-Serial3/0/0]ppp chap password cipher yy

r5

[r5]interface Serial 3/0/0
[r5-Serial3/0/0]ppp chap password cipher yy

3,对r3和r5

r3

[r3-Serial3/0/0]link-protocol hdlc 
Warning: The encapsulation protocol of the link will be changed. Continue? [Y/N]
:y

三,MGRE

r1

[r1]interface Tunnel 0/0/0
[r1-Tunnel0/0/0]ip address 10.1.1.1 24
[r1-Tunnel0/0/0]tunnel-protocol gre p2mp
[r1-Tunnel0/0/0]nhrp network-id 200

r2

[r2]interface Tunnel 0/0/0	
[r2-Tunnel0/0/0]ip address 10.1.1.2 24
[r2-Tunnel0/0/0]tunnel-protocol gre p2mp
[r2-Tunnel0/0/0]nhrp network-id 200	
[r2-Tunnel0/0/0]nhrp entry 15.1.1.1 10.1.1.1 register 

r3

[r3]interface Tunnel 0/0/0
[r3-Tunnel0/0/0]ip address 10.1.1.3 24
[r3-Tunnel0/0/0]tunnel-protocol gre p2mp
[r3-Tunnel0/0/0]nhrp network-id 200
[r3-Tunnel0/0/0]nhrp entry 15.1.1.1 10.1.1.1 register 
gre

r1

[r1]interface Tunnel 0/0/1
[r1-Tunnel0/0/1]ip address 20.1.1.1 24
[r1-Tunnel0/0/1]tunnel-protocol gre
[r1-Tunnel0/0/1]source 15.1.1.1
[r1-Tunnel0/0/1]destination 45.1.1.2

r4

[r4]interface t 0/0/1
[r4-Tunnel0/0/1]ip address 20.1.1.2 24
[r4-Tunnel0/0/1]tunnel-protocol gre 
[r4-Tunnel0/0/1]source 45.1.1.1
[r4-Tunnel0/0/1]description 15.1.1.2
四rip

r1

[r1]rip
[r1-rip-1]version 2
[r1-rip-1]undo summary 
[r1-rip-1]network 10.0.0.0
[r1-rip-1]network 15.0.0.0
[r1-rip-1]network  192.168.1.0

r2

[r2]rip
[r2-rip-1]version 2
[r2-rip-1]undo summary 
[r2-rip-1]network 10.0.0.0
[r2-rip-1]network 15.0.0.0
[r2-rip-1]network  192.168.1.0

r3

[r3]rip
[r3-rip-1]version 2
[r3-rip-1]undo summary 
[r3-rip-1]network 10.0.0.0
[r3-rip-1]network 15.0.0.0
[r3-rip-1]network  192.168.1.0

r4

[r4]rip
[r4-rip-1]version 2
[r4-rip-1]undo summary 
[r4-rip-1]network 10.0.0.0
[r4-rip-1]network 15.0.0.0
[r4-rip-1]network  192.168.1.0

r1水平切割

[r1]interface Tunnel 0/0/0
[r1-Tunnel0/0/0]undo rip split-horizon 
五,访问r5

r1

[r1]acl 2000
[r1-acl-basic-2000]rule permit source 192.168.1.0 0.0.0.255
[r1]interface Serial 3/0/0	
[r1-Serial3/0/0]nat outbound 2000

r2

[r2]acl 2000
[r2-acl-basic-2000]rule permit  source 192.168.1.0 0.0.0.255
[r2]interface Serial 3/0/0
[r2-Serial3/0/0]nat  outbound 2000

r3

[r3]acl 2000
[r3-acl-basic-2000]rule permit  source 192.168.1.0 0.0.0.255
[r3]interface Serial 3/0/0
[r3-Serial3/0/0]nat  outbound 2000

r4

[r4]acl 2000	
[r4-acl-basic-2000]rule permit source 192.168.1.0 0.0.0.255
[r4]interface g0/0/1	
[r4-GigabitEthernet0/0/1]nat outbound 2000
六,pc

r1

[r1]dhcp enable 
[r1]ip policy-based-route
[r1]ip pool 1
[r1-ip-pool-1]network 192.168.1.0 mask 24
[r1-ip-pool-1]gateway-list 192.168.1.1
[r1-ip-pool-1]dns 8.8.8.8
[r1]interface g0/0/0
[r1-GigabitEthernet0/0/0]dhcp select global 

pc

PC>ping 5.5.5.5

Ping 5.5.5.5: 32 data bytes, Press Ctrl_C to break
From 5.5.5.5: bytes=32 seq=1 ttl=254 time=16 ms
From 5.5.5.5: bytes=32 seq=2 ttl=254 time=15 ms
From 5.5.5.5: bytes=32 seq=3 ttl=254 time=16 ms
From 5.5.5.5: bytes=32 seq=4 ttl=254 time=15 ms
From 5.5.5.5: bytes=32 seq=5 ttl=254 time=16 ms

--- 5.5.5.5 ping statistics ---
  5 packet(s) transmitted
  5 packet(s) received
  0.00% packet loss
  round-trip min/avg/max = 15/15/16 ms

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

不会取名余

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值