P
P
primarch_sangvinius2022-03-21 18:12:23
openvpn
primarch_sangvinius, 2022-03-21 18:12:23

How to make OpenVPN work next door to Docker?

Greetings. The problem is the following.

I bet on a clean VDS'ku OpenVPN. I forward iptables so that everyone connected to OpenVPN has Internet and that computers inside the network can see each other

iptables -I FORWARD -i tun0 -o ens3 -j ACCEPT
iptables -I FORWARD -i ens3 -o tun0 -j ACCEPT
iptables -t nat -A POSTROUTING -o ens3 -j MASQUERADE


Next, I install Docker, roll up a couple of applications. Everything is working.
As soon as the server is rebooted, the rules for iptables described above die (save iptables does not help, ahem...). If there were no Docker on the server, I would just fill in the rules again, and OpenVPN would work as expected, but with Docker on board, these rules are ignored for some reason. As soon as I roll back iptables to the factory settings and write rules for OpenVPN, OpenVPN starts working like clockwork.
I believe that Docker's rules are somehow interfering with OpenVPN. How can you "friend" them?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
AlexVWill, 2022-03-21
@primarch_sangvinius

save iptables doesn't help, hmm...

how do you do it? like this: https://linuxconfig.org/how-to-make-iptables-rules...

A
Alexander Karabanov, 2022-03-21
@karabanov

You can prevent docker from managing the firewall, but you will have to enter the rules for containers yourself.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question