# packet-trace

&#x20;

CLI arayüzünde packet-trace, ağ trafiğini yakalayan ve analiz eden bir CLI komutudur. Bu komutu kullanarak şağıdaki işlemleri yapabilirsiniz:&#x20;

1. Ağ trafiğini dinleme: packet-trace, ağ trafiğini dinleyerek paketleri yakalar. Bu özellik, ağda gerçekleşen işlemleri anlamak için oldukça yararlıdır.&#x20;
2. Filtrasyon: packet-trace, ağ trafiğini filtreleyebilir, bu da ilgili bilgiyi bulmayı kolaylaştırır. Örneğin, yalnızca belirli bir IP adresinden veya belirli bir porttan gelen trafiği yakalayabilirsiniz.&#x20;

Önerilen kullanım:&#x20;

`packet-trace -s 246 -nettti pflog0`&#x20;

-s parametresi, "-s" ardından belirtilen sayısal değer ile belirtilir ve her bir yakalama işleminde o kadar byte'lık veri yakalayacak şekilde ayarlanır. Önerilen kullanım ilk 246 byte’lık veriyi incelemesi.&#x20;

-nettti parametreleri içerisinde, \
"-n" parametresi, yakalanan paketlerin adres bilgilerini çözmeden önce direkt olarak IP adresleri ve port numaralarını göstermesini sağlar.  \
"-e" parametresi, olarak yakalanan her paketin link katmanı bilgilerinin, yani kaynak ve hedef MAC adreslerinin, çıktıda görüntülenmesini sağlar&#x20;

“-ttt” parametresi,  pakete ait tarihin ay ve gün değerlerinin yazılmasını sağlar.&#x20;

&#x20;

&#x20;

Filtreleme ifadeleri:&#x20;

1- Belirli bir Interface’i dinlemek:&#x20;

`packet-trace  -i [interface adı]` &#x20;

&#x20;

