在OSPF环境下配置MGRE实验

一、实验要求

1,R4为ISP,其上只能配置IP地址;R4与其他所有直连设备间均使用公有IP
2,R3-R5/6/7为MGRE环境,R3为中心站点;
3,整个OSPF环境IP基于172.16.0.0/16划分;
4,所有设备均可访问R4的环回;
5,减少LSA的更新量,加快收敛,保障更新安全;
6,全网可达

二、实验拓扑图

三、实验步骤

[ Rl ]intg0/0/0

[ Rl -GigabitEthernet0/0/0] ip add 22.0.0.124
 Jan 30202401:10:58-08:00R1%%01IFNET/4/LINK STATE (1)[0]: The line protocol IP 
 on the interface GigabitEthernet0/0/0 has entered the UP state .
[ Rl -GigabitEthernet0/0/0]intg0/0/1
[ Rl -GigabitEthernet0/0/1] ip add 12.0.0.124
 Jan 30202401:11:21-08:00R1%号01IFNET/4/LINK STATE (1)[1]: The line protocol IP on the interface GigabitEthernet0/0/1 has entered the UP state .
[ Rl -GigabitEthernet0/0/1] q 
[ Rl ] intloo 
[ Rl ] int LoopBack 0
[ Rl -LoopBack0] ip add 192.168.1.124

R3] int g0/0/0
[R3-GigabitEthernet0/0/0] ip add 23.0.0.124
 Jan 30202401:13:05-08:00R3%01IFNET/4/LINK STATE (1)[0]: The line protocol IP on the interface GigabitEthernet0/0/0 has entered the UP state .
[R3-GigabitEthernet0/0/0] q 
[R3] int loo 
[R3] int LoopBack 0

[R3-LoopBack0] ip add 192.168.2.124

[R4] int g0/0/0
[R4-GigabitEthernet0/0/0] ip add 24.0.0.124
 Jan 30202401:14:27-08:00R4%01IFNET/4/LINK STATE (1)[0]: The line protocol IP on the interface GigabitEthernet0/0/0 has entered the UP state .
[R4-GigabitEthernet0/0/0] q 
[R4]int1oo
[R4] int LoopBack 0

[R4-LoopBack0] ip add 192.168.3.124

[R5] int g0/0/0
[R5-GigabitEthernet0/0/0] ip add 25.0.0.124
 Jan 30202401:15:33-08:00R5号01IFNET/4/LINK STATE (1)[0]: The line protocol IP on the interface GigabitEthernet0/0/0 has entered the UP state .[R5-GigabitEthernet0/0/0] q 
[R5] int loo 
[R5] int LoopBack 0

[R5-LoopBack0] ip add 192.168.4.124

[R6] int g0/0/0
[R6-GigabitEthernet0/0/0] ip add 26.0.0.124
 Jan 30202401:16:39-08:00R6号01IFNET/4/LINK STATE (1)[0]: The line protocol IP on the interface GigabitEthernet0/0/0 has entered the UP state .
[R6-GigabitEthernet0/0/0] q 
R6] intloo 
[R6] int LoopBack 0

[R6-LoopBack0] ip add 192.168.5.124

其中R2为ISP

[R2] sys ISP 
[ ISP ]intg0/0/0
[ ISP -GigabitEthernet0/0/0] ip add 22.0.0.224
 Jan 30202401:18:30-08:00 ISP 01IFNET/4/LINK STATE (1)[0]: The line protocol IP on the interface GigabitEthernet0/0/0 has entered the UP state .
[ ISP -GigabitEthernet0/0/0]intg0/0/1
[ ISP -GigabitEthernet0/0/1] ip add 12.0.0.224
[ ISP -GigabitEthernet0/0/1]
 Jan 30202401:18:43-08:00 ISP %%01IFNET/4/LINK STATE (1)[1]: The line protocol IP 
 on the interface GigabitEthernet0/0/1 has entered the UP state .
[ ISP -GigabitEthernet0/0/1]intg0/0/2
[ ISP -GigabitEthernet0/0/2] ip add 23.0.0.224
[ ISP -GigabitEthernet0/0/2]
 Jan 30202401:19:07-08:00 ISP %01IFNET/4/LINK STATE (1)[2]: The line protocol IP 
 on the interface GigabitEthernet0/0/2 has entered the UP state .
[ ISP -GigabitEthernet0/0/2]intg4/0/0
[ ISP -GigabitEthernet4/0/0] ip add 24.0.0.224
[ ISP -GigabitEthernet4/0/0]
 Jan 30202401:19:25-08:00 ISP %%01IFNET/4/LINK STATE (1)[3]: The line protocol IP 
 on the interface GigabitEthernet4/0/0 has entered the UP state .
