3.4 OSPF配置详解

8.OSPF多进程

图片[1]-3.4 OSPF配置详解-大赛人网
图3-51 OSPF 报文认证网络拓扑

1)基本配置

[R1]ospf 1 router-id 1.1.1.1
[R1-ospf-1]area 0
[R1-ospf-1-area-0.0.0.0]network 12.1.1.0 0.255.255.255
[R1-ospf-1]area 1
[R1-ospf-1-area-0.0.0.1]network 192.168.1.0 0.0.0.255

[R2]ospf 100 router-id 2.2.2.2
[R2-ospf-100]area 0
[R2-ospf-100-area-0.0.0.0]network 12.1.1.0 0.255.255.255

[R2]ospf 200 router-id 2.2.2.2
[R2-ospf-200]area 0
[R2-ospf-200-area-0.0.0.0]network 23.1.1.0 0.255.255.255

[R3]ospf 1 router-id 3.3.3.3
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]network 23.1.1.0 0.255.255.255
[R3-ospf-1]area 1
[R3-ospf-1-area-0.0.0.1]network 192.168.2.0 0.0.0.255

2)在R2上查看邻居表

[R2]display ospf peer 
         OSPF Process 100 with Router ID 2.2.2.2
                 Neighbors 
 Area 0.0.0.0 interface 12.1.1.2(GigabitEthernet0/0/0)'s neighbors
 Router ID: 1.1.1.1          Address: 12.1.1.1        
   State: Full  Mode:Nbr is  Slave  Priority: 1
   DR: 12.1.1.1  BDR: 12.1.1.2  MTU: 0    
   Dead timer due in 34  sec 
   Retrans timer interval: 5 
   Neighbor is up for 00:03:28     
   Authentication Sequence: [ 0 ] 
         OSPF Process 200 with Router ID 2.2.2.2
                 Neighbors 
 Area 0.0.0.0 interface 23.1.1.2(GigabitEthernet0/0/1)'s neighbors
 Router ID: 3.3.3.3          Address: 23.1.1.3        
   State: Full  Mode:Nbr is  Master  Priority: 1
   DR: 23.1.1.2  BDR: 23.1.1.3  MTU: 0    
   Dead timer due in 39  sec 
   Retrans timer interval: 5 
   Neighbor is up for 00:01:09     
   Authentication Sequence: [ 0 ] 

3)查看R2的LSDB

[R2]display ospf lsdb 
         OSPF Process 100 with Router ID 2.2.2.2
                 Link State Database 
                         Area: 0.0.0.0
Type      LinkState ID    AdvRouter          Age  Len   Sequence   Metric
Router    2.2.2.2         2.2.2.2            310  36    80000003       1
Router    1.1.1.1         1.1.1.1            309  36    80000006       1
Network   12.1.1.1        1.1.1.1            309  32    80000002       0
Sum-Net   192.168.1.0     1.1.1.1            350  28    80000001       1

         OSPF Process 200 with Router ID 2.2.2.2
                 Link State Database 
                         Area: 0.0.0.0
Type      LinkState ID    AdvRouter          Age  Len   Sequence   Metric
Router    2.2.2.2         2.2.2.2            170  36    80000005       1
Router    3.3.3.3         3.3.3.3            168  36    80000004       1
Network   23.1.1.2        2.2.2.2            170  32    80000002       0
Sum-Net   192.168.2.0     3.3.3.3            157  28    80000001       1

3)查看R2的OSPF路由表

[R2]display ospf routing
         OSPF Process 100 with Router ID 2.2.2.2
                  Routing Tables 
 Routing for Network 
Destination        Cost  Type       NextHop         AdvRouter       Area
12.0.0.0/8         1     Transit    12.1.1.2        2.2.2.2         0.0.0.0
192.168.1.0/24     2     Inter-area 12.1.1.1        1.1.1.1         0.0.0.0
         OSPF Process 200 with Router ID 2.2.2.2
                  Routing Tables 
Routing for Network 
Destination        Cost  Type       NextHop         AdvRouter       Area
23.0.0.0/8         1     Transit    23.1.1.2        2.2.2.2         0.0.0.0
192.168.2.0/24     2     Inter-area 23.1.1.3        3.3.3.3         0.0.0.0

4)查看R2路由表,192.168.1.0/24和192.168.2.0/24无法相互访问。

[R2]display  ip routing-table  protocol ospf
Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface
192.168.1.0/24  OSPF    10   2           D   12.1.1.1        GigabitEthernet0/0/0
192.168.2.0/24  OSPF    10   2           D   23.1.1.3        GigabitEthernet0/0/1 

5)在R2上将两个进程相互引入,192.168.1.0/24和192.168.2.0/24可以相互访问。

[R2]ospf 100
[R2-ospf-100]import-route ospf 200
[R2-ospf-100]quit
[R2]ospf 200
[R2-ospf-200]import-route ospf 100

1 2 3 4 5 6 7 8

© 版权声明
THE END
喜欢就支持一下吧
点赞11 分享
评论 抢沙发
头像
欢迎您留下宝贵的见解!
提交
头像

昵称

取消
昵称

    请登录后查看评论内容