-i parametresinden sonra show ip address çıktısındaki interface isimleri kullanılabilir. Ethernet interface içinse cihazın modeline göre interface’e karşılık gelen interface adı kullanılmalıdır. Listeye [buradan](https://docs.google.com/spreadsheets/d/1G-K4RXDkj5Gh4sbl5NSf5UabAC06E-0jajl3owMdctA/edit?usp=sharing) ulaşılabilir. Örnek olarak SDX 200 cihazdaki 1/1/1 interface’den akan trafiği görmek için em2 interface dinlenmelidir.  \
&#x20;\
Ek olarak pflog0 interface kullanılarakfirewall üzerinden geçen trafik incelenebilir. &#x20;

`packet-trace -s 246 -nettti em2`&#x20;

&#x20;

`packet-trace -s 246 -nettti pflog0`&#x20;

&#x20;\
`packet-trace -s 246 -nettti wireguard1`&#x20;

&#x20;

`packet-trace -s 246 -nettti pppoe0`&#x20;

&#x20;

Bundan sonraki örneklerin tamamı pflog0 için verilmiştir ama tüm interfaceler için kullanılabilir.&#x20;

&#x20;

2- Belirli bir IP adresini dinlemek&#x20;

`packet-trace -s 246 -nettti pflog0 src host [IP]`&#x20;

&#x20;

`packet-trace -s 246 -nettti pflog0 dst host [IP]`&#x20;

&#x20;

`packet-trace -s 246 -nettti pflog0 host [IP]`&#x20;

&#x20;

3- Belirli bir network’ü dinlemek&#x20;

`packet-trace -s 246 -nettti pflog0 src net [IP/netmask]`&#x20;

&#x20;

`packet-trace -s 246 -nettti pflog0 dst net [IP/netmask]`&#x20;

&#x20;

`packet-trace -s 246 -nettti pflog0 net [IP/netmask]`&#x20;

&#x20;

4-  Belirli bir portu dinlemek&#x20;

`packet-trace -s 246 -nettti pflog0 src port [Port]`&#x20;

&#x20;

`packet-trace -s 246 -nettti pflog0 dst port [Port]`&#x20;

&#x20;

`packet-trace -s 246 -nettti pflog0 port [Port]`&#x20;

&#x20;

5- Block/Pass durumunu incelemek&#x20;

`packet-trace -s 246 -nettti pflog0 action block`&#x20;

&#x20;

`packet-trace -s 246 -nettti pflog0 action pass`&#x20;

! Eğer Firewall konfigürasyonunda block-log seçili değilse block paketleri görüntülenemez.&#x20;

&#x20;

Örnek komutlar:&#x20;

&#x20;

`packet-trace -s 246 -nettti pflog0 action block` &#x20;

`tcpdump: listening on pflog0, link-type PFLOG`&#x20;

`Apr 28 11:11:55.746301 rule 32/(match) block in on vport10: 172.16.10.22.48804 > 172.217.169.202.443: udp 1250 (DF)`&#x20;

`Apr 28 11:11:55.751898 rule 32/(match) block in on vport10: 172.16.10.22.48027 > 172.217.169.202.443: udp 1250 (DF)`&#x20;

`Apr 28 11:11:55.752060 rule 32/(match) block in on vport10: 172.16.10.22.48027 > 172.217.169.202.443: udp 78 (DF)`&#x20;

`Apr 28 11:11:56.026966 rule 33/(match) block in on vport1010: 172.16.20.67.62450 > 108.177.126.127.19302: udp 20 (DF)`&#x20;

`Apr 28 11:11:56.026974 rule 33/(match) block in on vport1010: 172.16.20.67.57187 > 108.177.126.127.19302: udp 20 (DF)`&#x20;

`Apr 28 11:11:56.081534 rule 32/(match) block in on vport10: 172.16.10.22.48027 > 172.217.169.202.443: udp 1250 (DF)`&#x20;

`Apr 28 11:11:56.718381 rule 32/(match) block in on vport10: 172.16.10.22.48027 > 172.217.169.202.443: udp 1250 (DF)`&#x20;

`Apr 28 11:11:57.101503 rule 32/(match) block in on vport1010: 172.16.20.112.57120 > 172.217.17.98.443: udp 1250 (DF)`&#x20;

&#x20;

Bu komut sayesinde Firewall tarafından yasaklanan paketler gözlemlenebilir.&#x20;

Belirli bir IP adresi için Müşteri’den şikayet geldiyse aşağıdaki komut ile kontrol sağlanabilir.&#x20;

`packet-trace -s 246 -nettti pflog0 host 172.16.10.22 and action block`&#x20;

&#x20;

Eğer müşteri belirli bir port için şikayette bulunduysa aşağıdaki komut ile kontrol sağlanabilir.&#x20;

`packet-trace -s 246 -nettti pflog0 port 443 and action block`&#x20;

&#x20;\
`packet-trace -s 246 -nettti pflog0 port 443 and host 172.16.10.22 and action block`&#x20;

&#x20;

&#x20;

Müşteri belirttiği bir IP adresinin ulaşamadığı bir IP adresiyle ilgili şikayette bulunduysa aşağıdaki komut ile kontrol sağlanabilir.&#x20;

`packet-trace -s 246 -nettti pflog0 src host 172.16.20.108 and dst host 192.168.2.15`&#x20;

`tcpdump: listening on pflog0, link-type PFLOG`&#x20;

`Apr 28 11:35:47.753853 rule 233/(match) pass in on vport1010: 172.16.20.108.59778 > 192.168.2.15.53: S 1176922325:1176922325(0) win 64240 <mss 1460,nop,wscale 8,nop,nop,sackOK> (DF)`&#x20;

`Apr 28 11:35:47.753875 rule 234/(match) pass out on ix2: 172.16.20.108.59778 > 192.168.2.15.53: S 1176922325:1176922325(0) win 64240 <mss 1440,nop,wscale 8,nop,nop,sackOK>`&#x20;

`Apr 28 11:35:47.754369 rule 233/(match) pass in on vport1010: 172.16.20.108.59779 > 192.168.2.15.53: S 2079198765:2079198765(0) win 64240 <mss 1460,nop,wscale 8,nop,nop,sackOK> (DF)`&#x20;

`Apr 28 11:35:47.754389 rule 234/(match) pass out on ix2: 172.16.20.108.59779 > 192.168.2.15.53: S 2079198765:2079198765(0) win 64240 <mss 1440,nop,wscale 8,nop,nop,sackOK>`&#x20;

&#x20;

`packet-trace -s 246 -nettti pflog0 src host 192.168.100.2 and dst host 192.168.200.2 and port 3389`&#x20;

&#x20;

&#x20;

pppoe konfigürasyonu ardından istekleri görmek için aşağıdaki komut ile kontrol sağlanabilir.&#x20;

`packet-trace -s 246 -nettti pppoe1`&#x20;

`tcpdump: listening on pppoe1, link-type PPP_ETHER`&#x20;

`Apr 28 11:34:12.716422 PPPoE` &#x20;

&#x20;       `code Session, version 1, type 1, id 0x0002, length 208`&#x20;

&#x20;       `IP 78.189.128.229.62574 > 156.146.52.79.443: P 3167199570:3167199736(166) ack 3765448387 win 257 (DF)`&#x20;

`Apr 28 11:34:12.735011 PPPoE` &#x20;

&#x20;       `code Session, version 1, type 1, id 0x0002, length 42`&#x20;

&#x20;       `IP 156.146.52.79.443 > 78.189.128.229.62574: R 3765448387:3765448387(0) win 0 (DF)`&#x20;

`Apr 28 11:34:12.745846 PPPoE` &#x20;

&#x20;       `code Session, version 1, type 1, id 0x0002, length 54`&#x20;

&#x20;       `IP 78.189.128.229.57951 > 156.146.52.79.443: S 3213496475:3213496475(0) win 64240 <mss 1440,nop,wscale 8,nop,nop,sackOK>`&#x20;

`Apr 28 11:34:12.765121 PPPoE` &#x20;

&#x20;       `code Session, version 1, type 1, id 0x0002, length 54`&#x20;

&#x20;       `IP 156.146.52.79.443 > 78.189.128.229.57951: S 3034040611:3034040611(0) ack 3213496476 win 64240 <mss 1460,nop,nop,sackOK,nop,wscale 7> (DF)`&#x20;

`Apr 28 11:34:12.766684 PPPoE` &#x20;

&#x20;       `code Session, version 1, type 1, id 0x0002, length 42`&#x20;

&#x20;       `IP 78.189.128.229.57951 > 156.146.52.79.443: . ack 1 win 258`&#x20;

`Apr 28 11:34:12.772256 PPPoE` &#x20;

&#x20;       `code Session, version 1, type 1, id 0x0002, length 316`&#x20;

&#x20;       `IP 78.189.128.229.57951 > 156.146.52.79.443: P 1:275(274) ack 1 win 258`&#x20;

`Apr 28 11:34:12.791311 PPPoE` &#x20;

&#x20;       `code Session, version 1, type 1, id 0x0002, length 42`&#x20;

&#x20;       `IP 156.146.52.79.443 > 78.189.128.229.57951: . ack 275 win 501 (DF)`&#x20;

`Apr 28 11:34:12.794759 PPPoE` &#x20;

&#x20;       `code Session, version 1, type 1, id 0x0002, length 1482`&#x20;

&#x20;       `IP 156.146.52.79.443 > 78.189.128.229.57951: . 1:1441(1440) ack 275 win 501 (DF)`&#x20;

`Apr 28 11:34:12.794873 PPPoE` &#x20;

&#x20;       `code Session, version 1, type 1, id 0x0002, length 1218`&#x20;

&#x20;       `IP 156.146.52.79.443 > 78.189.128.229.57951: P 1441:2617(1176) ack 275 win 501 (DF)`&#x20;

`Apr 28 11:34:12.796973 PPPoE` &#x20;

&#x20;       `code Session, version 1, type 1, id 0x0002, length 42`&#x20;

&#x20;       `IP 78.189.128.229.57951 > 156.146.52.79.443: . ack 2617 win 258`&#x20;

&#x20;

Wireguard'da yaşanılan bir problemin ardından trafiğin tünel üzerinden geçtiği kontrol etmek için aşağıdaki komut ile kontrol sağlanabilir.&#x20;

`packet-trace -s 246 -nettti wireguard1` &#x20;

`tcpdump: listening on wg1001, link-type LOOP`&#x20;

`Apr 28 11:33:28.013565 192.168.1.71.51343 > 192.168.2.16.1433: . 3137710953:3137710954(1) ack 2808572988 win 1026`&#x20;

`Apr 28 11:33:28.014155 192.168.2.16.1433 > 192.168.1.71.51343: . ack 1 win 515 <nop,nop,sack 1 {0:1} >`&#x20;

`Apr 28 11:33:28.015462 192.168.1.50.7100 > 192.168.2.5.20514: udp 172 [tos 0x10]`&#x20;

`Apr 28 11:33:28.017306 192.168.2.5.20514 > 192.168.1.50.7100: udp 172 [tos 0x10]`&#x20;

`Apr 28 11:33:28.027587 192.168.1.45.49768 > 192.168.2.17.891: P 3382178351:3382178560(209) ack 2913514546 win 1022`&#x20;

`Apr 28 11:33:28.028157 192.168.2.17.891 > 192.168.1.45.49768: P 1:284(283) ack 209 win 515`&#x20;

`Apr 28 11:33:28.029477 192.168.1.45.49768 > 192.168.2.17.891: . ack 284 win 1021`&#x20;

`Apr 28 11:33:28.035437 192.168.1.50.7100 > 192.168.2.5.20514: udp 172 [tos 0x10]`&#x20;

`Apr 28 11:33:28.037359 192.168.2.5.20514 > 192.168.1.50.7100: udp 172 [tos 0x10]`&#x20;

`Apr 28 11:33:28.048245 192.168.2.23.5247 > 192.168.1.36.5264: udp 954`&#x20;

&#x20;

&#x20;

&#x20;


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.targitas.com/targitas-kullanim-rehberi/targitas-cli-arayuzune-giris/cli-temel-komutlari/packet-trace.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
