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,260 points
803 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,460 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,700 points
4,639 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,230 points
862 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 34,135 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,020 points
2,714 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,460 points
6,895 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,460 points
3,611 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP