Table of Contents

Class OsOptions

Namespace
VpnHood.Core.Server.Access.Configurations
Assembly
VpnHood.Core.Server.Access.dll

Represents what the server sets on its machine's operating system, where it manages it (Linux).

public class OsOptions
Inheritance
OsOptions

Remarks

A setting left null takes its default, which the property of its name ending in Value gives. In JSON, the server's configuration names this group Os. The server changes the running OS only, so a restart of the machine puts back the OS's own values, and it makes no change without admin rights.

Properties

AddListenerIpsToNetwork

Gets or sets the network interface the server adds its TCP endpoints' addresses to where the system lacks them; null, empty or * for the first interface.

public string? AddListenerIpsToNetwork { get; set; }

Property Value

string

ConnectionTrackingMax

Gets or sets the most connections the OS tracks at once, as the server's NAT needs: a full table drops new connections, its clients' and its own. null for 1,048,576, and 0 to put back the OS's own where the server changed it; it never goes below the OS's own.

public int? ConnectionTrackingMax { get; set; }

Property Value

int?

ConnectionTrackingMaxValue

Gets ConnectionTrackingMax, or its default, 1,048,576.

[JsonIgnore]
public int ConnectionTrackingMaxValue { get; }

Property Value

int

ConnectionTrackingTcpIdleTimeout

Gets or sets how long the OS keeps tracking an established TCP connection that sends nothing, or null for 1 hour, and zero to put back the OS's own where the server changed it: Linux's 5 days fill the table, as many of a VPN's connections end without a close, such as when a phone changes networks.

[JsonConverter(typeof(TimeSpanConverter))]
public TimeSpan? ConnectionTrackingTcpIdleTimeout { get; set; }

Property Value

TimeSpan?

ConnectionTrackingTcpIdleTimeoutValue

Gets ConnectionTrackingTcpIdleTimeout, or its default, 1 hour.

[JsonIgnore]
public TimeSpan ConnectionTrackingTcpIdleTimeoutValue { get; }

Property Value

TimeSpan

SwapMemorySizeMb

Gets or sets the swap the server wants in all, in megabytes: its own swap file makes up what the system's other swap lacks, and null or 0 removes its own.

public int? SwapMemorySizeMb { get; set; }

Property Value

int?

TcpCongestionControl

Gets or sets the TCP congestion control the server sets on its OS, or null or * to put back the OS's own where the server changed it. The default is bbr.

public string? TcpCongestionControl { get; set; }

Property Value

string

TcpCongestionControlValue

Gets TcpCongestionControl, which has no default of its own here.

[JsonIgnore]
public string? TcpCongestionControlValue { get; }

Property Value

string

Methods

ApplyDefaults()

Sets each option left null to its default; the swap and interface settings stay as they are.

public void ApplyDefaults()

Merge(OsOptions)

Copies over these options each one another set sets; its default TcpCongestionControl is no setting.

public void Merge(OsOptions obj)

Parameters

obj OsOptions

The options that win where they are set.