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,230 points
542 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,440 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,278 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
621 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 32,899 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,090 points
2,435 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,440 points
6,374 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,440 points
3,149 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