1
0
mirror of https://github.com/juliengk/csf-post-docker.git synced 2023-10-10 13:37:41 +02:00

Update docker.sh

This commit is contained in:
Julien K 2022-08-09 04:58:56 -04:00 committed by GitHub
parent a21e670799
commit e5468622f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -103,10 +103,10 @@ if [ `echo ${containers} | wc -c` -gt "1" ]; then
iptables -t nat -A POSTROUTING -s ${ipaddr}/32 -d ${ipaddr}/32 -p ${dst_proto} -m ${dst_proto} --dport ${dst_port} -j MASQUERADE
iptables_opt_src=""
if [ "${src_ip}" != "0.0.0.0" ]; then
if [ "$src_ip" != "0.0.0.0" ]; then
iptables_opt_src="-d ${src_ip}/32 "
fi
if [ ! -z ${src_ip} ]; then
if [ -n "$src_ip" ]; then
iptables -t nat -A DOCKER ${iptables_opt_src}! -i ${DOCKER_NET_INT} -p ${dst_proto} -m ${dst_proto} --dport ${src_port} -j DNAT --to-destination ${ipaddr}:${dst_port}
fi
done