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, 2020 in Docker by akhtar
• 38,180 points
124 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, 2020 by MD
• 95,220 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,660 points
2,687 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
• 59,070 points
188 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,220 points

edited Oct 16, 2018 by lina 22,571 views
0 votes
1 answer
+2 votes
1 answer
+2 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
• 58,120 points
1,195 views
+1 vote
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, 2020 in Docker by MD
• 95,220 points
2,758 views
0 votes
1 answer

How to change node availability in docker swarm?

Hi@akhtar, You can change the node availability according to ...READ MORE

answered Dec 28, 2020 in Docker by MD
• 95,220 points
319 views