add iptables rules cleanup in ovpn_run when the docker use host network#631
add iptables rules cleanup in ovpn_run when the docker use host network#631jimlinntu wants to merge 1 commit intokylemanna:masterfrom
Conversation
|
One of the main reasons this is an issue is that's not expected to run the container with networking mode = host. Why do that? At that point why not just use the distributions native container and use this image to manage the config files? I'm sure there are other bad assumptions when run with host networking namespace. That said, the implementation looks reasonably clean. |
|
Thanks for your fast reply! Lines 66 to 67 in 1228577 I think unless |
|
Ahh yes, I see your reasoning, the original feature of endorsing host only behavior was a misstep on my part. My concern with these off nominal cases is that they have a long history of breaking because I don't personally use them and they aren't tested. This PR highlights that point in that the code as originally written pollutes the iptables chains and there was no test to detect it. Going forward I see two routes:
Can you share with me what host networking gets you over a proper docker network setup? From my experience, host networking often only helps those who don't understand Docker's complicated networking schemes. |
Resolved the issue: #630
docker-compose.ymlI used to test.You will find that after my commit,
iptableswill be restored to its original state.(When the
docker-openvpnis on)(When the
docker-openvpnis off)