Originally published on 2012-02-13; fully revised and updated.
If Perforce clients cannot connect (or connectivity is intermittent), you need to isolate whether the problem is on the server, the network path, name resolution, or endpoint policy. This runbook is for administrators and DevOps engineers who want a fast, repeatable troubleshooting sequence using core commands available on Windows, Linux, and macOS.

Quick troubleshooting workflow
Follow this order so you do not spend time on DNS or routing before confirming that the Perforce server is actually listening and accepting local connections.
flowchart TD
A[Client cannot connect to Perforce] --> B[On server: check port 1666 is listening]
B --> C{Listening on expected port}
C -- no --> D[Start or reconfigure p4d and P4PORT]
C -- yes --> E[Test local connection with p4 info]
E --> F{Local test succeeds}
F -- no --> D
F -- yes --> G[From client: ping and TCP port test]
G --> H{TCP port reachable}
H -- no --> I[Check firewall and network path]
H -- yes --> J[Check DNS resolution]
J --> K{Hostname and IP both work}
K -- no --> L[Fix DNS or host entry]
K -- yes --> M[Investigate intermittent latency or packet loss]
Step-by-step checks from host to network
1) Confirm the Perforce server is listening on the expected port
The original guidance checks for a listening socket on port 1666 (default in many deployments). If nothing is listening, clients cannot connect regardless of DNS or firewall state.
# Linux/macOS
netstat -an | grep 1666
ss -lntp | grep 1666
# Windows (Command Prompt)
netstat -a | findstr 1666Code language: PHP (php)
Look for a LISTEN state on the Perforce port you expect.
2) Verify local loopback connectivity from the server itself
This separates server process issues from network path issues.
p4 -p 127.0.0.1:1666 infoCode language: CSS (css)
If this fails on the server host, focus on the Perforce service and configuration before testing external clients.
3) Validate P4PORT configuration
The original post notes that setting P4PORT to localhost:1666 restricts access to local-only connections. Using 1666 makes the service listen on all interfaces.
# Windows service context (as shown in the original guidance)
p4 set -S Perforce P4PORT
p4 set -S Perforce P4PORT=1666
# Linux/macOS examples
export P4PORT=1666
p4d -r "$P4ROOT" -p 1666 [other flags]Code language: PHP (php)
4) Test client reachability (ICMP and TCP)
First verify basic network reachability, then verify the actual Perforce TCP port.
# From a client host
ping perforce-server
# TCP test
telnet perforce-server 1666
# or, if telnet is unavailable:
nc -vz perforce-server 1666Code language: PHP (php)
If ping fails, ICMP may be blocked or routing is broken. If ping works but TCP fails, investigate firewalls, port filters, security groups, or host-based ACLs.
5) Check firewall and port filtering policy
Ensure inbound TCP traffic to the Perforce port is allowed on the server side, and that outbound/return traffic is not blocked.
- Allow inbound TCP to port 1666 (or your configured Perforce port).
- Verify host firewall rules for the
p4dprocess or port-based policy. - On Windows, review Firewall Advanced Settings and Inbound Rules as noted in the original article.
6) Validate DNS resolution and compare hostname vs IP behavior
If hostname-based connection fails but direct IP works, the issue is likely DNS resolution or hostname spelling.
ping perforce.example.com
nslookup perforce.example.com
dig perforce.example.com
# Compare Perforce client behavior
p4 -p perforce.example.com:1666 info
p4 -p 192.0.2.10:1666 infoCode language: CSS (css)
7) Investigate routing and intermittent network problems
For intermittent failures, check route consistency, ARP behavior, and hop latency.
arp -a
route
# Path checks
tracert perforce-server # Windows
traceroute perforce-server # Linux/macOS
# Intermittency tools mentioned in original guidance
fping perforce-serverCode language: PHP (php)
Command comparison: what each test tells you
| Check | Command example | Success indicates | Failure often indicates |
|---|---|---|---|
| Server listening | netstat -an | grep 1666 | Perforce is bound to the expected TCP port | Service down or wrong bind configuration |
| Local Perforce handshake | p4 -p 127.0.0.1:1666 info | Server process can accept local client connections | Service/config/auth problem on server host |
| Basic reachability | ping perforce-server | Network path exists for ICMP | ICMP blocked or underlying network issue |
| TCP port reachability | telnet perforce-server 1666 | Perforce port is reachable from client network | Firewall/ACL/NAT/security policy block |
| Name resolution | nslookup perforce.example.com | Hostname resolves to expected IP | DNS or host entry mismatch |
| Path latency/hops | traceroute perforce-server | Reasonable route and hop latency | Congestion, routing asymmetry, upstream issues |
References
Primary reference from original post: http://kb.perforce.com/article/905
Original article permalink: https://www.devopsschool.com/blog/perforce-network-troubleshooting-hints/
Common pitfalls and best practices
- Do not skip local loopback testing; it quickly separates server-side and network-side failures.
- Avoid binding only to
localhostunless local-only access is intentional. - Test both hostname and IP to isolate DNS issues fast.
- Document the expected Perforce port and firewall rules in your runbooks.
- For intermittent issues, gather repeated path/latency data before changing server settings.
I’m Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have worked at Cotocus and regularly write about technology, travel, investing, health, product reviews, and digital marketing through my various platforms.
I publish technical articles at DevOps School, travel stories at Holiday Landmark, stock market insights at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at TrueReviewNow, and SEO and digital marketing strategies at Wizbrand.
Find Trusted Cardiac Hospitals
Compare heart hospitals by city and services — all in one place.
Explore Hospitals