deploy/native/firewall.sh reads the server interfaces and applies, for traffic from the VPN network to all other networks: masquerade, TCP MSS clamping (path MTU tuning) and TTL tuning, in its own table `ip ovpmon`. Rules are persisted in /etc/ovpmon/nftables.nft and loaded at boot by the ovpmon-nft service (systemd and OpenRC). Opt-in: install.sh and update.sh do not call it. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
30 lines
853 B
Plaintext
Executable File
30 lines
853 B
Plaintext
Executable File
#!/sbin/openrc-run
|
|
# managed by ovpmon deploy/native (firewall.sh replaces this file only while this marker line is present)
|
|
#
|
|
# Loads the nftables rules of the VPN clients (masquerade, TCP MSS clamp, TTL) at boot, OpenRC (Alpine).
|
|
# Install: `deploy/native/firewall.sh` renders this script into /etc/init.d/ovpmon-nft, adds it to the default
|
|
# runlevel and starts it. Independent of the distribution's nftables service: only the table `ip ovpmon`
|
|
# is loaded and removed. Guide: DOCS/Deployment/Scenario2_System_Services.md
|
|
|
|
name="ovpmon-nft"
|
|
description="NAT, MSS and TTL rules for the VPN clients (nftables)"
|
|
|
|
rules="/etc/ovpmon/nftables.nft"
|
|
|
|
depend() {
|
|
need localmount
|
|
before net
|
|
}
|
|
|
|
start() {
|
|
ebegin "Loading $rules"
|
|
nft -f "$rules"
|
|
eend $?
|
|
}
|
|
|
|
stop() {
|
|
ebegin "Removing the table ip ovpmon"
|
|
nft delete table ip ovpmon 2>/dev/null
|
|
eend 0
|
|
}
|