Configure DNAT on Linux machine with iptables

From AcrodusWiki
Revision as of 22:24, 25 November 2024 by Alex (talk | contribs) (-)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This command quickly configures DNAT rules. This was used to provide services running in containers by forwarding the traffic onto the lxc-bridge private network from the public address.

iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to-destination {private address on lxc-bridge network}