星期一, 4月 22, 2024

Wireshark相關教學

 

  • Q:winshrek 提示 The capture file appears to be damaged or corrupt.(pcap: File has 2608985148-byte packet, bigger than maximum of262144)
    A:這個錯誤提示是因為Winshark讀取的擷取檔案中存在一個非常大的資料包,而這個資料包大小超過了Winshark預設允許的最大大小(262144位元組)。因此,Winshark無法正確讀取並分析這個捕獲檔案。
    解決方案是使用其他工具來開啟這個捕獲文件,並尋找和刪除該非常大的資料包。例如,您可以使用Wireshark的命令列版本tshark來檢查擷取檔案:
    tshark -r capture.pcap -qz io,stat,0,"SUM(frame.len)frame.len>1000000"
    手動刪除這些資料包或使用tshark過濾它們並建立一個新的、不包含這些資料包的擷取檔案:
    tshark -r capture.pcap -w new_capture.pcap not frame[0] >1000000
    這將建立一個名為new​​_capture.pcap的新文件
    參考:https://kernel.0voice.com/forum.php?mod=viewthread&tid=3951





星期五, 6月 24, 2022

Juniper Ex3400 簡易指令操作方式

Operational Mode and Configuration Mode

(ref User Guide P.26)

Operational Mode 

---JUNOS 17.2B1.8 built 2018-05-09 23:41:29 UTC
% cli
user@host> 

Configuration Mode
type the configure command or the edit command in CLI or Operational Mode

user@host> configure
Entering configuration mode
[edit]
user@host# 

 exit Configuration Mode and return to Operational Mode 
  • To commit the configuration and exit:
[edit]
user@host# commit and-quit
commit complete
Exiting configuration mode
user@host>
  • To exit without committing
[edit]
user@host# exit
Exiting configuration mode
user@host>


編輯某一區段

edit 

移到上一層

up

移到最上層

top

刪除該區段的指令

delete

增加該段的設定

set

執行前check

commit check

執行所有設定

commit


How to reboot (restart), halt, or shut down the EX Series switch

Power off:關機同時關閉電源,會送一個ACPI訊號通知系統關機

halt:關機但不關閉電源,需手動關閉電池

To Power Off the switch from CLI:

    user@switch>request system power-off

To halt the switch from CLI:

    user@switch> request system halt

To restart the switch from the CLI:

     user@switch> request system reboot


如何監看網路界面的的流量

  user@switch> monitor interface traffic


設定switch ex的第1埠 mirror到第7埠


{master:0}

admin@CSES_EX3400> configure

Entering configuration mode


{master:0}[edit]

admin@CSES_EX3400# edit forwarding-options analyzer


{master:0}[edit forwarding-options analyzer]

admin@CSES_EX3400# edit tap-srx

tap-srx=>名稱自訂

admin@CSES_EX3400# set input ingress interface ge-0/0/1


{master:0}[edit forwarding-options analyzer tap-srx]

admin@CSES_EX3400# set input egress interface ge-0/0/1


{master:0}[edit forwarding-options analyzer tap-srx]

admin@CSES_EX3400# show

input {

    ingress {

        interface ge-0/0/1.0;

    }

    egress {

        interface ge-0/0/1.0;

    }

}


{master:0}[edit forwarding-options analyzer tap-srx]


{master:0}[edit forwarding-options analyzer tap-srx]

admin@CSES_EX3400# set output interface ge-0/0/7


{master:0}[edit forwarding-options analyzer tap-srx]

admin@CSES_EX3400# show

input {

    ingress {

        interface ge-0/0/1.0;

    }

    egress {

        interface ge-0/0/1.0;

    }

}

output {

    interface ge-0/0/7.0;

}

{master:0}[edit forwarding-options analyzer tap-srx]

admin@CSES_EX3400# commit and-quit

configuration check succeeds

commit complete

Exiting configuration mode


{master:0}

admin@CSES_EX3400>







  user@switch> monitor interface traffic

看ge/0/0/1及ge/0/0/7的流量是否一致