How to change iptables policy?

0 votes

Hi Guys,

I have my containers in CentOS VM. To expose my containers, I enabled ip_forwarding. But still I am not not able to connect. I searched a lot and came to know iptables is not allowing to connect.

How can I solve this problem?

Thank You

Apr 6 in Docker by akhtar
• 11,270 points
19 views

1 answer to this question.

0 votes

Hi@akhtar,

Docker uses iptables program in background. So along with ip_forwarding you have to change iptables policy.

  • Check iptables policy first.
$ iptables -nvL
  • Change Forward policy with Forward Accept.
$ iptables -P FORWARD ACCEPT

Hope this will work now.

Thank You

answered Apr 6 by MD
• 24,500 points

Related Questions In Docker

0 votes
1 answer

How to change hosts in Docker for Windows in daemon.json?

you cannot specify options both as a ...READ MORE

answered Oct 16, 2018 in Docker by Tyrion anex
• 8,370 points
1,547 views
0 votes
1 answer

How to change a node's availability?

Hey @jenny,  You can do the following in ...READ MORE

answered Jul 8, 2019 in Docker by Sirajul
• 53,110 points
98 views
+4 votes
4 answers

How To Access a Service on Host From a Docker Container?

Adding to kalgi's answer, You can also ...READ MORE

answered Oct 16, 2018 in Docker by lina
• 8,200 points

edited Oct 16, 2018 by lina 11,781 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Deploy Docker Containers from Docker Cloud

To solve this problem, I followed advice ...READ MORE

answered Sep 3, 2018 in AWS by Priyaj
• 57,530 points
542 views
0 votes
1 answer

How to change the default IP address of docker bridge adapter?

Hi@akhtar, You can reconfigure the default bridge network ...READ MORE

answered May 11 in Docker by MD
• 24,500 points
101 views
0 votes
1 answer

How to create our own docker image?

Hi@akhtar, There are two ways to create docker ...READ MORE

answered Mar 11 in Docker by MD
• 24,500 points
73 views