MGRE环境下的OSPF

1.实验目的:

2.实验步骤:

第一步:IP地址规划:

PC地址:

pc1:192.168.1.1 24

pc2:192.168.2.1 24

pc3:192.168.3.1 24

pc5:192.168.4.1 24

pc6:192.168.5.1 24

设备地址:

R1:15.1.1.1 24  65.1.1.6 24

R2:25.1.1.2 24

R3:35.1.1.3 24

R5:45.1.1.4 24

R6:55.1.1.5 24

R4:15.1.1.7 24

     25.1.1.7 24

     35.1.1.7 24

     45.1.1.7 24

     55.1.1.7 24

     65.1.1.7 24

Lookback:6.6.6.6 24

第二步:配置PC地址(其他PC同PC1方法):

 

第三步:配置IP地址:

R1:

[r1]int g 0/0/0
[r1-GigabitEthernet0/0/0]ip address 192.168.1.1 24
Jul 21 2023 22:48:51-08:00 r1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[r1-GigabitEthernet0/0/0]int g 0/0/1
[r1-GigabitEthernet0/0/1]ip address 15.1.1.1 24
Jul 21 2023 22:50:55-08:00 r1 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP 
on the interface GigabitEthernet0/0/1 has entered the UP state. 
[r1-GigabitEthernet0/0/1]int g 0/0/2
[r1-GigabitEthernet0/0/2]ip address 65.1.1.6 24
Jul 21 2023 22:51:20-08:00 r1 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP 
on the interface GigabitEthernet0/0/2 has entered the UP state. 

R2:

[r2]int g 0/0/0
[r2-GigabitEthernet0/0/0]ip address 192.168.2.1 24
Jul 21 2023 22:52:00-08:00 r2 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[r2-GigabitEthernet0/0/0]int g 0/0/1
[r2-GigabitEthernet0/0/1]ip address 25.1.1.2 24
Jul 21 2023 22:52:15-08:00 r2 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP 
on the interface GigabitEthernet0/0/1 has entered the UP state. 

R3:

[r3]int g 0/0/0
[r3-GigabitEthernet0/0/0]ip address 192.168.3.1 24
Jul 21 2023 22:52:34-08:00 r3 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[r3-GigabitEthernet0/0/0]int g 0/0/1
[r3-GigabitEthernet0/0/1]ip address 35.1.1.3 24
Jul 21 2023 22:52:47-08:00 r3 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP 
on the interface GigabitEthernet0/0/1 has entered the UP state. 

R4:

[r4]int g 0/0/0
[r4-GigabitEthernet0/0/0]ip address 15.1.1.7 24
Jul 21 2023 22:55:21-08:00 r4 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[r4-GigabitEthernet0/0/0]int g 0/0/1
[r4-GigabitEthernet0/0/1]ip address 25.1.1.7 24
Jul 21 2023 22:55:39-08:00 r4 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP 
on the interface GigabitEthernet0/0/1 has entered the UP state. 
[r4-GigabitEthernet0/0/1]int g 0/0/2
[r4-GigabitEthernet0/0/2]ip address 35.1.1.7 24
Jul 21 2023 22:55:51-08:00 r4 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP 
on the interface GigabitEthernet0/0/2 has entered the UP state. 
[r4-GigabitEthernet0/0/2]int g 3/0/0
[r4-GigabitEthernet3/0/0]ip address 45.1.1.7 24
Jul 21 2023 22:56:21-08:00 r4 %%01IFNET/4/LINK_STATE(l)[3]:The line protocol IP 
on the interface GigabitEthernet3/0/0 has entered the UP state. 
[r4-GigabitEthernet3/0/0]int g 4/0/0
[r4-GigabitEthernet4/0/0]ip address 55.1.1.7 24
Jul 21 2023 22:56:35-08:00 r4 %%01IFNET/4/LINK_STATE(l)[4]:The line protocol IP 
on the interface GigabitEthernet4/0/0 has entered the UP state. 
[r4-GigabitEthernet4/0/0]int g 2/0/0
[r4-GigabitEthernet2/0/0]ip address 65.1.1.7 24
Jul 21 2023 22:56:50-08:00 r4 %%01IFNET/4/LINK_STATE(l)[5]:The line protocol IP 
on the interface GigabitEthernet2/0/0 has entered the UP state. 

