table of contents
- Tumbleweed 4.17.0+git5.e3a22113-1.1
- Leap-16.0
- Leap-15.6
| OCF_HEARTBEAT_PORTBL(7) | OCF resource agents | OCF_HEARTBEAT_PORTBL(7) |
NAME¶
ocf_heartbeat_portblock - Blocks and unblocks access to TCP and UDP ports
SYNOPSIS¶
portblock [start | stop | status | monitor | promote | demote | meta-data | validate-all]
DESCRIPTION¶
Resource script for portblock. It is used to block ports using nftables or iptables. In addition, it may allow for faster TCP reconnects for clients on failover. Use that if there are long lived TCP connections to an HA service. This feature is enabled by setting the tickle_dir parameter and only in concert with action set to unblock. Note that the tickle ACK function is new as of version 3.0.2 and hasn't yet seen widespread use.
In Promotable mode, the promote action unblocks the port(s) on the Promoted node and blocks the port(s) on the Unpromoted node(s) when action=unblock, and vice versa when action=block.
SUPPORTED PARAMETERS¶
firewall
(optional, string, default "auto")
protocol
(required, string, no default)
portno
(required, string, no default)
action
In Promotable mode it is the action for the promote action, and the opposite action will be used for the start and demote actions.
(required, string, no default)
method
(optional, string, default "drop")
status_check
(optional, string, default "rule")
reset_local_on_unblock_stop
An example would be the default NFS kernel server.
These "known" connections may seriously confuse and delay a later switchback.
Enabling this option will cause this agent to try to get rid of these connections by injecting a temporary iptables rule to TCP-reset outgoing packets from the blocked ports, and additionally tickle them locally, just before it starts to DROP incoming packets on "unblock stop".
(optional, boolean, default false)
ip
(optional, string, default "0.0.0.0/0")
tickle_dir
(optional, string, no default)
sync_script
(optional, string, no default)
direction
(optional, string, default "in")
SUPPORTED ACTIONS¶
This resource agent supports the following actions (operations):
start
stop
promote
demote
status
monitor
monitor (Promoted role)
meta-data
validate-all
EXAMPLE CRM SHELL¶
The following is an example configuration for a portblock resource using the crm(8) shell:
primitive p_portblock ocf:heartbeat:portblock \
params \
protocol=string \
portno=string \
action=string \
op monitor depth="0" timeout="10s" interval="10s" \
op monitor depth="0" timeout="10s" interval="9s" role="Promoted"
ms ms_portblock p_portblock \
meta notify="true" interleave="true"
EXAMPLE PCS¶
The following is an example configuration for a portblock resource using pcs(8)
pcs resource create p_portblock ocf:heartbeat:portblock \
protocol=string \
portno=string \
action=string \
op monitor OCF_CHECK_LEVEL="0" timeout="10s" interval="10s" \
op monitor OCF_CHECK_LEVEL="0" timeout="10s" interval="9s" role="Promoted" promotable
SEE ALSO¶
AUTHOR¶
ClusterLabs contributors (see the resource agent source for information about individual authors)
| 11/25/2025 | resource-agents UNKNOWN |