OSPF多區域配置與心得理解
ospf 多區域
文章目錄
實驗背景
實驗需求
1.配置IP地址
2.完整配置ospf多區域
3.檢視鄰居關係
4.強制釋出預設路由
5.在R3的G0/0/1口配置靜默介面
6.驗證路由表
1.配置ip地址
R1
[R1]INT LOOPBACK 0
[R1-LoopBack0]IP ADDRESS 1.1.1.1 32
[R1]INT G 0/0/0
[R1-GigabitEthernet0/0/0]IP ADDRESS 20.0.0.1 30
[R1]INT G0/0/1
[R1-GigabitEthernet0/0/1]IP ADDRESS 10.0.0.1 30
R2
[R2]INT LOOPBACK 0
[R2-LoopBack0]IP ADDRESS 2.2.2.2 32
[R2]INT G0/0/1
[R2-GigabitEthernet0/0/1]IP ADDRESS 30.0.0.1 30
[R2]INT G0/0/0
[R2-GigabitEthernet0/0/0]IP ADDRESS 20.0.0.2 30
[R2]int loopback 1
[R2-LoopBack1]ip address 6.6.6.6 32
R3
[R3]INT LOOPBACK 0
[R3]IP ADDRESS 3.3.3.3 32
[R3-LoopBack0]INT G0/0/1
[R3-GigabitEthernet0/0/1]IP ADDRESS 10.0.0.2 30
[R3]int g0/0/0
[R3-GigabitEthernet0/0/0]ip address 192.168.1.1 24
R4
[R4]INT LOOPBACK 0
[R4-LoopBack0]IP ADDRESS 4.4.4.4 32
[R4]INT G0/0/1
[R4-GigabitEthernet0/0/1]IP ADDRESS 30.0.0.2 30
2.配置OSPF
R1
[R1]ospf
[R1-ospf-1]area 0
[R1-ospf-1-area-0.0.0.0]network 20.0.0.0 0.0.0.3
[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]area 1
[R1-ospf-1-area-0.0.0.1]network 10.0.0.0 0.0.0.3
R2
[R2]ospf
[R2-ospf-1]area 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]network 20.0.0.0 0.0.0.3
[R2-ospf-1]area 2
[R2-ospf-1-area-0.0.0.2]network 30.0.0.0 0.0.0.3
R3
[R3]ospf
[R3-ospf-1]area 1
[R3-ospf-1-area-0.0.0.1]network 192.168.1.0 0.0.0.255
[R3-ospf-1-area-0.0.0.1]network 10.0.0.0 0.0.0.3
[R3-ospf-1-area-0.0.0.1]network 3.3.3.3 0.0.0.0
R4
[R4]ospf
[R4-ospf-1]area 2
[R4-ospf-1-area-0.0.0.2]network 30.0.0.0 0.0.0.3
[R4-ospf-1-area-0.0.0.2]network 4.4.4.4 0.0.0.0
3檢視R1,R4的鄰居表
R1
[R1]dis ospf peer brief
OSPF Process 1 with Router ID 1.1.1.1
Peer Statistic Information
----------------------------------------------------------------------------
Area Id Interface Neighbor id State
0.0.0.0 GigabitEthernet0/0/0 20.0.0.2 Full
0.0.0.1 GigabitEthernet0/0/1 10.0.0.2 Full
----------------------------------------------------------------------------
可以看到route-id 不是4.4.4.4 應該是先建立鄰居的時候hollo裡面攜帶的是30.0.0.2 這個本地介面地址
R4
[R4]dis ospf peer brief
OSPF Process 1 with Router ID 30.0.0.2
Peer Statistic Information
----------------------------------------------------------------------------
Area Id Interface Neighbor id State
0.0.0.2 GigabitEthernet0/0/1 20.0.0.2 Full
----------------------------------------------------------------------------
4.強制釋出一跳預設路由
後面帶了 always 無論路由器是否有預設路由 都可以釋出 如果沒有帶alwaye 那釋出之前本地必須要有一條預設路由。
但是我不建議這樣做 要分好情況 這樣做只是下發了一條 預設路由 但是本地不會生成預設路由 所以就沒有指明去外網的路 很有可以會出問題
R2
[R2-ospf-1]default-route-advertise always
檢視R1有沒有收到預設路由
R1
<R1>dis ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 17 Routes : 17
Destination/Mask Proto Pre Cost Flags NextHop Interface
0.0.0.0/0 O_ASE 150 1 D 20.0.0.2 GigabitEthernet
0/0/0
5.在R3上使用靜默介面
如上配置 宣告瞭g0/0/0 那它就有了收發ospf報文的能力 但是0/0/0口接的是個主機完全不知道ospf hollo 報文 比較適合配置靜默介面
R3
[R3-ospf-1]silent-interface GigabitEthernet 0/0/0
測試PC ping外網6.6.6.6
PC
PC>ping 6.6.6.6
Ping 6.6.6.6: 32 data bytes, Press Ctrl_C to break
From 6.6.6.6: bytes=32 seq=1 ttl=253 time=62 ms
From 6.6.6.6: bytes=32 seq=2 ttl=253 time=16 ms
From 6.6.6.6: bytes=32 seq=3 ttl=253 time=31 ms
From 6.6.6.6: bytes=32 seq=4 ttl=253 time=16 ms
From 6.6.6.6: bytes=32 seq=5 ttl=253 time=31 ms
--- 6.6.6.6 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 16/31/62 ms
6.檢視路由
R1
<R1>DIS IP ROUTING
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 17 Routes : 17
Destination/Mask Proto Pre Cost Flags NextHop Interface
0.0.0.0/0 O_ASE 150 1 D 20.0.0.2 GigabitEthernet
0/0/0
1.1.1.1/32 Direct 0 0 D 127.0.0.1 LoopBack0
2.2.2.2/32 OSPF 10 1 D 20.0.0.2 GigabitEthernet
0/0/0
3.3.3.3/32 OSPF 10 1 D 10.0.0.2 GigabitEthernet
0/0/1
4.4.4.4/32 OSPF 10 2 D 20.0.0.2 GigabitEthernet
0/0/0
10.0.0.0/30 Direct 0 0 D 10.0.0.1 GigabitEthernet
0/0/1
10.0.0.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/1
10.0.0.3/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/1
20.0.0.0/30 Direct 0 0 D 20.0.0.1 GigabitEthernet
0/0/0
20.0.0.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
20.0.0.3/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
30.0.0.0/30 OSPF 10 2 D 20.0.0.2 GigabitEthernet
0/0/0
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
192.168.1.0/24 OSPF 10 2 D 10.0.0.2 GigabitEthernet
0/0/1
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
R2
可以看到R2裝置上沒有靜態預設路由
[R2-ospf-1]dis ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 17 Routes : 17
Destination/Mask Proto Pre Cost Flags NextHop Interface
1.1.1.1/32 OSPF 10 1 D 20.0.0.1 GigabitEthernet
0/0/0
2.2.2.2/32 Direct 0 0 D 127.0.0.1 LoopBack0
3.3.3.3/32 OSPF 10 2 D 20.0.0.1 GigabitEthernet
0/0/0
4.4.4.4/32 OSPF 10 1 D 30.0.0.2 GigabitEthernet
0/0/1
6.6.6.6/32 Direct 0 0 D 127.0.0.1 LoopBack1
10.0.0.0/30 OSPF 10 2 D 20.0.0.1 GigabitEthernet
0/0/0
20.0.0.0/30 Direct 0 0 D 20.0.0.2 GigabitEthernet
0/0/0
20.0.0.2/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
20.0.0.3/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
30.0.0.0/30 Direct 0 0 D 30.0.0.1 GigabitEthernet
0/0/1
30.0.0.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/1
30.0.0.3/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/1
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
192.168.1.0/24 OSPF 10 3 D 20.0.0.1 GigabitEthernet
0/0/0
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
R3
<R3>dis ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 17 Routes : 17
Destination/Mask Proto Pre Cost Flags NextHop Interface
0.0.0.0/0 O_ASE 150 1 D 10.0.0.1 GigabitEthernet
0/0/1
1.1.1.1/32 OSPF 10 1 D 10.0.0.1 GigabitEthernet
0/0/1
2.2.2.2/32 OSPF 10 2 D 10.0.0.1 GigabitEthernet
0/0/1
3.3.3.3/32 Direct 0 0 D 127.0.0.1 LoopBack0
4.4.4.4/32 OSPF 10 3 D 10.0.0.1 GigabitEthernet
0/0/1
10.0.0.0/30 Direct 0 0 D 10.0.0.2 GigabitEthernet
0/0/1
10.0.0.2/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/1
10.0.0.3/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/1
20.0.0.0/30 OSPF 10 2 D 10.0.0.1 GigabitEthernet
0/0/1
30.0.0.0/30 OSPF 10 3 D 10.0.0.1 GigabitEthernet
0/0/1
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
192.168.1.0/24 Direct 0 0 D 192.168.1.1 GigabitEthernet
0/0/0
192.168.1.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
192.168.1.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
R4
<R4>dis ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 15 Routes : 15
Destination/Mask Proto Pre Cost Flags NextHop Interface
0.0.0.0/0 O_ASE 150 1 D 30.0.0.1 GigabitEthernet
0/0/1
1.1.1.1/32 OSPF 10 2 D 30.0.0.1 GigabitEthernet
0/0/1
2.2.2.2/32 OSPF 10 1 D 30.0.0.1 GigabitEthernet
0/0/1
3.3.3.3/32 OSPF 10 3 D 30.0.0.1 GigabitEthernet
0/0/1
4.4.4.4/32 Direct 0 0 D 127.0.0.1 LoopBack0
10.0.0.0/30 OSPF 10 3 D 30.0.0.1 GigabitEthernet
0/0/1
20.0.0.0/30 OSPF 10 2 D 30.0.0.1 GigabitEthernet
0/0/1
30.0.0.0/30 Direct 0 0 D 30.0.0.2 GigabitEthernet
0/0/1
30.0.0.2/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/1
30.0.0.3/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/1
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
192.168.1.0/24 OSPF 10 4 D 30.0.0.1 GigabitEthernet
0/0/1
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
相關文章
- OSPF協議的多區域配置,圖文講解協議
- OSPF單區域配置-ZTE中興路由器路由器
- HCNP Routing&Switching之OSPF特殊區域
- 深入理解OSPF協議協議
- 理解Java記憶體區域與垃圾收集器Java記憶體
- 配置OSPF負載分擔負載
- eNSP華為路由器OSPF配置----OSPF和RIP互相通訊路由器
- IIS配置多域名跨域跨域
- 怎麼通俗易懂的理解OSPF?
- 區域網中存在多臺寬頻路由器如何配置路由器
- OSPF介紹及基礎配置
- 實驗六——————OSPF協議配置協議
- Vagrant 中配置區域網埠
- 思科與H3C配置命令對比 靜態路由&OSPF路由
- 配置RIP、OSPF實現全網互通
- 實驗5.OSPF配置實驗
- 模型無關的區域性解釋(LIME)技術原理解析及多領域應用實踐模型
- JVM資料區域與垃圾收集<深入理解JVM讀書筆記>JVM筆記
- 深入理解JVM之記憶體區域與記憶體溢位JVM記憶體溢位
- Java的中文程式設計與配置心得 (轉)Java程式設計
- 區域網交換機的配置與選購基礎知識(轉)
- 【譯】理解Rust中的區域性移動Rust
- 深入理解javascript系列(六):作用域與作用域鏈JavaScript
- 如何在多區域執行Zookeeper?- Ankur
- hostname修改理解心得-linuxLinux
- 區域性可理解的與模型無關的解釋(LIME)技術介紹模型
- css去除圖片下多餘空白區域CSS
- OSPF路由 與 ISIS路由 與路由學習對比路由
- 配置SQL server遠端連線(區域網)SQLServer
- 企業區域網本地路由器配置路由器
- OSPF NSSA
- App 多區域皮膚(主題)的實現APP
- Ceph物件閘道器,多區域閘道器物件
- 深入理解JVM虛擬機器-JVM記憶體區域與記憶體溢位JVM虛擬機記憶體溢位
- JVM-記憶體區域與OOMJVM記憶體OOM
- Java記憶體區域與分配策略Java記憶體
- 理解 JS 作用域鏈與執行上下文JS
- 多域型SSL證書與通配型伺服器證書有哪些區別?伺服器