Setting net.ipv4.ip_forward=1 is troublesome for various reasons, including security.
Would it be possible to stop using that and instead use something like iptables rule below instead?
Example for container started with --port 0.0.0.0:29418:29418
iptables -I PREROUTING 1 -t nat -i eth0 -p tcp --dport 29418 -j REDIRECT --to-port 29418
This should work, though translating 0.0.0.0 to eth0 is a potential problem. I'm not an iptables wizard, so there is certainly a better way to do this.
Setting
net.ipv4.ip_forward=1is troublesome for various reasons, including security.Would it be possible to stop using that and instead use something like
iptablesrule below instead?Example for container started with
--port 0.0.0.0:29418:29418This should work, though translating
0.0.0.0toeth0is a potential problem. I'm not aniptableswizard, so there is certainly a better way to do this.