簡介
本文檔介紹在Secure Web Appliance(SWA)中測試Internet連線的步驟。
必要條件
需求
思科建議瞭解以下主題:
採用元件
本文件所述內容不限於特定軟體和硬體版本。
本文中的資訊是根據特定實驗室環境內的裝置所建立。文中使用到的所有裝置皆從已清除(預設)的組態來啟動。如果您的網路運作中,請確保您瞭解任何指令可能造成的影響。
捲曲
步驟1.登入到SWA的CLI。
步驟2.鍵入curl,然後按Enter鍵。
步驟3.選擇DIRECT,以測試SWA Internet訪問,而不對流量應用任何代理策略。
步驟4.鍵入「y」作為Do you wish to choose specific interface of appliance?並按Enter鍵。
步驟5.輸入與能訪問Internet的介面關聯的編號。
步驟6.輸入用於測試的URL並按Enter鍵。
附註:確保URL以HTTP://或HTTPS://開頭
SWA_CLI> curl
Choose the operation you want to perform:
- DIRECT - URL access going direct
- APPLIANCE - URL access through the Appliance
[]> DIRECT
Do you wish to choose particular interface of appliance?
[N]> y
1. Management
2. P1
3. P2
Enter the interface number:
[1]> 3
Enter URL to make request to
[]> http://www.cisco.com
驗證
您可以檢視HTTP響應代碼。在本示例中,HTTP響應代碼為200,這意味著已建立連線。
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 015:34:55.026472 * Trying 10.18.27.120:80...
15:34:55.026645 * Local Interface nic0 is ip 10.1.1.1 using address family 2
15:34:55.026676 * Local port: 0
15:34:55.035164 * Connected to www.cisco.com (10.18.27.120) port 80 (#0)
15:34:55.035202 > HEAD / HTTP/1.1
15:34:55.035202 > Host: www.cisco.com
15:34:55.035202 > User-Agent: curl/7.74.0
15:34:55.035202 > Accept: */*
15:34:55.035202 >
15:34:55.056382 * Mark bundle as not supporting multiuse
15:34:55.056397 < HTTP/1.1 200 OK
15:34:55.056429 < Date: Thu, 19 Mar 2026 19:34:54 GMT
15:34:55.056451 < Content-Type: text/html
15:34:55.056474 < Connection: keep-alive
15:34:55.056490 < CF-RAY: 9deeead18c0b253f-ORD
15:34:55.056515 < Last-Modified: Wed, 18 Mar 2026 19:14:43 GMT
15:34:55.056538 < Allow: GET, HEAD
15:34:55.056562 < Accept-Ranges: bytes
15:34:55.056583 < Age: 2119
15:34:55.056606 < cf-cache-status: HIT
15:34:55.056619 < Server: cloudflare
15:34:55.056639 <
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
15:34:55.056723 * Connection #0 to host www.cisco.com left intact
在此範例中,您可以看到SWA無法存取URL。
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 015:38:29.520762 * Trying 10.18.27.120:443...
15:38:29.520927 * Trying 10.18.26.120:443...
15:38:29.521068 * Closing connection 0
curl: (7) Couldn't connect to server
SSLTOOL
ssltool是openssl s_client命令的CLI版本。它直接使用SSL/TLS連線到遠端主機,而不使用安全Web裝置代理策略。
步驟1.登入到SWA的CLI。
步驟2.鍵入ssltool並按Enter鍵。
步驟3.鍵入CLIENT並按Enter鍵
步驟4.鍵入COMMAND並按Enter鍵。
提示:可以鍵入HELP並按Enter閱讀有關此命令的更多資訊。
步驟5.輸入您的openssl命令並按Enter鍵。
SWA_CLI> ssltool
Choose the operation you want to perform:
- SCLIENT - This is CLI version of openssl s_client command. It will connect to a remote host using SSL/TLS directly without using Secure Web Appliance
- CLEARLOGS - Delete all logs generated by ssltool
[]> SCLIENT
Choose the operation you want to perform:
- COMMAND - Execute an openssl s_client command
- HELP - Help information about this command
[]> COMMAND
Enter an openssl command for example: 'openssl s_client -connect www.cisco.com:443' or hit enter to go back
[]>
Telnet
註:telnet命令已從SWA版本15.0及更新版本中刪除。
步驟1.登入到SWA的CLI。
步驟2.鍵入telnet並按Enter鍵。
步驟3.鍵入與可以訪問Internet的介面關聯的編號。
步驟4.輸入遠端主機名或IP地址。
步驟5.在Enter the remote port的答案中鍵入80或443,以測試與遠端主機的HTTP或HTTPS埠的TCP連線。
步驟6.要退出telnet,請按住Control鍵並按] 。
SWA_CLI> telnet
Please select which interface you want to telnet from.
1. Auto
2. Management (10.48.48.183/24: man-wsa125.amojarra.local)
3. P1 (10.10.10.10/24: p1-wsa125.amojarra.local)
4. P2 (10.20.20.20/24: p2-wsa125.amojarra.local)
[1]>4
Enter the remote hostname or IP address.
[]> cisco.com
Enter the remote port.
[23]> 8443
Trying 10.20.3.15...
Connected to 10.20.3.15.
Escape character is '^]'.
相關資訊