Using Curl to test port connectivity in VMware vCenter Server Appliance
search cancel

Using Curl to test port connectivity in VMware vCenter Server Appliance

book

Article ID: 316607

calendar_today

Updated On:

Products

VMware vCenter Server

Issue/Introduction

When troubleshooting vSphere Replication, it is often necessary to troubleshoot port connectivity as common Windows utilities are not available. Curl is available in the VMware vCenter Server Appliance command line interface. This article provides a simple example of using Curl to simulate a telnet connection with verbose output. This article also provides you a way to test Port connectivity if they are not running vCenter Server on windows and running the vCenter Server Appliance instead.

Symptoms:
  • Unable to test port connectivity for connections originating from the VMware vCenter Server Appliance
  • Cannot test port connectivity for connections originating from the VMware vCenter Server Appliance
  • Testing port connectivity for connections originating from the VMware vCenter Server Appliance fails


Environment

VMware vCenter Server 7.0.x
VMware vCenter Server Appliance 6.5.x
VMware vCenter Server Appliance 6.0.x
VMware vCenter Server Appliance 6.7.x

Resolution

To test port connectivity in VMware vCenter Server Appliance:
  1. Log in as root user through the VMware vCenter Server Appliance console.
  2. Run this command on the vCenter Server Appliance:
curl -v telnet://target ip address:desired port number

When the vCenter Server Appliance connects successfully or fails, you see output similar to:

GOOD output

root@vc7 [ ~ ]# curl -v telnet://127.0.0.1:22
* Rebuilt URL to: telnet://127.0.0.1:22/
*   Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to 127.0.0.1 (127.0.0.1) port 22 (#0)
SSH-2.0-OpenSSH_7.8
^C

root@vc7 [ ~ ]# curl -v telnet://127.0.0.1:23
* Rebuilt URL to: telnet://127.0.0.1:23/
*   Trying 127.0.0.1...
* TCP_NODELAY set
* connect to 127.0.0.1 port 23 failed: Connection refused
* Failed to connect to 127.0.0.1 port 23: Connection refused
* Closing connection 0
curl: (7) Failed to connect to 127.0.0.1 port 23: Connection refused

Note: To test port connectivity in VMware vCenter Server Appliance with a Proxy, run:
curl -v -x proxy:port -U "username:password" telnet://target ip address:desired port number

 
 


Additional Information

You can also test port connectivity in VMware Workspace Portal 2.x using curl with the same steps above.
Curl を使用した VMware vCenter Server Appliance のポート接続のテスト
在 VMware vCenter Server Appliance 中使用 Curl 测试端口连接