簡介
本檔案介紹如何在思科電子郵件安全裝置(ESA)上設定和收集封包擷取,以便進行網路疑難排解。
採用元件
本文中的資訊是根據特定實驗室環境內的裝置所建立。文中使用到的所有裝置皆從已清除(預設)的組態來啟動。如果您的網路運作中,請確保您瞭解任何指令可能造成的影響。
重要風險和前提條件
- Packet capture命令可能導致ESA磁碟空間耗盡,並可能導致效能下降。
- 思科建議您僅在思科TAC工程師的協助下使用這些命令。
- 確保您對ESA的CLI或GUI具有管理訪問許可權。
背景資訊
思科技術支援可以要求您深入瞭解ESA的出站和入站網路活動。裝置能夠截獲和顯示通過裝置所連線的網路傳輸或接收的TCP、IP和其他資料包。運行資料包捕獲以調試網路設定或驗證到達或離開裝置的網路流量。
在AsyncOS上配置資料包捕獲
本節介紹封包擷取程式。
啟動或停止資料包捕獲
- 要從GUI開始資料包捕獲,請導航到右上角的幫助和支援選單,選擇Packet Capture,然後按一下Start Capture。
- 或者,按一下Edit Settings以指定要捕獲的IP地址和埠,然後按一下Submit。
- 可以使用CSV格式輸入埠號和IP地址(例如:80, 443)。 要捕獲ANY埠或IP,請將此欄位留空。
- 要停止資料包捕獲過程,請按一下Stop Capture。
- 在GUI中開始的捕獲會在會話之間保留。
- 要從CLI啟動資料包捕獲,請輸入packetcapture > start命令。
- 或者,使用setup命令指定要捕獲的IP地址和埠。
- 要停止資料包捕獲進程,請輸入packetcapture > stop命令。
- 會話結束時,ESA會停止資料包捕獲。
管理資料包捕獲
若要管理您的檔案,請在GUI中導覽至幫助和支援>Packet Capture。在此頁面上,您可以:
- 監視進度:檢視活動捕獲的即時統計資訊,包括當前檔案大小和已用時間。
- Download Files:選擇已完成的捕獲,然後單擊Download File將其儲存到本地電腦。
- 刪除檔案:要釋放空間,請選擇一個或多個檔案,然後按一下「刪除選定檔案」。
資料包捕獲限制
- 單例項:一次只能運行一個資料包捕獲。
- 介面獨立性:GUI和CLI在資料包捕獲方面獨立運行。GUI僅顯示和管理通過Web介面啟動的捕獲,而CLI僅顯示通過命令列啟動的捕獲的狀態。
對封包擷取的其他支援
有關詳細說明,請訪問AsyncOS聯機幫助:
- 導覽至Help and Support > Online Help。
- 搜尋封包擷取。
- 選擇運行資料包捕獲。
使用自定義資料包捕獲過濾器
本節提供有關自定義捕獲過濾器的資訊並提供示例。
以下是使用的標準篩選條件:
- ip — 所有IP通訊協定流量的過濾器
- tcp -所有TCP通訊協定流量的過濾器
- ip host -特定IP地址源或目標的過濾器
以下是使用中的篩選器的範例:
- ip host 10.1.1.1 — 此過濾器捕獲包括10.1.1.1作為來源或目的地的任何流量。
- ip host 10.1.1.1或ip host 10.1.1.2 — 此過濾器捕獲包含10.1.1.1或10.1.1.2作為源或目標的流量。
執行其他網路調查
下面描述的方法只能從CLI中使用。
TCPSERVICES
tcpservices命令顯示當前功能和系統進程的TCP/IP資訊。
example.com> tcpservices
System Processes (Note: All processes can not always be present)
ftpd.main - The FTP daemon
ginetd - The INET daemon
interface - The interface controller for inter-process communication
ipfw - The IP firewall
slapd - The Standalone LDAP daemon
sntpd - The SNTP daemon
sshd - The SSH daemon
syslogd - The system logging daemon
winbindd - The Samba Name Service Switch daemon
Feature Processes
euq_webui - GUI for ISQ
gui - GUI process
hermes - MGA mail server
postgres - Process for storing and querying quarantine data
splunkd - Processes for storing and querying Email Tracking data
COMMAND USER TYPE NODE NAME
postgres pgsql IPv4 TCP 127.0.0.1:5432
interface root IPv4 TCP 127.0.0.1:53
ftpd.main root IPv4 TCP 10.0.202.7:21
gui root IPv4 TCP 10.0.202.7:80
gui root IPv4 TCP 10.0.202.7:443
ginetd root IPv4 TCP 10.0.202.7:22
java root IPv6 TCP [::127.0.0.1]:18081
hermes root IPv4 TCP 10.0.202.7:25
hermes root IPv4 TCP 10.0.202.7:7025
api_serve root IPv4 TCP 10.0.202.7:6080
api_serve root IPv4 TCP 127.0.0.1:60001
api_serve root IPv4 TCP 10.0.202.7:6443
nginx root IPv4 TCP *:4431
nginx nobody IPv4 TCP *:4431
nginx nobody IPv4 TCP *:4431
java root IPv4 TCP 127.0.0.1:9999
NETSTAT
此實用程式顯示TCP(傳入和傳出)的網路連線、路由表以及許多網路介面和網路協定統計資訊。
example.com> netstat
Choose the information you want to display:
1. List of active sockets.
2. State of network interfaces.
3. Contents of routing tables.
4. Size of the listen queues.
5. Packet traffic information.
Example of Option 1 (List of active sockets)
Active Internet connections (including servers)
Proto Recv-Q Send-Q Local Address Foreign Address (state)
tcp4 0 0 10.0.202.7.10275 10.0.201.4.6025 ESTABLISHED
tcp4 0 0 10.0.202.7.22 10.0.201.4.57759 ESTABLISHED
tcp4 0 0 10.0.202.7.10273 a96-17-177-18.deploy.static.akamaitechnologies.com.80 TIME_WAIT
tcp4 0 0 10.0.202.7.10260 10.0.201.5.443 ESTABLISHED
tcp4 0 0 10.0.202.7.10256 10.0.201.5.443 ESTABLISHED
Example of Option 2 (State of network interfaces)
Show the number of dropped packets? [N]> y
Name Mtu Network Address Ipkts Ierrs Idrop Ibytes Opkts Oerrs Obytes Coll Drop
Data 1 - 10.0.202.0 10.0.202.7 110624529 - - 117062552515 122028093 - 30126949890 - -
Example of Option 3 (Contents of routing tables)
Routing tables
Internet:
Destination Gateway Flags Netif Expire
default 10.0.202.1 UGS Data 1
10.0.202.0 link#2 U Data 1
10.0.202.7 link#2 UHS lo0
localhost.example. link#4 UH lo0
Example of Option 4 (Size of the listen queues)
Current listen queue sizes (qlen/incqlen/maxqlen)
Proto Listen Local Address
tcp4 0/0/50 localhost.exampl.9999
tcp4 0/0/50 10.0.202.7.7025
tcp4 0/0/50 10.0.202.7.25
tcp4 0/0/15 10.0.202.7.6443
tcp4 0/0/15 localhost.exampl.60001
tcp4 0/0/15 10.0.202.7.6080
tcp4 0/0/20 localhost.exampl.18081
tcp4 0/0/20 10.0.202.7.443
tcp4 0/0/20 10.0.202.7.80
tcp4 0/0/10 10.0.202.7.21
tcp4 0/0/10 10.0.202.7.22
tcp4 0/0/10 localhost.exampl.53
tcp4 0/0/208 localhost.exampl.5432
Example of Option 5 (Packet traffic information)
input nic1 output
packets errs idrops bytes packets errs bytes colls drops
49 0 0 8116 55 0 7496 0 0
網路
diagnostic下的network子命令提供對其他選項的訪問。
使用此命令可刷新所有與網路相關的快取、顯示ARP快取的內容、顯示NDP快取的內容(如果適用),並使用SMTPING測試遠端SMTP連線。
example.com> diagnostic
Choose the operation you want to perform:
- RAID - Disk Verify Utility.
- DISK_USAGE - Check Disk Usage.
- NETWORK - Network Utilities.
- REPORTING - Reporting Utilities.
- TRACKING - Tracking Utilities.
- RELOAD - Reset configuration to the initial manufacturer values.
- SERVICES - Service Utilities.
[]> network
Choose the operation you want to perform:
- FLUSH - Flush all network related caches.
- ARPSHOW - Show system ARP cache.
- NDPSHOW - Show system NDP cache.
- SMTPPING - Test a remote SMTP server.
- TCPDUMP - Dump ethernet packets.
[]>
ETHERCONFIG
etherconfig命令可讓您檢視和設定與介面、VLAN、回送介面、MTU大小的雙工和MAC資訊相關的設定,以及接受或拒絕使用多點傳送位址的ARP回覆。
example.com> etherconfig
Choose the operation you want to perform:
- MEDIA - View and edit ethernet media settings.
- VLAN - View and configure VLANs.
- LOOPBACK - View and configure Loopback.
- MTU - View and configure MTU.
- MULTICAST - Accept or reject ARP replies with a multicast address.
[]>
TRACEROUTE
此命令顯示到遠端主機的網路路由。
如果在至少一個介面上配置了IPv6地址,請使用traceroute6命令。
example.com> traceroute google.com
Press Ctrl-C to stop.
traceroute to google.com (216.58.194.206), 64 hops max, 40 byte packets
1 68.232.129.2 (68.232.129.2) 0.902 ms
68.232.129.3 (68.232.129.3) 0.786 ms 0.605 ms
2 139.138.24.10 (139.138.24.10) 0.888 ms 0.926 ms 1.092 ms
3 68.232.128.2 (68.232.128.2) 1.116 ms 0.780 ms 0.737 ms
4 139.138.24.42 (139.138.24.42) 0.703 ms
208.90.63.209 (208.90.63.209) 1.413 ms
139.138.24.42 (139.138.24.42) 1.219 ms
5 svl-edge-25.inet.qwest.net (63.150.59.25) 1.436 ms 1.223 ms 1.177 ms
6 snj-edge-04.inet.qwest.net (67.14.34.82) 1.838 ms 2.086 ms 1.740 ms
7 108.170.242.225 (108.170.242.225) 1.986 ms 1.992 ms
108.170.243.1 (108.170.243.1) 2.852 ms
8 108.170.242.225 (108.170.242.225) 2.097 ms
108.170.243.1 (108.170.243.1) 2.967 ms 2.812 ms
9 108.170.237.105 (108.170.237.105) 1.974 ms
sfo03s01-in-f14.1e100.net (216.58.194.206) 2.042 ms 1.882 ms
PING
Ping允許您使用IP地址或主機名測試主機可達性,並提供與通訊中可能的延遲和丟棄相關的統計資訊。
example.com> ping google.com
Press Ctrl-C to stop.
PING google.com (216.58.194.206): 56 data bytes
64 bytes from 216.58.194.206: icmp_seq=0 ttl=56 time=2.095 ms
64 bytes from 216.58.194.206: icmp_seq=1 ttl=56 time=1.824 ms
64 bytes from 216.58.194.206: icmp_seq=2 ttl=56 time=2.005 ms
64 bytes from 216.58.194.206: icmp_seq=3 ttl=56 time=1.939 ms
64 bytes from 216.58.194.206: icmp_seq=4 ttl=56 time=1.868 ms
64 bytes from 216.58.194.206: icmp_seq=5 ttl=56 time=1.963 ms
--- google.com ping statistics ---
6 packets transmitted, 6 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 1.824/1.949/2.095/0.088 ms