1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-02-12 10:31:51 +00:00

Fix for omr-bypass, only default ss-rules supported for now

This commit is contained in:
Ycarus (Yannick Chabanois) 2020-06-27 21:54:46 +02:00
parent 9ad332c841
commit 41e188a71c

View file

@ -333,14 +333,14 @@ _intf_rule() {
COMMIT
EOF
fi
if [ "$(iptables --wait=40 -t nat -L -n | grep ss_rules_pre_src)" != "" ] && [ "$(iptables --wait=40 -t nat -L -n | grep omr_dst_bypass_$intf)" = "" ]; then
if [ "$(iptables --wait=40 -t nat -L -n | grep ss_rules_default_pre_src)" != "" ] && [ "$(iptables --wait=40 -t nat -L -n | grep omr_dst_bypass_$intf)" = "" ]; then
iptables-restore -w --wait=60 --noflush <<-EOF
*nat
-I ss_rules_dst 1 -m set --match-set omr_dst_bypass_$intf dst -j RETURN
-I ss_rules_local_out 1 -m set --match-set omr_dst_bypass_$intf dst -j RETURN
-I ss_rules_local_out 2 -m mark --mark 0x539$count -j RETURN
-I ss_rules_pre_src 1 -m set --match-set omr_dst_bypass_$intf dst -j MARK --set-mark 0x539$count
-I ss_rules_pre_src 2 -m mark --mark 0x539$count -j RETURN
-I ss_rules_default_dst 1 -m set --match-set omr_dst_bypass_$intf dst -j RETURN
-I ss_rules_default_local_out 1 -m set --match-set omr_dst_bypass_$intf dst -j RETURN
-I ss_rules_default_local_out 2 -m mark --mark 0x539$count -j RETURN
-I ss_rules_default_pre_src 1 -m set --match-set omr_dst_bypass_$intf dst -j MARK --set-mark 0x539$count
-I ss_rules_default_pre_src 2 -m mark --mark 0x539$count -j RETURN
COMMIT
EOF
fi
@ -352,14 +352,14 @@ _intf_rule() {
COMMIT
EOF
fi
if [ "$(ip6tables --wait=40 -t nat -L | grep ss_rules6_pre_src)" != "" ] && [ "$(ip6tables --wait=40 -t nat -L | grep omr6_dst_bypass_$intf)" = "" ]; then
if [ "$(ip6tables --wait=40 -t nat -L | grep ss_rules6_default_pre_src)" != "" ] && [ "$(ip6tables --wait=40 -t nat -L | grep omr6_dst_bypass_$intf)" = "" ]; then
ip6tables-restore -w --wait=60 --noflush <<-EOF
*nat
-I ss_rules6_dst 1 -m set --match-set omr6_dst_bypass_$intf dst -j RETURN
-I ss_rules6_local_out 1 -m set --match-set omr6_dst_bypass_$intf dst -j RETURN
-I ss_rules6_local_out 2 -m mark --mark 0x6539$count -j RETURN
-I ss_rules6_pre_src 1 -m set --match-set omr6_dst_bypass_$intf dst -j MARK --set-mark 0x6539$count
-I ss_rules6_pre_src 2 -m mark --mark 0x6539$count -j RETURN
-I ss_rules6_default_dst 1 -m set --match-set omr6_dst_bypass_$intf dst -j RETURN
-I ss_rules6_default_local_out 1 -m set --match-set omr6_dst_bypass_$intf dst -j RETURN
-I ss_rules6_default_local_out 2 -m mark --mark 0x6539$count -j RETURN
-I ss_rules6_default_pre_src 1 -m set --match-set omr6_dst_bypass_$intf dst -j MARK --set-mark 0x6539$count
-I ss_rules6_default_pre_src 2 -m mark --mark 0x6539$count -j RETURN
COMMIT
EOF
fi
@ -483,14 +483,14 @@ start_service() {
COMMIT
EOF
fi
if [ "$(iptables --wait=40 -t nat -L -n | grep ss_rules_pre_src)" != "" ] && [ "$(iptables --wait=40 -t nat -L -n | grep omr_dst_bypass_all)" = "" ]; then
if [ "$(iptables --wait=40 -t nat -L -n | grep ss_rules_default_pre_src)" != "" ] && [ "$(iptables --wait=40 -t nat -L -n | grep omr_dst_bypass_all)" = "" ]; then
iptables-restore -w --wait=60 --noflush <<-EOF
*nat
-I ss_rules_dst 1 -m set --match-set omr_dst_bypass_all dst -j RETURN
-I ss_rules_local_out 1 -m set --match-set omr_dst_bypass_all dst -j RETURN
-I ss_rules_local_out 2 -m mark --mark 0x539 -j RETURN
-I ss_rules_pre_src 1 -m set --match-set omr_dst_bypass_all dst -j MARK --set-mark 0x539
-I ss_rules_pre_src 2 -m mark --mark 0x539 -j RETURN
-I ss_rules_default_dst 1 -m set --match-set omr_dst_bypass_all dst -j RETURN
-I ss_rules_default_local_out 1 -m set --match-set omr_dst_bypass_all dst -j RETURN
-I ss_rules_default_local_out 2 -m mark --mark 0x539 -j RETURN
-I ss_rules_default_pre_src 1 -m set --match-set omr_dst_bypass_all dst -j MARK --set-mark 0x539
-I ss_rules_default_pre_src 2 -m mark --mark 0x539 -j RETURN
COMMIT
EOF
fi
@ -502,14 +502,14 @@ start_service() {
COMMIT
EOF
fi
if [ "$(ip6tables --wait=40 -t nat -L | grep ss_rules6_pre_src)" != "" ] && [ "$(ip6tables --wait=40 -t nat -L | grep omr6_dst_bypass_all)" = "" ]; then
if [ "$(ip6tables --wait=40 -t nat -L | grep ss_rules6_default_pre_src)" != "" ] && [ "$(ip6tables --wait=40 -t nat -L | grep omr6_dst_bypass_all)" = "" ]; then
ip6tables-restore -w --wait=60 --noflush <<-EOF
*nat
-I ss_rules6_dst 1 -m set --match-set omr6_dst_bypass_all dst -j RETURN
-I ss_rules6_local_out 1 -m set --match-set omr6_dst_bypass_all dst -j RETURN
-I ss_rules6_local_out 2 -m mark --mark 0x6539 -j RETURN
-I ss_rules6_pre_src 1 -m set --match-set omr6_dst_bypass_all dst -j MARK --set-mark 0x6539
-I ss_rules6_pre_src 2 -m mark --mark 0x6539 -j RETURN
-I ss_rules6_default_dst 1 -m set --match-set omr6_dst_bypass_all dst -j RETURN
-I ss_rules6_default_local_out 1 -m set --match-set omr6_dst_bypass_all dst -j RETURN
-I ss_rules6_default_local_out 2 -m mark --mark 0x6539 -j RETURN
-I ss_rules6_default_pre_src 1 -m set --match-set omr6_dst_bypass_all dst -j MARK --set-mark 0x6539
-I ss_rules6_default_pre_src 2 -m mark --mark 0x6539 -j RETURN
COMMIT
EOF
fi