ควรอ่านบทความ Routing Protocol เพื่อเป็นพื้นฐานก่อนได้ที่ https://www.jodoi.org/router%20protocal.html
จากรูปภาพด้านบนมีการออกแบบให้มีการใช้ Routing Protocol เป็น OSPF โดยแบ่งเป็น 3 Area คือ Area 0 , Area 1 และ Area 2 ก่อนที่จะประกาศ Routing ไม่ว่าจะเป็น Routing Protocol ประเภทใดสิ่งที่ต้องทำก่อนคือการต่อสายเชื่อมต่อและ Set IP Address ให้ถูกต้องก่อนครับ ดังตัวอย่างด้านล่างการ Set IP Address ของ Router R1, R2 , ABR2 และ SW-L3
R2(config)#interface f0/0
R2(config-if)#ip address 10.10.10.9 255.255.255.252
R2(config-if)#no shutdown
R2(config)#interface s0/0
R2(config-if)#ip address 10.10.10.6 255.255.255.252
R2(config-if)#no shutdown
R2(config-if)#exit
R2(config)#interface loopback 0
R2(config-if)#ip address 1.1.1.1 255.255.255.255
R2(config-if)#exit
R1(config)#interface s0/0
R1(config-if)#ip address 10.10.10.5 255.255.255.252
R1(config-if)#no shutdown
R1(config)#interface f0/0
R1(config-if)#ip address 172.16.1.3 255.255.255.248
R1(config-if)#no shutdown
R1(config-if)#exit
R1(config)#interface loopback 0
R1(config-if)#ip address 4.4.4.4 255.255.255.255
ABR2(config)#interface g0/0
ABR2(config-if)#ip address 10.10.10.10 255.255.255.252
ABR2(config-if)#no shutdown
ABR2(config-if)#exit
ABR2(config)#interface g0/1
ABR2(config-if)#ip address 172.17.1.1 255.255.255.252
ABR2(config-if)#no shutdown
ABR2(config)#interface loopback 0
ABR2(config-if)#ip address 2.2.2.2 255.255.255.255
SW-L3(config)#interface g0/0
SW-L3(config-if)#no switchport
SW-L3(config-if)#ip address 172.17.1.2 255.255.255.252
SW-L3(config-if)#exit
SW-L3(config)#vlan 20
SW-L3(config)#interface g0/1
SW-L3(config-if)#switchport trunk encapsulation dot1q
SW-L3(config-if)#switchport mode trunk
SW-L3(config)#interface vlan 20
SW-L3(config-if)#ip address 192.168.1.254 255.255.255.0
SW-L3(config-if)#no shutdown
SW-L3(config)#interface loopback 0
SW-L3(config-if)#ip address 3.3.3.3 255.255.255.255
ขั้นตอนต่อไปคือการประกาศ Routing ospf ซึ่งสามารถ Config ได้ 2 แบบคือการใส่ Area ที่ในส่วนของ Routing และการใส่ Area ที่ตรงส่วนของ Interface
Router R2 และ Router ABR2 มีการ Config แบบใส่ Area ตรงส่วนของ Routing รูปแบบ Config ตามด้านล่าง ในรูปแบบนี้ต้องศึกษาเรื่องของ Network IP และค่า Wildcard Mask ต้องใส่ค่าให้ถูกต้องโดยต้องมีค่าตรงกันกับ Router ฝั่งตรงข้าม
R2(config)#router ospf 2
R2(config-router)#network 10.10.10.8 0.0.0.3 area 0
R2(config-router)#network 1.1.1.1 0.0.0.0 area 1
R2(config-router)#network 10.10.10.4 0.0.0.3 area 1
ABR2(config)#router ospf 1
ABR2(config-router)#network 10.10.10.8 0.0.0.3 area 0
ABR2(config-router)#network 2.2.2.2 0.0.0.0 area 0
ABR2(config-router)#network 172.17.1.0 0.0.0.3 area 2
Router R1 และ SW-L3 มีการ Config แบบใส่เลข Process-ID และ Area ไว้ที่ Interface รูปแบบ Config ตามด้านล่าง
R1(config)#router ospf 4
R1(config-router)#router-id 4.4.4.4
R1(config-router)#exit
R1(config)#interface s0/0
R1(config-if)#ip ospf 4 area 1
R1(config-if)#exit
R1(config)#interface f0/0
R1(config-if)#ip ospf 4 area 1
R1(config-if)#exit
R1(config)#interface loopback 0
R1(config-if)#ip ospf 4 area 1
SW-L3(config)#ip routing
SW-L3(config)#router ospf 3
SW-L3(config-router)#router-id 3.3.3.3
SW-L3(config-router)#exit
SW-L3(config)#interface g0/0
SW-L3(config-if)#ip ospf 3 area 2
SW-L3(config-if)#exit
SW-L3(config)#interface loopback 0
SW-L3(config-if)#ip ospf 3 area 2
SW-L3(config-if)#exit
SW-L3(config)#interface vlan 20
SW-L3(config-if)#ip ospf 3 area 2
SW-L3(config-if)#exit
ตรวจสอบ Routing Table ของ SW-L3 จะได้ตามด้านล่าง
ตรวจสอบ Routing Table ของ Router ABR2 จะได้ตามด้านล่าง
ตรวจสอบ Routing Table ของ Router R2 จะได้ตามด้านล่าง
ตรวจสอบ Routing Table ของ Router R1 จะได้ตามด้านล่าง
ดูตัวอย่างวีดีโอ OSPF Interface และ Network type ได้ตามด้านล่าง
VIDEO
ดูวีดีโอเพิ่มเติมเกี่ยวกับ OSPF ได้ ที่ Playlist ด้านล่าง
https://www.youtube.com/watch?v=7JM52rYkU2w&list=PLxTcKTJPFY7NganNB0R3PpvfbbtHQJ5JO
หวังว่าบทความนี้คงจะก่อให้เกิดประโยชน์ไม่มากก็น้อยสำหรับผู้ที่ทำงานอยู่ในแวดวงไอทีนะครับ
ขอบคุณครับ
-------------------------------------------------------------------------------------------------------
บทความ Network
บทความ Linux
บทความ Certificate