En quoi pouvons-nous vous aider aujourd'hui ?

How to test if a TCP port is open or closed

Issue

When connecting to an Ethernet device or other computer, it responds to ping, but there is still a connection problem.

Cannot connect

Successful ping

Environment

Ethernet connections

PowerShell

Resolution

1. Open PowerShell.

2. Run the command below to test the port:

  • tnc <ip address> -port <port number>

For example, to test Modbus port 502 to an Ethernet-connected PM5500 with IP address 10.0.0.83:

  • tnc 10.0.0.83 -port 502

tnc command, pings but port is blocked

The result above indicates the IP address responds to ping, but doesn't respond over port 502.

To resolve, ensure the port is allowed/enabled:

  • In the computer's local firewall settings
  • In the network firewall between the computer and the device
  • In the device's settings

If the above is true and the tnc command still shows False for the port, confirm if the IP address is correct and whether the device supports the port/protocol you are testing.

Example test indicating the port is open:

tnc command port is open

Example test indicating the IP address isn't responding to ping:

tnc command no ping

Schneider Electric Belgium

  • Documentation produits
  • Téléchargement de logiciels
  • Sélecteur de produits
  • Substitution et remplacement de produits
  • Centre d'aide et de contact
  • Trouver nos sites
  • Obtenir un devis
  • Où acheter
  • Communauté Schneider Electric
  • Carrières
  • Qui sommes-nous ?
  • Signaler une mauvaise conduite
  • Accessibilité
  • Salle de presse
  • Partenaires
  • EcoStruxure
  • Nos emplois
  • Blog
  • Soyez informé des nouveautés en premier ?
  • Conditions générales d'affaires
  • Protection des données
  • Mention sur les cookies
  • Conditions d utilisation
  • Conditions générales de vente et d'achat
  • Change your cookie settings
  • Centre de Préférences