R5:

[r5]int g 0/0/0
[r5-GigabitEthernet0/0/0]ip address 192.168.4.1 24
Jul 21 2023 22:53:33-08:00 r5 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[r5-GigabitEthernet0/0/0]int g 0/0/1
[r5-GigabitEthernet0/0/1]ip address 45.1.1.4 24
Jul 21 2023 22:53:54-08:00 r5 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP 
on the interface GigabitEthernet0/0/1 has entered the UP state. 

R6:

[r6]int g 0/0/0
[r6-GigabitEthernet0/0/0]ip address 192.168.5.1 24
Jul 21 2023 22:54:12-08:00 r6 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[r6-GigabitEthernet0/0/0]int g 0/0/1
[r6-GigabitEthernet0/0/1]ip address 55.1.1.5 24
Jul 21 2023 22:54:33-08:00 r6 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP 
on the interface GigabitEthernet0/0/1 has entered the UP state. 

第四步:配置缺省路由:

[r1]ip route-static 0.0.0.0 0 15.1.1.7
[r1]ip route-static 0.0.0.0 0 65.1.1.7
[r2]ip route-static 0.0.0.0 0 25.1.1.7
[r3]ip route-static 0.0.0.0 0 35.1.1.7
[r5]ip route-static 0.0.0.0 0 45.1.1.7
[r6]ip route-static 0.0.0.0 0 55.1.1.7

第五步:NAT

R1:

[r1]acl 2000	
[r1-acl-basic-2000]rule 1 permit source any 
[r1-acl-basic-2000]q
[r1]int g 0/0/1
[r1-GigabitEthernet0/0/1]nat outbound 2000

R2:

[r2]acl 2000
[r2-acl-basic-2000]rule 2 permit source any 
[r2-acl-basic-2000]q
[r2]int g 0/0/1
[r2-GigabitEthernet0/0/1]nat outbound 2000

R3:

[r3]acl 2000	
[r3-acl-basic-2000]rule 1 permit source any 
[r3-acl-basic-2000]q
[r3]int g 0/0/1
[r3-GigabitEthernet0/0/1]nat outbound 2000

R5:

[r5]acl 2000
[r5-acl-basic-2000]rule 1 permit source any 
[r5-acl-basic-2000]q
[r5]int g 0/0/1
[r5-GigabitEthernet0/0/1]nat outbound 2000

R6:

[r6]acl 2000
[r6-acl-basic-2000]rule 1 permit source any 
[r6-acl-basic-2000]q
[r6]int g 0/0/1
[r6-GigabitEthernet0/0/1]nat outbound 2000

第六步:构建MGRE:

1.R1-2-3:

R1:
[r1]int t 0/0/0
[r1-Tunnel0/0/0]tunnel-protocol gre p2mp 
[r1-Tunnel0/0/0]ip address 10.1.1.1 24
[r1-Tunnel0/0/0]source 65.1.1.6
Jul 21 2023 23:25:30-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]nhrp network-id 100
R2:
[r2]int t 0/0/0
[r2-Tunnel0/0/0]tunnel-protocol gre p2mp 
[r2-Tunnel0/0/0]ip address 10.1.1.2 24
[r2-Tunnel0/0/0]source g 0/0/1
Jul 21 2023 23:26:54-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 10.1.1.1 65.1.1.6 register 
R3:
[r3]int t 0/0/0
[r3-Tunnel0/0/0]tunnel-protocol gre p2mp 
[r3-Tunnel0/0/0]ip address 10.1.1.3 24
[r3-Tunnel0/0/0]source g 0/0/1
Jul 21 2023 23:30:20-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 network-id 100
[r3-Tunnel0/0/0]nhrp entry 10.1.1.1 65.1.1.6 register 

2. R1-5-6:

