From d0208b000680fac7a1b57e0ac0029186c3527fd8 Mon Sep 17 00:00:00 2001 From: Brielle Bruns Date: Wed, 1 Jan 2020 13:38:04 -0700 Subject: [PATCH] Make sure src interface is added --- lib/iptables.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/iptables.inc b/lib/iptables.inc index f8ccf7b..52d8f69 100644 --- a/lib/iptables.inc +++ b/lib/iptables.inc @@ -488,7 +488,7 @@ function enable_nat { ([[ ${dstaddress} != "-" ]] && [[ ${type} == "NETMAP" ]]) && dstaddress="-d ${dstaddress}" # If we use a source interface, the rule can't go in a POSTROUTING table like what NAT is, so we punt it to PREROUTING # or it won't work. Plus we remove the destination interface too. - ([[ ${srcinterface} != "-" ]] && [[ ${type} == "NETMAP" ]]) && NAT="PREROUTING" && dstinterface="-" + ([[ ${srcinterface} != "-" ]] && [[ ${type} == "NETMAP" ]]) && NAT="PREROUTING" && dstinterface="-" && srcinterface="-i ${srcinterface}" ([[ ${custom} == "" ]] && [[ ${type} == "NETMAP" ]]) && \ ${display} RED "nat.conf: Error - NETMAP rule can not have empty custom address: ${DEFAULT_COLOR}${type} ${srcinterface} ${srcaddress} ${dstinterface} ${dstaddress} ${custom}" \ && continue