Jump to content

Recommended Posts

Posted

есть такой скрипт

/opt/etc/ndm/netfilter.d/S04zapret_netfilter

#!/bin/sh

[ "$type" == "ip6tables" ] && exit 0   # 'iptables' or 'ip6tables'
[ "$table" != "nat" ] && exit 0   # 'filter', 'nat', 'mangle'

logger -t zapret_netfilter "Launched netfilter.d nat"
if [ -z "$(iptables-save 2>/dev/null | grep zapret)" ]; then
    logger -t zapret_netfilter "Create zapret rules"
    ipset create zapret hash:net -exist
    iptables -I PREROUTING -w -t nat -i br0 -p tcp -m set --match-set zapret dst -j REDIRECT --to-port 999
fi

Где-то через день, это правило пропадает из iptables.

iptables-save | grep zapret - его не возвращает

Почему оно пропадает?

что нужно сделать чтобы оно не пропадало? (можно конечно в крон добавить на каждую минуту проверять, но это уже совсем костыль)

версия KeeneticOS: 4.1.7

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

This site uses cookies. By clicking "I accept" or continuing to browse the site, you authorize their use in accordance with the Privacy Policy.