Endurance

Layer 4

Layer 4 Settings

Updated

Settings that apply to the whole subsystem rather than to one object.

Settings

replicationActive is read-only: whether nfpersistsync runs on this node now. It can be false while replicationEnabled is true, when the Service IP is mapped on this node only, or no Layer 4 Frontend exists yet; the reason is logged on each apply. When it turns true, pins are replicated once the pending nfscheduler restart (shown under System services) is applied.

GET /ipvsDirector/settings

curl
curl -X GET "https://appliance.example.com/api/v1/ipvsDirector/settings" \
  -H "Authorization: Bearer $TOKEN"
PHP
<?php

$url = 'https://appliance.example.com/api/v1/ipvsDirector/settings';
$headers = [
    'Authorization: Bearer ' . $token,
];

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_RETURNTRANSFER => true,
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Python
import requests

headers = {"Authorization": f"Bearer {token}"}

response = requests.get("https://appliance.example.com/api/v1/ipvsDirector/settings", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/ipvsDirector/settings', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${token}`,
  },
});

const data = await response.json();
Bruno
meta {
  name: Get the Layer 4 settings
  type: http
  seq: 1
}

get {
  url: https://{{node-0}}:{{port}}/api/v1/ipvsDirector/settings
  body: none
  auth: bearer
}

auth:bearer {
  token: {{token}}
}
Response
{
  "status": "success",
  "message": "Settings retrieved successfully",
  "data": {
    "checkInterval": "5",
    "checkTimeout": "3",
    "failureCount": 2,
    "quiescent": false,
    "autonatInterface": "",
    "autonatRestrict": "none",
    "autonatSubnet": "",
    "replicationEnabled": true,
    "replicationServiceIp": "5e1de37819dd5",
    "replicationPort": 3781,
    "replicationActive": true
  }
}

Only the fields sent are changed. A request with any field refused is refused whole, and nothing in it is saved. replicationActive is reported by GET and ignored here. negotiateTimeout, tcpFinTimeout and udpTimeout were removed: they were validated and stored, and never applied. Connection state timeouts are appliance-wide rather than Layer 4 settings and live on system/conntrack; there were never any negotiate health checks to time out, since Layer 4 health checks are external programs timed by checkTimeout. Sending them is harmless — they are ignored.

PUT /ipvsDirector/settings

This change is staged. Send PUT /services/apply to apply it.

Body parameters
checkInterval string default: "5"

How long to wait between health checks. A whole number of seconds, or a single time carrying a unit (s or m) such as 1m, between 1 and 60 seconds. The value is echoed back exactly as it was sent.

checkTimeout string default: "3"

How long a health check may take before it is aborted. Same form and bounds as checkInterval, and must not exceed it.

failureCount integer default: "2"

The number of failures before a real server is marked down.

quiescent boolean default: "false"

Drain instead of Halting Real Servers that fail health checks.

autonatInterface string

Interface whose outgoing traffic has its source address rewritten, so a Real Server using this appliance as its gateway can reach a network beyond it. Empty turns autonat off. The interface need not exist yet: the rule matches on the name and does nothing until a device of that name appears.

autonatRestrict default: "none" none | real_servers | subnet | exclude_local

Which traffic leaving the interface is rewritten. none is everything; real_servers only traffic from a Real Server the load balancer holds; subnet only traffic from autonatSubnet; exclude_local everything except traffic this appliance originates. A restriction narrows what is rewritten and never where traffic goes.

autonatSubnet string

Source prefix in CIDR notation, required when autonatRestrict is subnet and refused otherwise. Its address family also selects which table the rule is written to.

replicationEnabled boolean default: false

Whether Layer 4 persistence is replicated between the nodes. Turning it off keeps replicationServiceIp, so it can be turned back on as it was. Enabling it needs a replicationServiceIp that exists, on a replicationPort no other service uses. Setup turns it on; an upgraded appliance starts with it off. Unlike conntrack’s replication, a Service IP alone does not turn it on: while it is off, a replicationServiceIp sent without replicationEnabled is refused.

replicationServiceIp ['string', 'null']

The id of the Service IP that Layer 4 persistence is replicated over, or null for none; the empty string clears it, which needs replicationEnabled false. Each node sends and receives on its own Static IP of this Service IP, so replication runs only where the Service IP is mapped on more than one node, and only while a Layer 4 Frontend exists. Setup sets it to the Service IP it creates.

replicationPort integer default: 3781

The UDP port Layer 4 persistence is replicated on, an integer. While replication is enabled it must be free on this node’s Static IP of the Service IP.

curl
curl -X PUT "https://appliance.example.com/api/v1/ipvsDirector/settings" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "checkInterval": "5",
  "checkTimeout": "3",
  "failureCount": "2",
  "quiescent": "false",
  "autonatInterface": "<autonatInterface>",
  "autonatRestrict": "none",
  "autonatSubnet": "<autonatSubnet>",
  "replicationEnabled": false,
  "replicationServiceIp": "<replicationServiceIp>",
  "replicationPort": 3781
}'
PHP
<?php

$url = 'https://appliance.example.com/api/v1/ipvsDirector/settings';
$headers = [
    'Authorization: Bearer ' . $token,
    'Content-Type: application/json',
];

$payload = [
    'checkInterval' => '5',
    'checkTimeout' => '3',
    'failureCount' => '2',
    'quiescent' => 'false',
    'autonatInterface' => '<autonatInterface>',
    'autonatRestrict' => 'none',
    'autonatSubnet' => '<autonatSubnet>',
    'replicationEnabled' => false,
    'replicationServiceIp' => '<replicationServiceIp>',
    'replicationPort' => 3781,
];

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'PUT',
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POSTFIELDS => json_encode($payload),
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Python
import requests

headers = {"Authorization": f"Bearer {token}"}
payload = {
    "checkInterval": "5",
    "checkTimeout": "3",
    "failureCount": "2",
    "quiescent": "false",
    "autonatInterface": "<autonatInterface>",
    "autonatRestrict": "none",
    "autonatSubnet": "<autonatSubnet>",
    "replicationEnabled": false,
    "replicationServiceIp": "<replicationServiceIp>",
    "replicationPort": 3781
}

response = requests.put("https://appliance.example.com/api/v1/ipvsDirector/settings", headers=headers, json=payload)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/ipvsDirector/settings', {
  method: 'PUT',
  headers: {
    Authorization: `Bearer ${token}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
  "checkInterval": "5",
  "checkTimeout": "3",
  "failureCount": "2",
  "quiescent": "false",
  "autonatInterface": "<autonatInterface>",
  "autonatRestrict": "none",
  "autonatSubnet": "<autonatSubnet>",
  "replicationEnabled": false,
  "replicationServiceIp": "<replicationServiceIp>",
  "replicationPort": 3781
}),
});

const data = await response.json();
Bruno
meta {
  name: Update the Layer 4 settings
  type: http
  seq: 1
}

put {
  url: https://{{node-0}}:{{port}}/api/v1/ipvsDirector/settings
  body: json
  auth: bearer
}

headers {
  Content-Type: application/json
}

auth:bearer {
  token: {{token}}
}

body:json {
  {
    "checkInterval": "5",
    "checkTimeout": "3",
    "failureCount": "2",
    "quiescent": "false",
    "autonatInterface": "<autonatInterface>",
    "autonatRestrict": "none",
    "autonatSubnet": "<autonatSubnet>",
    "replicationEnabled": false,
    "replicationServiceIp": "<replicationServiceIp>",
    "replicationPort": 3781
  }
}
Response
{
  "status": "success",
  "message": "Settings updated successfully",
  "data": []
}