![图片[1]-4.16 OSPF虚电路-大赛人网](https://www.dsrw.com/wp-content/uploads/2023/03/图片4-23-1024x239.png)
1.R1配置
[R1]ospf 1 router-id 1.1.1.1
[R1-ospf-1]area 0
[R1-ospf-1-area-0.0.0.0]network 1.1.1.1 0.0.0.0
[R1-ospf-1-area-0.0.0.0]network 12.1.1.0 0.255.255.255
2.R2配置
[R2]ospf 1 router-id 2.2.2.2
[R2-ospf-1-area-0.0.0.0]network 2.2.2.2 0.0.0.0
[R2-ospf-1-area-0.0.0.0]network 12.1.1.0 0.255.255.255
[R2-ospf-1-area-0.0.0.0]quit
[R2-ospf-1]area 1
[R2-ospf-1-area-0.0.0.1]network 23.1.1.0 0.255.255.255
3.R3配置
[R3]ospf 1 router-id 3.3.3.3
[R3-ospf-1]area 1
[R3-ospf-1-area-0.0.0.1]network 3.3.3.3 0.0.0.0
[R3-ospf-1-area-0.0.0.1]network 23.1.1.0 0.255.255.255
[R3-ospf-1]area 2
[R3-ospf-1-area-0.0.0.2]network 34.1.1.0 0.255.255.255
4.R4配置
[R4]ospf 1 router-id 4.4.4.4
[R4-ospf-1]area 2
[R4-ospf-1-area-0.0.0.2]network 4.4.4.4 0.0.0.0
[R4-ospf-1-area-0.0.0.2]network 34.1.1.0 0.255.255.255
5.查看R1、R4的OSPF路由信息,R1未学习到R4路由,R4未学习到任何路由
<R1>display ip routing-table protocol ospf
Destination/Mask Proto Pre Cost Flags NextHop Interface
2.2.2.2/32 OSPF 10 1 D 12.1.1.2 GigabitEthernet0/0/0
3.3.3.3/32 OSPF 10 2 D 12.1.1.2 GigabitEthernet0/0/0
23.0.0.0/8 OSPF 10 2 D 12.1.1.2 GigabitEthernet0/0/0
[R4]display ip routing-table protocol ospf
6.R2、R3创建虚电路
[R2]ospf 1
[R2-ospf-1]area 1
[R2-ospf-1-area-0.0.0.1]vlink-peer 23.1.1.3
[R2-ospf-1-area-0.0.0.1]vlink-peer 3.3.3.3
[R3]ospf 1
[R3-ospf-1-area-0.0.0.1]vlink-peer 2.2.2.2
7.查看R1、G4的OSPF路由
<R1>display ip routing-table protocol ospf
Destination/Mask Proto Pre Cost Flags NextHop Interface
2.2.2.2/32 OSPF 10 1 D 12.1.1.2 GigabitEthernet0/0/0
3.3.3.3/32 OSPF 10 2 D 12.1.1.2 GigabitEthernet0/0/0
4.4.4.4/32 OSPF 10 3 D 12.1.1.2 GigabitEthernet0/0/0
23.0.0.0/8 OSPF 10 2 D 12.1.1.2 GigabitEthernet0/0/0
34.0.0.0/8 OSPF 10 3 D 12.1.1.2 GigabitEthernet0/0/0
[R4]display ip routing-table protocol ospf
Destination/Mask Proto Pre Cost Flags NextHop Interface
1.1.1.1/32 OSPF 10 3 D 34.1.1.3 GigabitEthernet0/0/0
2.2.2.2/32 OSPF 10 2 D 34.1.1.3 GigabitEthernet0/0/0
3.3.3.3/32 OSPF 10 1 D 34.1.1.3 GigabitEthernet0/0/0
12.0.0.0/8 OSPF 10 3 D 34.1.1.3 GigabitEthernet0/0/0
23.0.0.0/8 OSPF 10 2 D 34.1.1.3 GigabitEthernet0/0/0
8.查看R4的LSDB
[R4]display ospf lsdb
OSPF Process 1 with Router ID 4.4.4.4
Link State Database
Area: 0.0.0.2
Type LinkState ID AdvRouter Age Len Sequence Metric
Router 4.4.4.4 4.4.4.4 461 48 80000004 1
Router 3.3.3.3 3.3.3.3 85 36 80000006 1
Network 34.1.1.3 3.3.3.3 457 32 80000002 0
Sum-Net 23.0.0.0 3.3.3.3 85 28 80000001 1
Sum-Net 3.3.3.3 3.3.3.3 85 28 80000001 0
Sum-Net 2.2.2.2 3.3.3.3 85 28 80000001 1
Sum-Net 1.1.1.1 3.3.3.3 85 28 80000001 2
Sum-Net 12.0.0.0 3.3.3.3 85 28 80000001 2
9.区域0认证后,虚电路属于区域0,也需做认证
[R1]ospf 1
[R1-ospf-1]area 0
[R1-ospf-1-area-0.0.0.0]authentication-mode md5 1 plain dsrw.com
[R2]ospf 1
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]authentication-mode md5 1 plain dsrw.com
10.R3查看OSPF错误信息
<R3>display ospf error
19 : Bad packet
19 : Bad authentication type
11.R3区域0做认证
[R3]ospf 1
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]authentication-mode md5 1 plain dsrw.com
12.查看虚电路
[R3]display ospf vlink
OSPF Process 1 with Router ID 3.3.3.3
Virtual Links
Virtual-link Neighbor-id -> 2.2.2.2, Neighbor-State: Full
Interface: 23.1.1.3 (GigabitEthernet0/0/1)
Cost: 1 State: P-2-P Type: Virtual
Transit Area: 0.0.0.1
Timers: Hello 10 , Dead 40 , Retransmit 5 , Transmit Delay 1
GR State: Normal
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END
请登录后查看评论内容