Helix Core is now P4. Product user interfaces will be updated soon. Learn more >>

P4 CLI Reference | 2025.1

# P4PORT

For the the Perforce service (server, broker, or proxy), the port number to listen on and the transport protocol for binding.

For client applications, the protocol, host, and port number of the Perforce service with which to communicate. The most commonly-used communications protocols are `tcp` (plaintext over TCP/IP) or `ssl` (SSL/TLS over TCP/IP).

P4 Server supports connectivity over IPv6 networks as well as over IPv4 networks. You can specify whether to use IPv4 or IPv6 addresses when resolving hostnames. The protocol settings of `tcp4` and `ssl4` require IPv4 address support. Similarly, `tcp6` and `ssl6` require IPv6 support.

Using `tcp64` and `ssl64` attempts first to resolve the host to an IPv6 address, but will accept an IPv4 address if IPv6 is not available.

Using `tcp46` and `ssl46` defaults to IPv4, but uses IPv6 if IPv4 is unavailable.

To permit the operating system to automatically determine which transport to use, set the `net.rfc3484` configurable on user workstations or in `P4CONFIG` files.

Behavior and performance of networked services depend on:

- The networking capabilities of the machine that hosts the service.
- The operating systems used by the end users.
- Your specific LAN and WAN infrastructure, and the state of IPv6 support for every router between the end user and the P4 Server.

Suppose a user is working from home with an IPv6-based home network, but the ISP or VPN provider does not fully support IPv6. Variations of P4PORT provide flexibility and backwards compatibility for administrators and users during the transition from IPv4 to IPv6:

P4PORT protocol value | Behavior in IPv4/IPv6 or mixed networks
--- | ---
`<not set>` | Use `tcp4:` behavior, but if the address is numeric and contains two or more colons, assume `tcp6:` If the `net.rfc3484` configurable is set, allow the OS to determine which transport is used.
`tcp:` | Use `tcp4:` behavior, but if the address is numeric and contains two or more colons, assume `tcp6:` If the `net.rfc3484` configurable is set, allow the OS to determine which transport is used.
`tcp4:` | Listen on/connect to an IPv4 address/port only.
`tcp6:` | Listen on/connect to an IPv6 address/port only.
`tcp46:` | Attempt to listen/connect to an IPv4 address. If this fails, try IPv6.
`tcp64:` | Attempt to listen/connect to an IPv6 address. If this fails, try IPv4.
`ssl:` | Use `ssl4:` behavior, but if the address is numeric and contains two or more colons, assume `ssl6:` If the `net.rfc3484` configurable is set, allow the OS to determine which transport is used.
`ssl4:` | Listen on/connect to an IPv4 address/port only, using SSL/TLS encryption.
`ssl6:` | Listen on/connect to an IPv6 address/port only, using SSL/TLS encryption.
`ssl46:` | Listen on/connect to an IPv4 address/port. If that fails, try IPv6. After connecting, require SSL/TLS encryption.
`ssl64:` | Listen on/connect to an IPv6 address/port. If that fails, try IPv4. After connecting, require SSL/TLS encryption.

## Mixed network of IPV4 and IPV6

If the network has a mixture of IPV4 and IPV6, set the net.rfc3484 configurable to `1`:

    p4 configure set net.rfc3484=1

This ensures RFC3484-compliant behavior for users who do not explicitly specify the protocol value. This means the user’s operating system determines whether to use IPv4 or IPv6 transport for a given connection. This feature requires that `P4PORT` be set to one of the these formats:

- `example.com:1666`

- `tcp:example.com:1666`

- `ssl:example.com:1666`

## Certificates

The 2021.2 release and later handle certificates in a way that does not require p4 trust for SSL/TLS connects where the server provides a certificate that is not self-signed and can be verified by the client.

For self-signed certificates, unvalidated certificates, and clients prior to 2021.2, if you used SSL/TLS to connect to P4 Server, the fingerprint of the P4 Server needed to match the fingerprint was stored in the `P4TRUST` file. When you connected to a new P4 Server installation for the first time, the server’s fingerprint was displayed. If the displayed fingerprint matched the fingerprint your administrator had assigned, you could safely connect to the server by using the `p4 trust` command to add the server to your `P4TRUST` file.

## Usage notes

Used by Client? | Used by Server? | Command-Line Alternative | Can be set in P4CONFIG file?
--- | --- | --- | ---
Yes | Yes | `p4 -p protocol:host:port command` such as `p4 -p tcp64:perforce:1666 info` | Yes

## Value if not explicitly set

Program | Value
--- | ---
P4 Server | `1666`
P4 Proxy | `1666`
P4 CLI command-line client application | `perforce:1666`

## Examples

P4 Server application | Service
--- | ---
`1818` | `1818`
`ssl:squid:1234` | `ssl:1234`
`example.com:1234` | `1234`
`ssl:192.168.0.123:1818` | `ssl:1818`
`tcp6:[2001:db8::123]:1818` | `tcp6:[::]:1818`
`tcp6:example.com:1818` | `tcp6:[::]:1818`
`ssl64:[2001:db8::123]:1818` | `ssl6:[::]:1818ssl64:[::]:1818`

## Notes

The format of `P4PORT` for P4 Server applications is ``protocol`:`host`:`port``, or `port` by itself if both the P4 Server application and versioning service are running on the same host. Port numbers must be in the range `1024` through `32767`.

If you specify both an IP address and a port number in `P4PORT`, the P4 Server ignores requests from any IP addresses other than the one specified in `P4PORT`.

If you do not specify a protocol, transmissions between client applications and P4 Server are performed in plaintext and IPv4 addresses are assumed.

Your search for returned results