Score:0

iptables with docker-user, release connections with the container itself

ne flag

If the system that is inside the container tries to connect with MySQL from the container itself using the server ip (192.168.0.200) it does not connect.

The problem is in

 iptables -P INPUT DROP

if I remove it, it works but it removes the security of the server

 My Host: 192.168.0.100
 Server with docker: 192.168.0.200

My rules:

 #!/bin/bash

 # DROPS
 iptables -P INPUT DROP
 iptables -P FORWARD DROP
 iptables -P OUTPUT ACCEPT

 # ESTABELECIDAS
 iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
 iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
 iptables -A OUTPUT -m state --state RELATED,ESTABLISHED -j ACCEPT

 # PING 
 iptables -t filter -A INPUT -p icmp -j ACCEPT

 # LOOPBACK
 iptables -A INPUT -i lo -j ACCEPT

 # SSH
 iptables -A INPUT -p tcp -s 192.168.0.100 --dport 22 -j ACCEPT       

 # DROP CONTAINER ALL CONNECTION TO MYSQL
 iptables -I DOCKER-USER -i eno1 -p tcp --dport 3306 -j DROP

 # ALLOW MYSQL TO USER IP
 iptables -I DOCKER-USER -p tcp -s 192.168.0.100 --dport 3306 -j ACCEPT

 # PORT 80 CONTAINER
 iptables -I DOCKER-USER -p tcp --dport 80 -j ACCEPT
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.