1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-03-09 15:40:03 +00:00

Fix log error on gre tunnel fw

This commit is contained in:
Ycarus (Yannick Chabanois) 2023-06-30 12:50:43 +02:00
parent 5ce0bcc714
commit 13b4d20763

View file

@ -6,7 +6,7 @@ if [ -f /usr/sbin/iptables-legacy ]; then
IPTABLESRESTORE="/usr/sbin/iptables-legacy-restore" IPTABLESRESTORE="/usr/sbin/iptables-legacy-restore"
else else
IPTABLESSAVE="/usr/sbin/iptables-save" IPTABLESSAVE="/usr/sbin/iptables-save"
IPTABLESRESTORE="/usr/sbin/iptables-restore" IPTABLESRESTORE="/usr/sbin/iptables-restore --noflush"
fi fi
_setup_rules() { _setup_rules() {
@ -39,7 +39,7 @@ _setup_fw() {
[ -n "$ifnames" ] && rule="$rule -i $(echo "${ifnames}" | sed 's/ /-i /g')" [ -n "$ifnames" ] && rule="$rule -i $(echo "${ifnames}" | sed 's/ /-i /g')"
if [ -n "$rule" ] && [ -n "$lookup" ]; then if [ -n "$rule" ] && [ -n "$lookup" ]; then
$IPTABLESAVE --counters | grep -v "0x${lookup}" | $IPTABLERESTORE -w --counters $IPTABLESAVE --counters | grep -v "0x${lookup}" | $IPTABLERESTORE -w --counters
$IPTABLERESTORE --noflush <<-EOF $IPTABLERESTORE <<-EOF
*mangle *mangle
-A omr-gre-tunnel ${rule} -j MARK --set-mark 0x${lookup} -A omr-gre-tunnel ${rule} -j MARK --set-mark 0x${lookup}
COMMIT COMMIT
@ -48,7 +48,7 @@ _setup_fw() {
} }
if [ -z "$($IPTABLESAVE | grep omr-gre-tunnel)" ]; then if [ -z "$($IPTABLESAVE | grep omr-gre-tunnel)" ]; then
$IPTABLERESTORE --noflush <<-EOF $IPTABLERESTORE <<-EOF
*mangle *mangle
:omr-gre-tunnel - :omr-gre-tunnel -
-I PREROUTING 1 -m addrtype ! --dst-type LOCAL -j omr-gre-tunnel -I PREROUTING 1 -m addrtype ! --dst-type LOCAL -j omr-gre-tunnel