'If don‘t expose port, how does docker DNAT work?

For example, I wget a web page in a docker container which doesn't expose any port. I know that iptables SNAT charges to transform container's IP to host's IP. But when container gets repose, Who charges to transform host' IP to contaniner's?



Solution 1:[1]

This is all managed by host kernel. It applies NAT rules to outgoing packets and remembers to replace its ip with container's ip when the response is received.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 user2599052