GNS3 Kullanarak Cisco Router Üzerinde OSPF Yapılandırma
OSPF (Open Shortest Path First – İlk Açık Yöne Öncelik) yönlendirme protokolü Dynamic Routing protokolüdür. Bu algoritma protokolü, Dijkstra algoritmasını kullanarak herhangi bir ağ değişikliğinde yönlendirme rotalarını yeniden hesaplar.
Cisco Router Üzerinde OSPF Nasıl Yapılandırılır?
OSPF yönlendirme protokolü AS (Autonomous System) numaraları kullanarak ağ üzerinde ek olarak bir güvenlik sağlar. Aynı AS numarası ile yapılandırılmış Router‘lar birbirleriyle haberleşebilmektedir. Buna ek olarak, örneğin AS 1 alanındaki Router’lar AS 2 alanındaki Router’lar ile iletişim kurabilir.
AS içindeki her bir Router bütün ağ topoloji bilgisine sahiptirler. Dolayısıyla hedefe giden iyi yolu kolayca belirleyebilirler.
OSPF ile EIGRP protokolü her ne kadar birbirine benzesede aralarındaki en büyük fark, EIGRP protokolünün yalnızca Cisco cihazlara özgü bir yönlendirme protokolüdür.
Önceki yazımızda, OSPF Protokolü hakkında detaylı bilgiler verdik. Bu yazımızda, GNS3 ağ simulatör programında Router’lar üzerinde OSPF yönlendirme protokolünü etkinleştirerek iki farklı ağı haberleştireceğiz.
OSPF Konfigürasyonu
Yapılandırma adımlarına geçmeden önce, Cloud bilgisayar ekleme adımlarını gerçekleştiriniz. Daha sonra, ağ topoloji için iki adet VMware sanal makine hazırlayınız.
Adım 1
Yönlendirme protokolü için GNS3 programını başlatınız ve yeni bir proje oluşturunuz.
Adım 2
Aşağıdaki görüntüdeki gibi bir ağ topolojisi oluşturunuz ve ayrıca, çalışma alanına açıklamalar ekleyerek ağ topolojisini daha anlaşılabilir yapınız.
Adım 3
VMware sanallaştırma programında iki adet sanal makine oluşturunuz. Sanal makine VMnet ayarlarını gerçekleştiriniz.
Aşağıdaki gibi Windows 8.1 sanal makine ağ kartı ayarı olarak VMnet1’i seçiniz ve devam ediniz.
Adım 4
Aynı şekilde Windows 10 sanal makine ağ kartı ayarı olarakta VMnet2’yi seçiniz.
Adım 5
VMware Virtual Network Editör (Sanal Ağ Editörü) üzerinde VMnet ayarlarını kontrol ediniz.
Adım 6
Daha sonra, VMware sanal makineleri çalıştırınız ve ağ topolojisinde belirtilen ağ adreslerine göre TCP/IP ayarlarını yapınız.
Adım 7
Windows 10 sanal makine TCP/IP ayarları da aşağıdaki gibidir.
Adım 8
Ağ topolojisine göre Cisco Router R1‘in FastEthernet ve Serial arayüzlerini yapılandırınız.
R1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#
R1(config)#interface fastethernet 0/0
R1(config-if)#ip address 192.168.5.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#exit
R1(config)#
*Mar 1 00:10:50.427: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
*Mar 1 00:10:51.427: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R1(config)#
R1(config)#interface serial 0/0
R1(config-if)#ip address 10.1.1.1 255.255.255.252
R1(config-if)#no shutdown
R1(config-if)#end
R1#
Cisco Router R1 üzerinde show ip interface brief komutunu kullanarak arayüz durumlarını kontrol edebilirsiniz.
R1#show ip int br
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 192.168.5.1 YES manual up up
Serial0/0 10.1.1.1 YES manual up up
FastEthernet0/1 unassigned YES unset administratively down down
Serial0/1 unassigned YES unset administratively down down
R1#
Adım 9
Aynı şekilde Cisco Router R2‘in de FastEthernet ve Serial arayüzlerini yapılandırınız.
R2#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R2(config)#
R2(config)#interface fastethernet 0/1
R2(config-if)#ip address 192.168.10.1 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#exit
R2(config)#
*Mar 1 00:12:31.055: %LINK-3-UPDOWN: Interface FastEthernet0/1, changed state to up
*Mar 1 00:12:32.055: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up
R2(config)#
R2(config)#interface serial 0/1
R2(config-if)#ip address 10.1.1.2 255.255.255.252
R2(config-if)#no shutdown
R2(config-if)#end
R2#
Cisco Router R2 arayüzlerin durumunu aşağıdaki gibi kontrol edebilirsiniz.
R2#show ip int br
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 unassigned YES unset administratively down down
Serial0/0 unassigned YES unset administratively down down
FastEthernet0/1 192.168.10.1 YES manual up up
Serial0/1 10.1.1.2 YES manual up up
R2#
Adım 10
Windows 8.1 sanal makineden Router R1 ve R2’nin FastEthernet ve Serial arayüzlerine Ping atarak bağlantıyı test ediniz.
Adım 11
Aynı işlemleri Windows 10 makineden gerçekleştiriniz. Karşı ağa Ping işlemi aşağıdaki gibi başarısız olacaktır.
Adım 12
OSPF etkinleştirmek için Cisco Router R1 CLI komut istemini açınız ve aşağıdaki komutları sırasıyla uygulayınız.
R1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#
R1(config)#router ospf 10
R1(config-router)#network 192.168.5.0 ?
A.B.C.D O-S-P-F wild card bits
R1(config-router)#network 192.168.5.0 0.0.0.255 ?
area Set the O-S-P-F area ID
R1(config-router)#network 192.168.5.0 0.0.0.255 area ?
O-S-P-F area ID as a decimal value
A.B.C.D O-S-P-F area ID in IP address format
R1(config-router)#network 192.168.5.0 0.0.0.255 area 0
R1(config-router)#network 10.1.1.0 0.0.0.3 area 0
R1(config-router)#end
R1#
Adım 13
Router2 üzerinde OSPF etkinleştirmek için aşağıdaki komutları uygulayınız.
R2#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R2(config)#
R2(config)#router ospf 10
R2(config-router)#network 192.168.10.0 0.0.0.255 area 0
R2(config-router)#network 10.1.1.0 0.0.0.3 area 0
R2(config-router)#
*Mar 1 00:18:09.227: %O-S-P-F-5-ADJCHG: Process 10, Nbr 192.168.5.1 on Serial0/1 from LOADING to FULL, Loading Done
R2(config-router)#end
R2#
Adım 14
Router’lar üzerinde OSPF etkinleştirdikten sonra, Router R1 ve R2 üzerinde show ip route komutunu uygulayınız ve rota kayıtlarını inceleyiniz.
Cisco Router R1 yönlendirme tablosu;
R1#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - O-S-P-F, IA - O-S-P-F inter area
N1 - O-S-P-F NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - O-S-P-F external type 1, E2 - O-S-P-F external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
O 192.168.10.0/24 [110/74] via 10.1.1.2, 00:01:02, Serial0/0
C 192.168.5.0/24 is directly connected, FastEthernet0/0
10.0.0.0/30 is subnetted, 1 subnets
C 10.1.1.0 is directly connected, Serial0/0
R1#
Cisco Router R2 yönlendirme tablosu;
R2#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - O-S-P-F , IA - O-S-P-F inter area
N1 - O-S-P-F NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - O-S-P-F external type 1, E2 - O-S-P-F external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
C 192.168.10.0/24 is directly connected, FastEthernet0/1
O 192.168.5.0/24 [110/74] via 10.1.1.1, 00:01:02, Serial0/1
10.0.0.0/30 is subnetted, 1 subnets
C 10.1.1.0 is directly connected, Serial0/1
R2#
Adım 15
Router’lar üzerinde OSPF protokolünü ayarladıktan sonra şimdi sanal makinelerden birbirlerine Ping atarak ağ bağlantısını test ediniz.
Windows 8.1 makineden Windows 10 makineye Ping işlemi aşağıdaki gibi başarılı olacaktır!
Adım 16
Windows 10’dan Windows 8.1’ye de Ping işlemi aşağıdaki gibi başarılı olacaktır.
Adım 17
OSPF işlemini tamamladık ve sanal makineler arasındaki bağlantıyı da sınadıktan sonra, Router’lar üzerinde show komutlarını inceleyelim.
Cisco Router R1 show komutları aşağıdaki gibidir.
R1#show ip ospf ?
Process ID number
border-routers Border and Boundary Router Information
database Database summary
flood-list Link state flood list
interface Interface information
max-metric Max-metric origination information
mpls MPLS related information
neighbor Neighbor list
request-list Link state request list
retransmission-list Link state retransmission list
sham-links Sham link information
statistics Various O-S-P-F Statistics
summary-address Summary-address redistribution Information
timers O-S-P-F timers information
traffic Traffic related statistics
virtual-links Virtual link information
| Output modifiers
Örnek olarak show ip ospf neighbor ve show ip ospf database show komutlarını inceyebilirsiniz.
Adım 18
Cisco Router R2 üzerinde de show komutu çıktılarını inceleyebilirsiniz.
Adım 19
Router’lar üzerinde OSPF yönlendirme protokolünü doğrulamak için debug ip ospf hello komutunu kullanabilirsiniz.
Router R1 üzerinde debug ip ospf hello komutu çıktılarını aşağıdaki görüntüden inceleyebilirsiniz.
R1#debug ip ospf ?
adj O-S-P-F adjacency events
database-timer O-S-P-F database timer
events O-S-P-F events
flood O-S-P-F flooding
hello O-S-P-F hello events
lsa-generation O-S-P-F lsa generation
mpls O-S-P-F MPLS
nsf O-S-P-F non-stop forwarding events
packet O-S-P-F packets
retransmission O-S-P-F retransmission events
spf O-S-P-F spf
tree O-S-P-F
database tree
OSPF yönlendirme prokolü hello paketlerini Multicast (224.0.0.5) adresine göndermektedir.
Adım 20
Router R2 üzerinde de debug ip ospf hello komutunu uygulayınız. Aşağıdaki görüntüden hello paketlerini görebilirsiniz.
Adım 21
OSPF yapılandırmasını doğrulamanın diğer bir yolu da Wireshark programını kullanmaktır. Router’lar arasındaki Serial kablo üzerinde Sağ Tuş / Start Capture seçeneğine tıklayınız.
Adım 22
Packet Capture penceresinde, OK (Tamam) butonuna tıklayarak devam ediniz.
Adım 23
GNS3’te Wireshark programı açıldı ve aşağıdaki görüntüdeki gibi Hello paketlerinin Multicast (224.0.0.5) adresi üzerinden gönderildiğini görebilirsiniz.
OSPF Yapılandırma Show Komutları
Router R1 Show Komutları
R1#show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
192.168.10.1 0 FULL/ - 00:00:32 10.1.1.2 Serial0/0
R1#
R1#show ip ospf database
O-S-P-F Router with ID (192.168.5.1) (Process ID 10)
Router Link States (Area 0)
Link ID ADV Router Age Seq# Checksum Link count
192.168.5.1 192.168.5.1 382 0x80000003 0x00832D 3
192.168.10.1 192.168.10.1 383 0x80000002 0x00B1F4 3
R1#
R1#debug ip ospf hello
O-S-P-F hello events debugging is on
R1#
*Mar 1 00:26:47.011: O-S-P-F: Send hello to 224.0.0.5 area 0 on Serial0/0 from 10.1.1.1
R1#
*Mar 1 00:26:48.939: O-S-P-F: Send hello to 224.0.0.5 area 0 on FastEthernet0/0 from 192.168.5.1
*Mar 1 00:26:49.267: O-S-P-F: Rcv hello from 192.168.10.1 area 0 from Serial0/0 10.1.1.2
*Mar 1 00:26:49.267: O-S-P-F: End of hello processing
R1#
*Mar 1 00:26:56.151: O-S-P-F: Rcv hello from 192.168.10.1 area 0 from Serial0/0 10.1.1.2
*Mar 1 00:26:56.151: O-S-P-F: End of hello processing
*Mar 1 00:26:57.011: O-S-P-F: Send hello to 224.0.0.5 area 0 on Serial0/0 from 10.1.1.1
R1#
*Mar 1 00:26:58.939: O-S-P-F: Send hello to 224.0.0.5 area 0 on FastEthernet0/0 from 192.168.5.1
R1#
R1#show running-config
Building configuration...
Current configuration : 1152 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R1
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
no ip icmp rate-limit unreachable
ip cef
!
!
no ip domain lookup
ip auth-proxy max-nodata-conns 3
ip admission max-nodata-conns 3
!
!
ip tcp synwait-time 5
!
!
!
interface FastEthernet0/0
ip address 192.168.5.1 255.255.255.0
duplex auto
speed auto
!
interface Serial0/0
ip address 10.1.1.1 255.255.255.252
clock rate 2000000
!
interface FastEthernet0/1
no ip address
shutdown
duplex auto
speed auto
!
interface Serial0/1
no ip address
shutdown
clock rate 2000000
!
router ospf 10
log-adjacency-changes
network 10.1.1.0 0.0.0.3 area 0
network 192.168.5.0 0.0.0.255 area 0
!
ip forward-protocol nd
!
!
no ip http server
no ip http secure-server
!
no cdp log mismatch duplex
!
!
control-plane
!
!
line con 0
exec-timeout 0 0
privilege level 15
logging synchronous
line aux 0
exec-timeout 0 0
privilege level 15
logging synchronous
line vty 0 4
login
!
!
end
R1#
Router R2 Show Komutları
R2#show ip ospf ?
Process ID number
border-routers Border and Boundary Router Information
database Database summary
flood-list Link state flood list
interface Interface information
max-metric Max-metric origination information
mpls MPLS related information
neighbor Neighbor list
request-list Link state request list
retransmission-list Link state retransmission list
sham-links Sham link information
statistics Various O-S-P-F Statistics
summary-address Summary-address redistribution Information
timers O-S-P-F timers information
traffic Traffic related statistics
virtual-links Virtual link information
| Output modifiers
R2#
R2#show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
192.168.5.1 0 FULL/ - 00:00:32 10.1.1.1 Serial0/1
R2#
R2#show ip ospf database
O-S-P-F Router with ID (192.168.10.1) (Process ID 10)
Router Link States (Area 0)
Link ID ADV Router Age Seq# Checksum Link count
192.168.5.1 192.168.5.1 419 0x80000003 0x00832D 3
192.168.10.1 192.168.10.1 418 0x80000002 0x00B1F4 3
R2#
R2#debug ip ospf ?
adj O-S-P-F adjacency events
database-timer O-S-P-F database timer
events O-S-P-F events
flood O-S-P-F flooding
hello O-S-P-F hello events
lsa-generation O-S-P-F lsa generation
mpls O-S-P-F MPLS
nsf O-S-P-F non-stop forwarding events
packet O-S-P-F packets
retransmission O-S-P-F retransmission events
spf O-S-P-F spf
tree O-S-P-F database tree
R2#
R2#debug ip ospf hello
OSPF hello events debugging is on
R2#
*Mar 1 00:27:32.383: O-S-P-F: Send hello to 224.0.0.5 area 0 on FastEthernet0/1 from 192.168.10.1
R2#
*Mar 1 00:27:36.975: O-S-P-F: Rcv hello from 192.168.5.1 area 0 from Serial0/1 10.1.1.1
*Mar 1 00:27:36.975: O-S-P-F: End of hello processing
R2#
*Mar 1 00:27:39.223: O-S-P-F: Send hello to 224.0.0.5 area 0 on Serial0/1 from 10.1.1.2
R2#
*Mar 1 00:27:42.383: O-S-P-F: Send hello to 224.0.0.5 area 0 on FastEthernet0/1 from 192.168.10.1
R2#
R2#show running-config
Building configuration...
Current configuration : 1154 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R2
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
no ip icmp rate-limit unreachable
ip cef
!
!
no ip domain lookup
ip auth-proxy max-nodata-conns 3
ip admission max-nodata-conns 3
!
!
ip tcp synwait-time 5
!
!
interface FastEthernet0/0
no ip address
shutdown
duplex auto
speed auto
!
interface Serial0/0
no ip address
shutdown
clock rate 2000000
!
interface FastEthernet0/1
ip address 192.168.10.1 255.255.255.0
duplex auto
speed auto
!
interface Serial0/1
ip address 10.1.1.2 255.255.255.252
clock rate 2000000
!
router ospf 10
log-adjacency-changes
network 10.1.1.0 0.0.0.3 area 0
network 192.168.10.0 0.0.0.255 area 0
!
ip forward-protocol nd
!
!
no ip http server
no ip http secure-server
!
no cdp log mismatch duplex
!
!
!
control-plane
!
!
!
line con 0
exec-timeout 0 0
privilege level 15
logging synchronous
line aux 0
exec-timeout 0 0
privilege level 15
logging synchronous
line vty 0 4
login
!
!
end
R2#
OSPF Konfigürasyonu ⇒ Video
OSPF etkinleştirmek ve doğrulamak için aşağıdaki videoyu izleyebilir ve ayrıca bize destek olmak için YouTube kanalımıza abone olabilirsiniz!
Son Söz
Bu yazımızda, GNS3 ağ simulatör programında OSPF Dynamic Routing prokolü konfigürasyonunu yapılandırdık. OSPF yönlendirme protokolünü temel olarak ele aldık.
Daha sonraki yazılarımızda gelişmiş ağ topolojilerini de yapılandıracağız. Bizi takip ettiğiniz için teşekkürler!
İlgili Yazılar
♦ GNS3 RIP Yapılandırma
♦ GNS3 Static Routing Yapılandırma
♦ GNS3 RIP Version 2 Yapılandırma
♦ GNS3 EIGRP Yapılandırma
♦ Cisco Static NAT Yapılandırma