最佳答案
在实际组网中,经常会遇到OSPF组网的案例,比如单区域OSPF、多区域OSPF、OSPF虚链路、OSPF NSSA、OSPF STUB等需求,以下是多区域OSPF典型组网的配置案例。
互联地址、业务地址、looback0地址如上图所示,全网均采用OSPF进程1、其中R1与R2路由器属于OSPF的区域0,R2与R3路由器属于OSPF区域1,实现全网互联互通。
1、配置loopback0地址
2、配置各互联地址
3、创建OSPF进程1,并将各地址在区域0中发布
4、查看OSPF邻居的状态
5、测试PC之间能互联互通
R1:
<H3C>system-view
[H3C]sysname R1
[R1]int LoopBack 0
[R1-LoopBack0]ip add
[R1-LoopBack0]ip address 1.1.1.1 32
[R1-LoopBack0]quit
[R1]int gi 0/0
[R1-GigabitEthernet0/0]ip address 192.168.1.1 24
[R1-GigabitEthernet0/0]description <connect to PC>
[R1-GigabitEthernet0/0]quit
[R1]int gi 0/1
[R1-GigabitEthernet0/1]ip address 10.0.0.1 30
[R1-GigabitEthernet0/1]description <connect to R2>
[R1-GigabitEthernet0/1]quit
[R1]ospf 1 router-id 1.1.1.1
[R1-ospf-1]area 0.0.0.0
[R1-ospf-1-area-0.0.0.0]network 10.0.0.1 0.0.0.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 192.168.1.0 0.0.0.255
[R1-ospf-1-area-0.0.0.0]quit
[R1-ospf-1]quit
R2:
<H3C>system-view
[H3C]sysname R2
[R2]int LoopBack 0
[R2-LoopBack0]ip address 2.2.2.2 32
[R2-LoopBack0]quit
[R2]int gi 0/0
[R2-GigabitEthernet0/0]ip address 10.0.0.2 30
[R2-GigabitEthernet0/0]description <connect to R1>
[R2-GigabitEthernet0/0]quit
[R2]int gi 0/1
[R2-GigabitEthernet0/1]description <connect to R3>
[R2-GigabitEthernet0/1]ip address 10.0.0.5 30
[R2-GigabitEthernet0/1]quit
[R2]ospf 1 router-id 2.2.2.2
[R2-ospf-1]area 0.0.0.0
[R2-ospf-1-area-0.0.0.0]network 10.0.0.2 0.0.0.0
[R2-ospf-1-area-0.0.0.0]network 10.0.0.5 0.0.0.0
[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]quit
[R2-ospf-1]quit
R3:
<H3C>system-view
[H3C]sysname R3
[R3]int LoopBack 0
[R3-LoopBack0]ip address 3.3.3.3 32
[R3-LoopBack0]quit
[R3]int gi 0/0
[R3-GigabitEthernet0/0]description <connect to PC>
[R3-GigabitEthernet0/0]ip address 172.16.1.1 24
[R3-GigabitEthernet0/0]quit
[R3]int gi 0/1
[R3-GigabitEthernet0/1]description <connect to R2>
[R3-GigabitEthernet0/1]ip address 10.0.0.6 30
[R3-GigabitEthernet0/1]quit
[R3]ospf 1 router-id 3.3.3.3
[R3-ospf-1]area 0.0.0.0
[R3-ospf-1-area-0.0.0.0]network 10.0.0.6 0.0.0.0
[R3-ospf-1-area-0.0.0.0]network 3.3.3.3 0.0.0.0
[R3-ospf-1-area-0.0.0.0]network 172.16.1.0 0.0.0.255
[R3-ospf-1-area-0.0.0.0]quit
[R3-ospf-1]quit
测试各路由器的OSPF邻居建立情况:
R1>dis ospf peer
OSPF Process 1 with Router ID 1.1.1.1
Neighbor Brief Information
Area: 0.0.0.0
Router ID Address Pri Dead-Time State Interface
2.2.2.2 10.0.0.2 1 37 Full/BDR GE0/1
<R1>
<R2>dis ospf peer
OSPF Process 1 with Router ID 2.2.2.2
Neighbor Brief Information
Area: 0.0.0.0
Router ID Address Pri Dead-Time State Interface
1.1.1.1 10.0.0.1 1 39 Full/DR GE0/0
3.3.3.3 10.0.0.6 1 34 Full/BDR GE0/1
<R2>
[R3]dis ospf peer
OSPF Process 1 with Router ID 3.3.3.3
Neighbor Brief Information
Area: 0.0.0.0
Router ID Address Pri Dead-Time State Interface
2.2.2.2 10.0.0.5 1 37 Full/DR GE0/1
[R3]
至此单区域OSPF配置已完成!
(0)
亲~登录后才可以操作哦!
确定你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作
举报
×
侵犯我的权益
×
侵犯了我企业的权益
×
抄袭了我的内容
×
原文链接或出处
诽谤我
×
对根叔社区有害的内容
×
不规范转载
×
举报说明
暂无评论