Port Mirroring

Port Mirroring (Port İkizleme), bir switch üzerindeki bir porttan gelen trafiği başka bir porta kopyalamak için kullanılır. Bu, genel olarak sunucu gibi cihazların trafiğini izlemek ve analiz etmek için kullanılır.

“Cisco Packet Tracer” üzerinde bir uygulama gerçekleştirelim.

Screenshot 2024 06 28 230233

Topolojimizde bir adet sunucumuz var. Bu sunucuya gelen trafiği port ikizleme ile “FastEthernet 0/1” portuna kopyalayacağız.

Switch#en
Switch(config)# monitor session 1 source interface FastEthernet 0/2 ( Kaynak Port )
Switch(config)# monitor session 1 destination interface FastEthernet 0/1 ( Hedef Port FastEthernet 0/2 bu porta kopyalanacak. )
Switch(config)# do wri

*** "session" numarası, "destination" ve "source" cihaz için aynı olmalıdır.

Bu örnekte, “FastEthernet 0/2” portuna gelen ve çıkan trafik “FastEthernet 0/1” portuna kopyalanacaktır. Cihazımıza kurduğumuz bir ağ trafik analiz yazılımı ile trafiği izleyebiliriz. Bu yazılıma örnek olarak “Wireshark” verilebilir.

Belirli bir port aralığını da kopyalayabiliriz.

Switch#en
Switch(config)# monitor session 1 source interface FastEthernet 0/14 - 23
Switch(config)# monitor session 1 destination interface FastEthernet 0/1
Switch(config)# do wri

Bu örnekte, “FastEthernet 0/14” ile “FastEthernet 0/23” (dahil) arasındaki portların trafiği “FastEthernet 0/1” portuna kopyalanacaktır.

Switch#en
Switch(config)# monitor session 1 source interface FastEthernet 0/10 , FastEthernet 0/17
Switch(config)# monitor session 1 destination interface FastEthernet 0/1
Switch(config)# do wri

Bir başka örneğimizde, “FastEthernet 0/10” ve “FastEthernet 0/17” portlarının trafiği “FastEthernet 0/1” portuna kopyalanacaktır.

Bu işlemi “VLAN” için de uygulamak mümkündür.

Switch#en
Switch(config)# monitor session 1 source vlan 10 ( VLAN 10 da bulunan cihazların trafiği kopyalanacaktır. ) 
Switch(config)# monitor session 1 destination FastEthernet 0/1
Switch(config)# do wri

Sadece gelen veya giden trafiği de kopyalayabiliriz. Örneğin, gelen trafiği bir porta, giden trafiği başka bir porta kopyalayabiliriz.

Switch#en
Switch(config)# monitor session 1 source interface FastEthernet 0/24 rx ( Receive --> Gelen ) 
Switch(config)# monitor session 1 destination interface FastEthernet 0/1
Switch(config)#
Switch(config)# monitor session 2 source interface FastEthernet 0/24 tx ( Transmit --> İletilen )
Switch(config)# monitor session 2 destination interface FastEthernet 0/2

Bu örnekte, “FastEthernet 0/24” portuna gelen trafik “FastEthernet 0/1” portuna kopyalanacaktır. “FastEthernet 0/24” portundan çıkan trafik ise “FastEthernet 0/2” portuna kopyalanacaktır.

Yaptığımız konfigürasyonu görüntülemek için aşağıdaki kontrol komutunu kullanabiliriz.

Switch# show monitor session all
Screenshot 2024 06 28 233409

Oluşturduğumuz konfigürasyonları silmek için aşağıdaki komutu kullanabiliriz.

Switch(config)# no monitor 1 source interface FastEthernet 0/24
Switch(config)# no monitor 1 destination interface FastEthernet 0/1

Daha fazla bilgisayar-ağları içeriği için takipte kalın…

About Hüseyin Pala 156 Articles
Junior Network Specialist

Be the first to comment

Leave a Reply

Your email address will not be published.


*