This commit is contained in:
		
							parent
							
								
									a4640001b7
								
							
						
					
					
						commit
						bde9efd92b
					
				@ -10,7 +10,8 @@
 | 
			
		||||
		- ACL/Filtering functionality (IPv4/IPv6) - 4/5/2014
 | 
			
		||||
		- NAT/NETMAP functionality (IPv4/IPv6) - 4/5/2014
 | 
			
		||||
				- IPv6 NAT/NETMAP is untested, have no internal use for it, let me know if works/doesnt
 | 
			
		||||
		
 | 
			
		||||
		- Forwarding functionality (IPv4/IPv6) - 4/5/2014
 | 
			
		||||
		- Deps on Enablev(4|6)ConnectionTracking for NAT functionality
 | 
			
		||||
		
 | 
			
		||||
=-=-=-=-= PRE 2.0 REWRITE =-=-=-=-=
 | 
			
		||||
1.1 - Brielle Bruns <bruns@2mbit.com>
 | 
			
		||||
 | 
			
		||||
@ -194,20 +194,30 @@ function allow_resolvconf_servers {
 | 
			
		||||
				IPVER="4" ;;
 | 
			
		||||
	esac
 | 
			
		||||
	${debug} ${DebugColor} "${FUNCNAME}:${DEFAULT_COLOR} loading"
 | 
			
		||||
	[[ ${IP_VERSION} = "ipv4" ]] && ResolvConfFile="${ResolvConfv4File}"
 | 
			
		||||
	[[ ${IP_VERSION} = "ipv6" ]] && ResolvConfFile="${ResolvConfv6File}"
 | 
			
		||||
	[[ ${IP_VERSION} == "ipv4" ]] && ResolvConfFile="${ResolvConfv4File}"
 | 
			
		||||
	[[ ${IP_VERSION} == "ipv6" ]] && ResolvConfFile="${ResolvConfv6File}"
 | 
			
		||||
	${debug} ${DebugColor} "${FUNCNAME}:${DEFAULT_COLOR} Using ${ResolvConfFile} as resolv.conf"
 | 
			
		||||
	while read -r type server; do
 | 
			
		||||
		[[ ${type} != "nameserver" ]] && continue
 | 
			
		||||
		[[ ${type} = "" ]] && continue
 | 
			
		||||
		# If we see a : in the server variable, we are most likely dealing with an ipv6 address
 | 
			
		||||
		([[ ${server} =~ ":" ]] && [[ ${IP_VERSION} = "ipv4" ]]) && continue
 | 
			
		||||
		([[ ! ${server} =~ ":" ]] && [[ ${IP_VERSION} = "ipv6" ]]) && continue
 | 
			
		||||
		
 | 
			
		||||
		use_conntrack="no"
 | 
			
		||||
		(([[ ${IP_VERSION} == "ipv4" ]] && [[ ${Enablev4ConnectionTracking} == "yes" ]]) && use_conntrack="yes"
 | 
			
		||||
		(([[ ${IP_VERSION} == "ipv6" ]] && [[ ${Enablev6ConnectionTracking} == "yes" ]]) && use_conntrack="yes"
 | 
			
		||||
		
 | 
			
		||||
		# If we see a : in the server variable, we are most likely dealing with an ipv6 address
 | 
			
		||||
		${debug} ${DebugColor} "${FUNCNAME}:${DEFAULT_COLOR} Added ${server} to DNS client trusted list"
 | 
			
		||||
		if [[ ${use_conntrack} == "yes"]]; then
 | 
			
		||||
			${VER_IPTABLES} -A ${OutPreRules} -p udp -d ${server} --dport 53 ${M_STATE} ${C_STATE} NEW,ESTABLISHED -j ACCEPT
 | 
			
		||||
			${VER_IPTABLES} -A ${InPreRules} -p udp -s ${server} --sport 53 ${M_STATE} ${C_STATE} ESTABLISHED,RELATED -j ACCEPT
 | 
			
		||||
		else
 | 
			
		||||
			${VER_IPTABLES} -A ${OutPreRules} -p udp -s ${server} --sport 1024:65535 --dport 53 -j ACCEPT
 | 
			
		||||
			${VER_IPTABLES} -A ${InPreRules} -p udp -d ${server} --dport 1024:65535 --sport 53 -j ACCEPT
 | 
			
		||||
		${VER_IPTABLES} -A ${OutPreRules} -p tcp -s ${server} --sport 1024:65535 --dport 53 -j ACCEPT
 | 
			
		||||
		${VER_IPTABLES} -A ${InPreRules} -p tcp -d ${server} --dport 1024:65535 --sport 53 -j ACCEPT
 | 
			
		||||
			#${VER_IPTABLES} -A ${OutPreRules} -p tcp -s ${server} --sport 1024:65535 --dport 53 -j ACCEPT
 | 
			
		||||
			#${VER_IPTABLES} -A ${InPreRules} -p tcp -d ${server} --dport 1024:65535 --sport 53 -j ACCEPT
 | 
			
		||||
		fi
 | 
			
		||||
		done < "${ResolvConfFile}"
 | 
			
		||||
	${debug} ${DebugColor} "${FUNCNAME}:${DEFAULT_COLOR} done"
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user