mirror of
https://github.com/SunBK201/UA3F.git
synced 2025-12-16 16:57:08 +00:00
feat: add debug logging for firewall and route rules
This commit is contained in:
parent
0479abada6
commit
38591c2743
@ -455,6 +455,27 @@ start_service() {
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
# dump all fw rules for debug
|
||||||
|
if [ "$log_level" = "debug" ]; then
|
||||||
|
if [ "$FW_BACKEND" = "nft" ]; then
|
||||||
|
LOG "nftables rules:"
|
||||||
|
nft --handle list ruleset >>"$LOG_FILE" 2>&1
|
||||||
|
elif [ "$FW_BACKEND" = "ipt" ]; then
|
||||||
|
LOG "iptables rules:"
|
||||||
|
LOG "mangle table:"
|
||||||
|
iptables -t mangle -L -v -n >>"$LOG_FILE" 2>&1
|
||||||
|
LOG "nat table:"
|
||||||
|
iptables -t nat -L -v -n >>"$LOG_FILE" 2>&1
|
||||||
|
LOG "filter table:"
|
||||||
|
iptables -t filter -L -v -n >>"$LOG_FILE" 2>&1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
# dump route rules for debug
|
||||||
|
if [ "$log_level" = "debug" ]; then
|
||||||
|
LOG "ip rule list:"
|
||||||
|
ip rule show >>"$LOG_FILE" 2>&1
|
||||||
|
fi
|
||||||
|
|
||||||
procd_open_instance "$NAME"
|
procd_open_instance "$NAME"
|
||||||
procd_set_param command "$PROG"
|
procd_set_param command "$PROG"
|
||||||
procd_append_param command -m "$server_mode"
|
procd_append_param command -m "$server_mode"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user