master
parent
d90322e604
commit
47ec3c38bb
|
@ -435,6 +435,9 @@ function enable_nat {
|
||||||
&& ${display} RED "nat.conf: Error - must begin with SNAT/MASQ/NETMAP: ${DEFAULT_COLOR}${type} ${srcinterface} ${srcaddress} ${dstinterface} ${dstaddress}" && continue
|
&& ${display} RED "nat.conf: Error - must begin with SNAT/MASQ/NETMAP: ${DEFAULT_COLOR}${type} ${srcinterface} ${srcaddress} ${dstinterface} ${dstaddress}" && continue
|
||||||
|
|
||||||
# Do some creative work with variables to make building the iptables rules fairly painless
|
# Do some creative work with variables to make building the iptables rules fairly painless
|
||||||
|
[[ ${srcaddress} != "-" ]] && revsrcaddress="-d ${srcaddress}"
|
||||||
|
[[ ${dstinterface} != "-" ]] && revdstinterface="-i ${dstinterface}"
|
||||||
|
[[ ${srcinterface} != "-" ]] && revsrcinterface="-o ${srcinterface}"
|
||||||
[[ ${srcinterface} != "-" ]] && srcinterface="-i ${srcinterface}"
|
[[ ${srcinterface} != "-" ]] && srcinterface="-i ${srcinterface}"
|
||||||
[[ ${dstinterface} != "-" ]] && dstinterface="-o ${dstinterface}"
|
[[ ${dstinterface} != "-" ]] && dstinterface="-o ${dstinterface}"
|
||||||
([[ ${srcaddress} != "-" ]] && [[ ${type} != "NETMAP" ]]) && srcaddress="-s ${srcaddress}"
|
([[ ${srcaddress} != "-" ]] && [[ ${type} != "NETMAP" ]]) && srcaddress="-s ${srcaddress}"
|
||||||
|
@ -451,9 +454,7 @@ function enable_nat {
|
||||||
|
|
||||||
([[ ${srcaddress} != "-" ]] && [[ ${dstaddress} != "-" ]] && [[ ${type} == "NETMAP" ]]) && action="-j NETMAP" && srcaddress="-d ${srcaddress}" && dstaddress="--to ${dstaddress}"
|
([[ ${srcaddress} != "-" ]] && [[ ${dstaddress} != "-" ]] && [[ ${type} == "NETMAP" ]]) && action="-j NETMAP" && srcaddress="-d ${srcaddress}" && dstaddress="--to ${dstaddress}"
|
||||||
|
|
||||||
[[ ${srcaddress} != "-" ]]) && revsrcaddress="-d ${srcaddress}"
|
|
||||||
[[ ${dstinterface} != "-" ]]) && revdstinterface="-i ${dstinterface}"
|
|
||||||
[[ ${srcinterface} != "-" ]]) && revsrcinterface="-o ${srcinterface}"
|
|
||||||
${debug} ${DebugColor} "${FUNCNAME}:${DEFAULT_COLOR}${direction} ${action} ${interface} ${srcaddress} ${srcport} ${dstaddress} ${dstport} ${protocol}"
|
${debug} ${DebugColor} "${FUNCNAME}:${DEFAULT_COLOR}${direction} ${action} ${interface} ${srcaddress} ${srcport} ${dstaddress} ${dstport} ${protocol}"
|
||||||
|
|
||||||
# Blank variables that we're not going to use.
|
# Blank variables that we're not going to use.
|
||||||
|
|
Loading…
Reference in New Issue