R1:
[r1]int t 0/0/1
[r1-Tunnel0/0/1]tunnel-protocol gre p2mp 
[r1-Tunnel0/0/1]ip address 20.1.1.1 24
Jul 22 2023 00:09:19-08:00 r1 %%01IFNET/4/LINK_STATE(l)[3]:The line protocol IP 
on the interface Tunnel0/0/1 has entered the UP state. 
[r1-Tunnel0/0/1]source 15.1.1.1
[r1-Tunnel0/0/1]nhrp network-id 101
[r1-Tunnel0/0/1]nhrp entry 20.1.1.4 45.1.1.4 register 
Info: This peer protocol address conflicts with hub register peer protocol addre
ss. 
[r1-Tunnel0/0/1]nhrp entry 20.1.1.5 55.1.1.5 register
Info: This peer protocol address conflicts with hub register peer protocol addre
ss.
R5:
[r5]int t 0/0/1	
[r5-Tunnel0/0/1]tunnel-protocol gre p2mp 
[r5-Tunnel0/0/1]ip address 20.1.1.4 24
Jul 22 2023 00:10:10-08:00 r5 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface Tunnel0/0/1 has entered the UP state. 
[r5-Tunnel0/0/1]source 45.1.1.4
[r5-Tunnel0/0/1]nhrp network-id 101	
[r5-Tunnel0/0/1]nhrp entry 20.1.1.5 55.1.1.5 register 
[r5-Tunnel0/0/1]nhrp entry 20.1.1.1 15.1.1.1 register
R6:
[r6]int t 0/0/1
[r6-Tunnel0/0/1]tunnel-protocol gre p2mp 
[r6-Tunnel0/0/1]ip address 20.1.1.5 24
Jul 22 2023 00:10:59-08:00 r6 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface Tunnel0/0/1 has entered the UP state. 
[r6-Tunnel0/0/1]source 55.1.1.5
[r6-Tunnel0/0/1]nhrp network-id 101
[r6-Tunnel0/0/1]nhrp entry 20.1.1.4 45.1.1.4 register 
[r6-Tunnel0/0/1]nhrp entry 20.1.1.1 15.1.1.1 registe

 第七步:OSPF

R1:

[r1]ospf 1 router-id 1.1.1.1
[r1-ospf-1]area 0
[r1-ospf-1-area-0.0.0.0]network 10.1.1.0 0.0.0.255
[r1-ospf-1-area-0.0.0.0]network 192.168.1.0 0.0.0.255
[r1-ospf-1-area-0.0.0.0]network 20.1.1.0 0.0.0.255

R2:

[r2]ospf 1 router-id 2.2.2.2
[r2-ospf-1]area 0
[r2-ospf-1-area-0.0.0.0]network 10.1.1.0 0.0.0.255
[r2-ospf-1-area-0.0.0.0]network 192.168.2.0 0.0.0.255

R3:

[r3]ospf 1 router-id 3.3.3.3
[r3-ospf-1]area 0
[r3-ospf-1-area-0.0.0.0]network 10.1.1.0 0.0.0.255
[r3-ospf-1-area-0.0.0.0]network 192.168.3.0 0.0.0.255

R5:

[r5]ospf 1 router-id 4.4.4.4
[r5-ospf-1]area 0
[r5-ospf-1-area-0.0.0.0]network 20.1.1.0 0.0.0.255
[r5-ospf-1-area-0.0.0.0]network 192.168.4.0 0.0.0.255

R6:

[r6]ospf 1 router-id 5.5.5.5
[r6-ospf-1]area 0
[r6-ospf-1-area-0.0.0.0]network 20.1.1.0 0.0.0.255
[r6-ospf-1-area-0.0.0.0]network 192.168.5.0 0.0.0.255

第八步:修改P2P状态

[r1-Tunnel0/0/0]ospf network-type broadcast
[r2-Tunnel0/0/0]ospf network-type broadcast 
[r3-Tunnel0/0/0]ospf network-type broadcast 


[r1-Tunnel0/0/1]ospf network-type broadcast
[r5-Tunnel0/0/1]ospf network-type broadcast 
[r6-Tunnel0/0/1]ospf network-type broadcast 

第九步:伪广播

[r1-Tunnel0/0/1]nhrp entry multicast dynamic 
[r5-Tunnel0/0/1]nhrp entry multicast dynamic 
[r6-Tunnel0/0/1]nhrp entry multicast dynamic 

第十步:优先级(因缺少路由给R2,R3的DR改为0)

[r2-Tunnel0/0/0]ospf dr-priority 0
[r3-Tunnel0/0/0]ospf dr-priority 0

3.实验结果:

 

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值