mirror of
https://github.com/qosmio/nss-packages.git
synced 2025-12-17 00:33:40 +00:00
qca-nss-ecm:Fixed the problem that the route does not respond after startup.
This commit is contained in:
parent
c7c8de990f
commit
399136a5ee
@ -1,14 +1,33 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
if grep -q "fw3" /etc/init.d/firewall; then
|
FW_SCRIPT="/etc/init.d/firewall"
|
||||||
iptables -nvL | grep -q "Chain RATE-LIMIT" && iptables -F RATE-LIMIT
|
|
||||||
iptables -nvL | grep -q "Chain RATE-LIMIT" || iptables -N RATE-LIMIT
|
if grep -q "fw3" "$FW_SCRIPT"; then
|
||||||
iptables -A RATE-LIMIT --match limit --limit 1000/sec --limit-burst 1000 -j RETURN
|
if ! iptables -nvL | grep -q "Chain RATE-LIMIT"; then
|
||||||
iptables -A RATE-LIMIT -j DROP
|
iptables -N RATE-LIMIT
|
||||||
iptables -I zone_wan_forward 5 --match conntrack --ctstate NEW -j RATE-LIMIT
|
fi
|
||||||
elif grep -q "fw4" /etc/init.d/firewall; then
|
|
||||||
nft add chain inet fw4 RATE-LIMIT
|
iptables -F RATE-LIMIT
|
||||||
nft add rule inet fw4 RATE-LIMIT limit rate 1000/second burst 1000 packets counter return
|
iptables -A RATE-LIMIT --match limit --limit 1000/sec --limit-burst 1000 -j RETURN
|
||||||
nft add rule inet fw4 RATE-LIMIT counter drop
|
iptables -A RATE-LIMIT -j DROP
|
||||||
nft insert rule inet fw4 forward_wan ct state new counter jump RATE-LIMIT
|
iptables -I zone_wan_forward 5 --match conntrack --ctstate NEW -j RATE-LIMIT
|
||||||
|
[ -n "$(command -v ip6tables)" ] && {
|
||||||
|
if ! ip6tables -nvL | grep -q "Chain RATE-LIMIT"; then
|
||||||
|
ip6tables -N RATE-LIMIT
|
||||||
|
fi
|
||||||
|
|
||||||
|
ip6tables -F RATE-LIMIT
|
||||||
|
ip6tables -A RATE-LIMIT --match limit --limit 1000/sec --limit-burst 1000 -j RETURN
|
||||||
|
ip6tables -A RATE-LIMIT -j DROP
|
||||||
|
ip6tables -I zone_wan_forward 5 --match conntrack --ctstate NEW -j RATE-LIMIT
|
||||||
|
}
|
||||||
|
|
||||||
|
elif grep -q "fw4" "$FW_SCRIPT"; then
|
||||||
|
if ! nft list chain inet fw4 RATE-LIMIT > /dev/null 2>&1; then
|
||||||
|
nft add chain inet fw4 RATE-LIMIT
|
||||||
|
fi
|
||||||
|
|
||||||
|
nft add rule inet fw4 RATE-LIMIT limit rate 1000/second burst 1000 packets counter return
|
||||||
|
nft add rule inet fw4 RATE-LIMIT counter drop
|
||||||
|
nft insert rule inet fw4 forward_wan ct state new counter jump RATE-LIMIT
|
||||||
fi
|
fi
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user