bundles/pppd: add iptables rules on ifup/ifdown

This commit is contained in:
Franzi 2020-11-13 23:04:43 +01:00
parent f65e216828
commit 870a5252e5
Signed by: kunsi
GPG key ID: 12E3D2136B818350
3 changed files with 20 additions and 0 deletions

View file

@ -0,0 +1,5 @@
#!/bin/bash
rm /etc/iptables-rules.d/90-pppd
/usr/local/sbin/iptables-enforce

7
bundles/pppd/files/ip-up Normal file
View file

@ -0,0 +1,7 @@
#!/bin/bash
INTERFACE=$1
echo "iptables -t nat -A POSTROUTING -o $INTERFACE -j MASQUERADE" > /etc/iptables-rules.d/90-pppd
/usr/local/sbin/iptables-enforce

View file

@ -50,6 +50,14 @@ files = {
'svc_systemd:pppoe:restart', 'svc_systemd:pppoe:restart',
}, },
}, },
'/etc/ppp/ip-down.d/iptables': {
'source': 'ip-down',
'mode': '0755',
},
'/etc/ppp/ip-up.d/iptables': {
'source': 'ip-up',
'mode': '0755',
},
'/etc/ppp/peers/provider': { '/etc/ppp/peers/provider': {
'content_type': 'mako', 'content_type': 'mako',
'context': node.metadata['pppd'], 'context': node.metadata['pppd'],