mirror of
				https://github.com/Ysurac/openmptcprouter-feeds.git
				synced 2025-03-09 15:40:03 +00:00 
			
		
		
		
	Separate rules for bypass
This commit is contained in:
		
							parent
							
								
									9432081ec4
								
							
						
					
					
						commit
						499481490b
					
				
					 1 changed files with 14 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -375,13 +375,25 @@ _bypass_proto() {
 | 
			
		|||
_intf_rule_ss_rules() {
 | 
			
		||||
	rule_name=$1
 | 
			
		||||
	[ "$rule_name" = "ss_rules" ] && rule_name="def"
 | 
			
		||||
	if [ "$(iptables --wait=40 -t nat -L -n | grep ssr_${rule_name}_pre_src)" != "" ] && [ "$(iptables-save | grep ssr | grep omr_dst_bypass_$intf)" = "" ]; then
 | 
			
		||||
	if [ "$(iptables --wait=40 -t nat -L -n | grep ssr_${rule_name}_dst)" != "" ] && [ "$(iptables-save | grep ssr_${rule_name}_dst | grep omr_dst_bypass_$intf)" = "" ]; then
 | 
			
		||||
		iptables-restore -w --wait=60 --noflush <<-EOF
 | 
			
		||||
		*nat
 | 
			
		||||
		-I ssr_${rule_name}_dst 1 -m set --match-set omr_dst_bypass_$intf dst -j MARK --set-mark 0x539$count
 | 
			
		||||
		-I ssr_${rule_name}_dst 2 -m mark --mark 0x539$count -j RETURN
 | 
			
		||||
		COMMIT
 | 
			
		||||
		EOF
 | 
			
		||||
	fi
 | 
			
		||||
	if [ "$(iptables --wait=40 -t nat -L -n | grep ssr_${rule_name}_local_out)" != "" ] && [ "$(iptables-save | grep ssr_${rule_name}_local_out | grep omr_dst_bypass_$intf)" = "" ]; then
 | 
			
		||||
		iptables-restore -w --wait=60 --noflush <<-EOF
 | 
			
		||||
		*nat
 | 
			
		||||
		-I ssr_${rule_name}_local_out 1 -m set --match-set omr_dst_bypass_$intf dst -j MARK --set-mark 0x539$count
 | 
			
		||||
		-I ssr_${rule_name}_local_out 2 -m mark --mark 0x539$count -j RETURN
 | 
			
		||||
		COMMIT
 | 
			
		||||
		EOF
 | 
			
		||||
	fi
 | 
			
		||||
	if [ "$(iptables --wait=40 -t nat -L -n | grep ssr_${rule_name}_pre_src)" != "" ] && [ "$(iptables-save | grep ssr_${rule_name}_pre_src | grep omr_dst_bypass_$intf)" = "" ]; then
 | 
			
		||||
		iptables-restore -w --wait=60 --noflush <<-EOF
 | 
			
		||||
		*nat
 | 
			
		||||
		-I ssr_${rule_name}_pre_src 1 -m set --match-set omr_dst_bypass_$intf dst -j MARK --set-mark 0x539$count
 | 
			
		||||
		-I ssr_${rule_name}_pre_src 2 -m mark --mark 0x539$count -j RETURN
 | 
			
		||||
		COMMIT
 | 
			
		||||
| 
						 | 
				
			
			@ -493,6 +505,7 @@ _intf_rule() {
 | 
			
		|||
		iptables-restore -w --wait=60 --noflush <<-EOF
 | 
			
		||||
		*mangle
 | 
			
		||||
		-I omr-bypass 1 -m set --match-set omr_dst_bypass_$intf dst -j MARK --set-mark 0x539$count
 | 
			
		||||
		-I omr-bypass-local 1 -m set --match-set omr_dst_bypass_$intf dst -j MARK --set-mark 0x539$count
 | 
			
		||||
		COMMIT
 | 
			
		||||
		EOF
 | 
			
		||||
	fi
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue