Skip to content
Snippets Groups Projects
Commit a7a542ec authored by Markus Gothe's avatar Markus Gothe :ok_hand:
Browse files

base-files: Add hotplug-scripts for WG offloading.

parent 0d8287b7
Branches
Tags
1 merge request!1390base-files: Add hotplug-scripts for WG offloading.
Pipeline #195304 skipped
#!/bin/sh
[ "$PROTOCOL" = "wireguard" ] || exit 0
[ "$ACTION" = "post-setup" -o "$ACTION" = "pre-teardown" ] || exit 0
[ -n "$INTERFACE" ] || exit 0
readonly LISTEN_PORT="$(wg show "${INTERFACE}" listen-port)"
[ -n "$LISTEN_PORT" ] || exit 0
[ "$ACTION" = "post-setup" ] && CMD=add || CMD=del
/userfs/bin/ppemgr localin $CMD dport $((LISTEN_PORT))
#!/bin/sh
[ "$PROTOCOL" = "wireguard" ] || exit 0
[ "$ACTION" = "pre-setup" -o "$ACTION" = "post-teardown" ] || exit 0
[ -n "$INTERFACE" ] || exit 0
if [ "$ACTION" = "pre-setup" ]; then
iptables -w -D input_rule -i "${INTERFACE}" -j SKIPLOG > /dev/null 2>&1
iptables -w -I input_rule -i "${INTERFACE}" -j SKIPLOG
ip6tables -w -D input_rule -i "${INTERFACE}" -j SKIPLOG > /dev/null 2>&1
ip6tables -w -I input_rule -i "${INTERFACE}" -j SKIPLOG
iptables -w -D forwarding_rule -i "${INTERFACE}" -j SKIPLOG > /dev/null 2>&1
iptables -w -I forwarding_rule -i "${INTERFACE}" -j SKIPLOG
ip6tables -w -D forwarding_rule -i "${INTERFACE}" -j SKIPLOG > /dev/null 2>&1
ip6tables -w -I forwarding_rule -i "${INTERFACE}" -j SKIPLOG
iptables -w -D output_rule -o "${INTERFACE}" -j SKIPLOG > /dev/null 2>&1
iptables -w -I output_rule -o "${INTERFACE}" -j SKIPLOG
ip6tables -w -D output_rule -o "${INTERFACE}" -j SKIPLOG > /dev/null 2>&1
ip6tables -w -I output_rule -o "${INTERFACE}" -j SKIPLOG
iptables -w -D forwarding_rule -o "${INTERFACE}" -j SKIPLOG > /dev/null 2>&1
iptables -w -I forwarding_rule -o "${INTERFACE}" -j SKIPLOG
ip6tables -w -D forwarding_rule -o "${INTERFACE}" -j SKIPLOG > /dev/null 2>&1
ip6tables -w -I forwarding_rule -o "${INTERFACE}" -j SKIPLOG
else
iptables -w -D input_rule -i "${INTERFACE}" -j SKIPLOG > /dev/null 2>&1
ip6tables -w -D input_rule -i "${INTERFACE}" -j SKIPLOG > /dev/null 2>&1
iptables -w -D forwarding_rule -i "${INTERFACE}" -j SKIPLOG > /dev/null 2>&1
ip6tables -w -D forwarding_rule -i "${INTERFACE}" -j SKIPLOG > /dev/null 2>&1
iptables -w -D output_rule -o "${INTERFACE}" -j SKIPLOG > /dev/null 2>&1
ip6tables -w -D output_rule -o "${INTERFACE}" -j SKIPLOG > /dev/null 2>&1
iptables -w -D forwarding_rule -o "${INTERFACE}" -j SKIPLOG > /dev/null 2>&1
ip6tables -w -D forwarding_rule -o "${INTERFACE}" -j SKIPLOG > /dev/null 2>&1
fi
fcctl flush
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment