bundlewrap/bundles/pppd/files/ip-up
Franzi 2b06c77439
All checks were successful
kunsi/bundlewrap/pipeline/head This commit looks good
bundles/pppd: allow dynamic configuration of nftables rules
2021-12-14 16:18:11 +01:00

19 lines
415 B
Bash

#!/bin/bash
INTERFACE=$1
echo "add rule nat postrouting oif $INTERFACE masquerade" > /etc/nftables-rules.d/90-pppd
% for rule in sorted(nftables):
echo "add rule ${rule}" >> /etc/nftables-rules.d/90-pppd
% endfor
echo "net.ipv6.conf.$INTERFACE.accept_ra=2" > /etc/sysctl.d/90-pppd.conf
if systemctl is-active nftables;
then
systemctl reload nftables
else
systemctl restart nftables
fi
rdisc6 $INTERFACE