[ ISP -GigabitEthernet4/0/0] int g4/0/1
[ ISP -GigabitEthernet4/0/1] ip add 25.0.0.224
[ ISP -GigabitEthernet4/0/1]
 Jan 30202401:19:48-08:00 ISP 号%01IFNET/4/LINK STATE (1)[4]: The line protocol IP on the interface GigabitEthernet4/0/1 has entered the UP state .
[ ISP -GigabitEthernet4/0/1]intg4/0/2
[ ISP -GigabitEthernet4/0/2] ip add 26.0.0.224
[ ISP -GigabitEthernet4/0/2]
 Jan 30202401:20:24-08:00 ISP 01IFNET/4/LINK STATE (1)[5]: The line prgh 人404 on the interface GigabitEthernet4/0/2 has entered the UP state .

缺省路由配置

配置缺省路由,实现外网访问

[ Rl ] ip rou 
[ RI ] iproute - s 
[ Rl ] ip route - static 0.0.0.0012.0.0.2[ Rl ] ip route -static0.0.0.0022.0.0.2[R3] ip rou 
[R3] ip route - s 
[R3] ip route - static 0.0.0.0023.0.0.2[R4] iprou 
[R4] ip route - S 
[R4] ip route - static 0.0.0.0024.0.0.2[R5] ip rou 
[R5] ip route - s 
[R5] ip route -static0.0.0.0
)25.0.0.2
[R6] ip rou 
[R6] ip route - sS 
[R6] ip route - static 0.0.0.0026.0.0.2

配置ACL、NAT出站

[R1] acl 2000

[ Rl - acl - basic -2000] rule p 
[ Rl - acl - basic -2000] rule permit s 
[R1-acl- basic -2000] rule permit source 192.168.1.00.0.0.255
[ Rl - acl - basic -2000] q 
[R1] int g0/0/1
[ Rl -GigabitEthernet0/0/1] nat ou 
[ Rl -GigabitEthernet0/0/1] nat outbound 2000
[ Rl -GigabitEthernet0/0/1] int g0/0/0
[ Rl -GigabitEthernet0/0/0] nat ou 
[R1-GigabitEthernet0/0/0] nat outbound 2000
[R3] acl 2000
[R3-acl- basic -2000] rule p 
[R3-acl- basic -2000] rule permits 
[R3-acl- basic -2000] rule permit source 192.168.2.00.0.0.255
[R3-acl- basic -2000] q 
[R3]intg0/0/0
[R3-GigabitEthernet0/0/0] nat out 
[R3-GigabitEthernet0/0/0] nat outbound 2000
[R4] acl 2000
[R4-acl- basic -2000] rule p 
[R4-acl- basic -2000] rule permit s 
[R4-acl- basic -2000] rule permit source192.168.3.00.0.0.255
[R4-acl- basic -2000] q 
[R4] int g0/0/0
[R4-GigabitEthernet0/0/0] natout 
[R4-GigabitEthernet0/0/0] nat outbound 2000

[R5] acl 2000

[R5-acl- basic -2000] rule p 
[R5-acl- basic -2000] rule permit s 
[R5-acl- basic -2000] rule permit source192.168.4.00.0.0.255
[R5-acl- basic -2000] q 
[R5]intg0/0/0
[R5-GigabitEthernet0/0/0] nat out 
[R5-GigabitEthernet0/0/0] nat outbound 2000
[R6] acl 2000
[R6-acl- basic -2000] rulep 
[R6-acl- basic -2000] rule permit s 
[R6-acl- basic -2000] rule permit source 192.168.5.00.0.0.255
[R6-acl- basic -2000] q 
[R6]intg0/0/0
[R6-GigabitEthernet0/0/0] nat out 
[R6-GigabitEthernet0/0/0] nat outbound 2000

MGRE配置

[ Rl ] int tu 

[R1] int Tunnel 0/0/0
[ Rl -Tunne10/0/0] ip add 192.168.6.124
[R1-Tunne10/0/0] tun 
[ Rl -Tunne10/0/0] tunnel - protocolg 
[R1-Tunnel0/0/0] tunnel - protocol gre p 
[R1-Tunne10/0/0] tunnel - protocol gre p2mp
[R1-Tunne10/0/0] sou 
[R1-Tunne10/0/0] source 12.0.0.1
 Jan 30202401:45:10-08:00R1%号01IFNET/4/LINK STATE (1)[0]: The line protocol IP on the interface Tunne10/0/0 has entered the UP state .[R1-Tunne10/0/0] nhrpn 
[R1-Tunne10/0/0] nhrp network -id100
[ Rl -Tunne10/0/0] nhrp _ en 
[ Rl -Tunne10/0/0] nhrp entry 192.168.6.223.0.0.1r
[R1-Tunne10/0/0] nhrp entry 192.168.6.223.0.0.1 register 
[ Rl -Tunne10/0/0] nhrp entry 192.168.6.324.0.0.1r

[R1-Tunne10/0/0] nhrp entry 192.168.6.324.0.0.1register

[R3]1ntt

[R3]intTunnel0/0/0
[R3-Tunne10/0/0] ip add 192.168.6.224
[R3-Tunne10/0/0] tun 
[R3-Tunne10/0/0] tunnel - protocol gr 
[R3-Tunnel0/0/0] tunnel - protocol grep 
[R3-Tunne10/0/0] tunnel - protocol gre p2mp
[R3-Tunne10/0/0] nhrpn 
[R3-Tunnel0/0/0] nhrp network - id 100
[R3-Tunne10/0/0] nhrpW 
[R3-Tunne10/0/0] nhrp _ e 
[R3-Tunne10/0/0] nhrp _ entry 192.168.6.112.0.0.1r
[R3-Tunne10/0/0] nhrp _ entry 192.168.6.112.0.0.1 register [R3-Tunne10/0/0] nhrp _ entry 192.168.6.324.0.0.lr[R3-Tunne10/0/0] nhrp entry 192.168.6.324.0.0.1 register

[R4] intt 

[R4] int Tunnel 0/0/0
[R4-Tunne10/0/0] ip _add192.168.7.324
[R4-Tunne10/0/0] tun 
[R4-Tunne10/0/0] tunnel - protocolg 
[R4-Tunne10/0/0] tunnel - protocol grep 
[R4-Tunne10/0/0] tunnel - protocol gre p 
[R4-Tunnel0/0/0] tunnel - protocol gre p2mp
[R4-Tunne10/0/0] s 
[R4-Tunne10/0/0] sou 
[R4-Tunne10/0/0]source24.0.0.1
 Jan 30202401:49:30-08:00R4%%01IFNET/4/LINK STATE (1)[0]: The line protocol IP on the interface Tunnel0/0/0 has entered the UP state .
[R4-Tunne10/0/0]
[R4-Tunne10/0/0] nhrpm 
[R4-Tunne10/0/0] nhrpn 
[R4-Tunne10/0/0] nhrp network -id100
[R4-Tunne10/0/0] nhrpe 
[R4-Tunne10/0/0] nhrp entry 192.168.6.112.0.0.1re
[R4-Tunne10/0/0] nhrp entry 192.168.6.112.0.0.1 register 
[R4-Tunne10/0/0] nhrp entry 192.168.6.223.0.0.1r[R4-Tunne10/0/0] nhrp entry 192.168.6.223.0.0.1 register

OSPE配置

[ Rl ] ospf 1 rou 

[ Rl ] ospf 1router- id 1.1.1.1
[ Rl - ospf - l ] area 0
[ Rl - ospf - l - area -0.0.0.0] netw 
[ Rl - ospf - l - area -0.0.0.0] network 192.168.1.0.0.0.0.255[ Rl - ospf - l - area -0.0.0.0] network 192.168.6.00.0.0.255[R3] ospf 1 rou 


[R3] ospf 1 router - id 3.3.3.3
[R3-ospf- l ]area0
[R3-ospf- l - area -0.0.0.0] netw 
[R3-ospf- l - area -0.0.0.0] network 192.168.2.00.0.0.255[R3-ospf- l - area -0.0.0.0] network 192.168.6.00.0.0.255[R4] ospf 1r


[R4] ospf 1 router - id 4.4.4.4
[R4-ospf-1]area0
[R4-ospf- l - area -0.0.0.0] netw 
[R4-ospf- l - area -0.0.0.0] network 192.168.3.00.0.0.255[R4-ospf- l - area -0.0.0.0] network 192.168.6.00.0.0.255[R5] ospf 1rou


[R5] ospf 1 router - id 5.5.5.5
[R5-ospf-1]area0
[R5-ospf- l - area -0.0.0.0] netw 
[R5-ospf- l - area -0.0.0.0]network192.168.4.00.0.0.255[R5-ospf- l - area -0.0.0.0] network 192.168.7.00.0.0.255

进入以上的配置,我们就可以来进行全网可达,使用ping命令来进行进一步的测试。

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值