Standalone debug options
Show current IPv4 and IPv6 default gateway and interface towards the gateway (if the protocol in question is enabled).Syntax:For IPv4 it looks for a 0.0.0.0/0 route, or the specified IPv4 address if the target can be parsed as an IPv4 address.For IPv6 this queries the route towards ::/128, or the specified IPv6 target address if the argument is an IPv6 address.
Adding a target is helpful for diagnostics to see if OpenVPN will do the right thing if there are more specific IPv4/IPv6 routes to a VPN server.
Buffer and queue options
These options are used for special tweaking, often when debugging or testing special usage scenarios.Set the TCP/UDP socket receive buffer size.Defaults to operating system default.
This option can be useful for improving throughput on high-latency or high-bandwidth connections.
Set the TCP/UDP socket send buffer size.Defaults to operating system default.
This option can be useful for improving throughput on high-latency or high-bandwidth connections.
Allocate n buffers for broadcast datagrams.Default: 256 buffers
Maximum number of output packets queued before TCP.When OpenVPN is tunneling data from a TUN/TAP device to a remote client over a TCP connection, it is possible that the TUN/TAP device might produce data at a faster rate than the TCP connection can support.When the number of output packets queued before sending to the TCP socket reaches this limit for a given client connection, OpenVPN will start to drop outgoing packets directed at this client.Default: 64 packets
Set the TX queue length on the TUN/TAP interface. Linux only.Currently defaults to operating system default.
This option only works on Linux systems.
Hash table sizing
Set the size of the real address hash table to r and the virtual address table to v.Syntax:By default, both tables are sized at 256 buckets.Example:
Bandwidth and traffic shaping
Limit bandwidth of outgoing tunnel data to n bytes per second on the TCP/UDP port.OpenVPN uses the following algorithm to implement traffic shaping: Given a shaper rate of n bytes per second, after a datagram write of b bytes is queued on the TCP/UDP port, wait a minimum of (b / n) seconds before queuing the next write.OpenVPN allows n to be between 100 bytes/sec and 100 Mbytes/sec.
OpenVPN supports multiple tunnels between the same two peers, allowing you to construct full-speed and reduced bandwidth tunnels at the same time, routing low-priority data such as off-site backups over the reduced bandwidth tunnel.
Persistence options
Preserve initially resolved local IP address and port number across
SIGUSR1 or --ping-restart restarts.This option helps maintain connection stability when the local network configuration changes.
Preserve most recently authenticated remote IP address and port number across SIGUSR1 or
--ping-restart restarts.This option is useful when dealing with peers that may change their IP address due to DHCP or other dynamic addressing.
Data channel offload
Disables the opportunistic use of data channel offloading if available.Without this option, OpenVPN will opportunistically use DCO mode if the config options and the running kernel supports using DCO.On platforms that do not support DCO,
Data channel offload currently requires data-ciphers to only contain AEAD ciphers (AES-GCM and Chacha20-Poly1305) and Linux with the ovpn-dco module.
--disable-dco has no effect.Examples
High-performance configuration
High-performance configuration
- Increases socket buffers to 512 KB
- Doubles the TCP queue limit
- Disables DCO for maximum compatibility
- Suitable for high-speed connections
Bandwidth-limited connection
Bandwidth-limited connection
- Limits bandwidth to 125,000 bytes/sec (1 Mbps)
- Reduces MTU to prevent latency issues
- Adjusts MSS fix accordingly
- Suitable for rate-limited connections
Large-scale server deployment
Large-scale server deployment
- Increases hash table sizes for better performance
- Allocates more broadcast buffers
- Increases TCP queue limit
- Suitable for high-capacity servers
Mobile client with unstable IP
Mobile client with unstable IP
- Preserves IP addresses across restarts
- Allows remote IP to change
- Restarts connection if ping fails
- Suitable for mobile clients
Diagnostic and troubleshooting
Diagnostic and troubleshooting
- Show default gateways for IPv4 and IPv6
- Test routing to specific IPv4 target
- Test routing to specific IPv6 target
- Useful for diagnosing routing issues
Best practices
When to use these options:
- Buffer options (
--rcvbuf,--sndbuf): High-bandwidth or high-latency connections - Hash sizing (
--hash-size): Servers with many concurrent connections (100+) - Traffic shaping (
--shaper): Bandwidth-constrained environments - DCO disable (
--disable-dco): Compatibility issues or when using incompatible options - Persistence options: Mobile clients or dynamic IP environments
Platform-specific considerations:
--txqueuelenis Linux-only- DCO (Data Channel Offload) requires Linux kernel support
- Some options may have different effects on different operating systems
- Always test on target platforms before deployment
Performance tuning process:
- Establish baseline performance metrics
- Identify bottlenecks (bandwidth, latency, CPU)
- Apply one change at a time
- Measure impact of each change
- Document successful optimizations
- Monitor long-term stability