ospf的作业

文章详细描述了路由器r1、r2、r3配置IP地址、Tunnel接口、NHRP协议以及与r4和r5之间的hub-spoke连接,同时提及了OSPF网络类型设置。
摘要由CSDN通过智能技术生成

配置IP

如 r1

[r1]interface  g0/0/0
[r1-GigabitEthernet0/0/0]ip address 16.0.0.1 24
[r1]interface g0/0/1
[r1-GigabitEthernet0/0/1]ip address 61.0.0.1 24
[r1]interface LoopBack 0
[r1-LoopBack0]ip address 192.168.6.1 24	
[r1]interface LoopBack 1
[r1-LoopBack1]ip address 192.168.1.1 24
[r1]ip route-static 0.0.0.0 0 61.0.0.2
[r1]ip route-static 0.0.0.0 0 16.0.0.2
[r1]ip route-static 56.0.0.0 24 61.0.0.2
[r1]ip route-static 56.0.0.0 24 16.0.0.2
[r1]ip route-static 46.0.0.0 24 16.0.0.2
[r1]ip route-static 36.0.0.0 24 16.0.0.2
[r1]ip route-static 26.0.0.0 24 16.0.0.2
[r1]ip route-static 26.0.0.0 24 61.0.0.2
[r1]ip route-static 36.0.0.0 24 61.0.0.2
[r1]ip route-static 46.0.0.0 24 61.0.0.2

 r1,r2,r3的hub and spoke架构

r1上

[r1]interface Tunnel 0/0/0
[r1-Tunnel0/0/0]ip ad	
[r1-Tunnel0/0/0]ip address 192.168.7.1 24	
[r1-Tunnel0/0/0]tunnel-protocol gre p2mp 
[r1-Tunnel0/0/0]so	
[r1-Tunnel0/0/0]source 16.0.0.1
Apr 16 2024 17:09:56-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]nhrp ne	
[r1-Tunnel0/0/0]nhrp network-id 100

r2

[r2]in t0/0/0
[r2-Tunnel0/0/0]ip ad	
[r2-Tunnel0/0/0]ip address 192.168.7.2 24
[r2-Tunnel0/0/0]tun	
[r2-Tunnel0/0/0]tunnel-protocol gre p2	
[r2-Tunnel0/0/0]tunnel-protocol gre p2mp 
[r2-Tunnel0/0/0]sou	
[r2-Tunnel0/0/0]source g0/0/0
Apr 16 2024 17:11:45-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]nh	
[r2-Tunnel0/0/0]nhrp n	
[r2-Tunnel0/0/0]nhrp network-id 10
[r2-Tunnel0/0/0]nhrp entry 192.168.7.1 16.0.0.1 register 

r3

[r3]interface Tunnel 0/0/0
[r3-Tunnel0/0/0]ip ad	
[r3-Tunnel0/0/0]ip address 192.168.7.3 24
[r3-Tunnel0/0/0]tu	
[r3-Tunnel0/0/0]tunnel-protocol gre p2	
[r3-Tunnel0/0/0]tunnel-protocol gre p2mp 
[r3-Tunnel0/0/0]so	
[r3-Tunnel0/0/0]source g 0/0/0
Apr 16 2024 17:13:38-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 192.168.7.1 16.0.0.1 register 

r1上display一下

[r1-Tunnel0/0/0]display nhrp peer all
------------------------------------------------------------------------------- 
Protocol-addr   Mask  NBMA-addr       NextHop-addr    Type         Flag         
------------------------------------------------------------------------------- 
192.168.7.2     32    26.0.0.1        192.168.7.2     dynamic      route tunnel 
------------------------------------------------------------------------------- 
Tunnel interface: Tunnel0/0/0
Created time    : 00:02:44
Expire time     : 01:57:16
------------------------------------------------------------------------------- 
Protocol-addr   Mask  NBMA-addr       NextHop-addr    Type         Flag         
------------------------------------------------------------------------------- 
192.168.7.3     32    36.0.0.1        192.168.7.3     dynamic      route tunnel 
------------------------------------------------------------------------------- 
Tunnel interface: Tunnel0/0/0
Created time    : 00:00:54
Expire time     : 01:59:06

Number of nhrp peers: 2

r1,r4,r5上两两连接

r1

[r1]interface Tunnel 0/0/1
[r1-Tunnel0/0/1]ip ad	
[r1-Tunnel0/0/1]ip address 192.168.8.1 24
[r1-Tunnel0/0/1]tunnel-protocol gre p2mp
[r1-Tunnel0/0/1]source 61.0.0.1

[r1-Tunnel0/0/1]nhrp network-id 200

r4

[r4]interface Tunnel 0/0/1
[r4-Tunnel0/0/1] ip ad	
[r4-Tunnel0/0/1]ip address 192.168.8.2 242	
[r4-Tunnel0/0/1]tunnel-protocol gre p2mp 
[r4-Tunnel0/0/1]source  g0/0/0	
[r4-Tunnel0/0/1]nhrp network-id 200
[r4-Tunnel0/0/1]nhrp entry 192.168.8.1 61.0.0.1 register 

r5

[r5]in t0/0/1
[r5-Tunnel0/0/1]ip address 192.168.8.3 24
[r5-Tunnel0/0/1]tunnel-protocol gre p2mp
[r5-Tunnel0/0/1]source  g0/0/0
[r5-Tunnel0/0/1]nhrp entry 192.168.8.1 61.0.0.1 register 

其他连接类似

开启伪广播

[r1]in t0/0/0
[r1-Tunnel0/0/0]nhrp en	
[r1-Tunnel0/0/0]nhrp entry mu	
[r1-Tunnel0/0/0]nhrp entry multicast dy	
[r1-Tunnel0/0/0]nhrp entry multicast dynamic 

在r1到r5上更改type

[r1]interface t0/0/0	
[r1-Tunnel0/0/0]ospf network-type broadcast 

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

不会取名余

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

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

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

打赏作者

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

抵扣说明:

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

余额充值