Bonjour à vous tous,
Ayant des connaissances réseau assez basiques, j’aimerai vous faire part d’un problème purement technique que je n’arrive pas à résoudre. J’ai fait plusieurs recherches sur les forums, malheureusement en vain…
Voici un résumé :
J’utilise une dédibox sous Debian pour une utilisation personnelle où j’y ai installé une application web qui interroge une base PostgreSQL installée sur la même machine.
Malheureusement, il m’est impossible de configurer mon application sur l’adresse “localhost”!
La seule parade trouvée a été de passer en IPv6 avec l’adresse “::1”.
Après plusieurs tests, j’ai remarqué que de simples appels Telnet généraient le même problème.
Sur “127.0.0.1” la commande mouline pendant 5/6 minutes puis m’éjecte.
Sur “::1” la connection se fait instantanément.
Sur “localhost” un premier essai est fait avec “127.0.0.1” sans succès, puis un nouvel essai sur “::1” réussi!
Voici ce que j’obtiens à l’écran :
kowak@sd-xxxxx:~$ telnet 127.0.0.1 5432
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection timed out
kowak@sd-xxxxx:~$ telnet ::1 5432
Trying ::1...
Connected to ::1.
Escape character is '^]'.
Connection closed by foreign host.
kowak@sd-xxxxx:~$ telnet localhost 5432
Trying 127.0.0.1...
Trying ::1...
Connected to localhost.
Escape character is '^]'.
Connection closed by foreign host.
Il faut aussi savoir que j’utilise Iptables pour me protéger à travers un parefeu.
Lorsque je désactive temporairement iptables, la connexion en 127.0.0.1 redevient instantanée!!
Voici ma configuration :
Chain INPUT (policy DROP)
target prot opt source destination
fail2ban-ssh tcp -- anywhere anywhere multiport dports ssh
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT tcp -- [MyIP*] anywhere tcp dpt:ssh
ACCEPT icmp -- anywhere anywhere
ACCEPT tcp -- anywhere anywhere tcp dpt:telnet
ACCEPT udp -- anywhere anywhere udp dpt:domain
ACCEPT tcp -- anywhere anywhere tcp dpt:www
ACCEPT tcp -- anywhere anywhere tcp dpt:https
ACCEPT tcp -- [MyIP*] anywhere tcp dpt:postgresql
ACCEPT tcp -- [MyIP*] anywhere tcp dpt:mysql
ACCEPT tcp -- 88.191.254.0/24 anywhere tcp dpt:snmp state NEW,ESTABLISHED
ACCEPT udp -- 88.191.254.0/24 anywhere udp dpt:snmp state NEW,ESTABLISHED
Chain FORWARD (policy DROP)
target prot opt source destination
Chain OUTPUT (policy DROP)
target prot opt source destination
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT icmp -- anywhere anywhere
ACCEPT tcp -- anywhere anywhere tcp dpt:ftp-data
ACCEPT tcp -- anywhere anywhere tcp dpt:ftp
ACCEPT udp -- anywhere anywhere udp dpt:domain
ACCEPT tcp -- anywhere anywhere tcp dpt:www
ACCEPT udp -- anywhere anywhere udp dpt:ntp
ACCEPT tcp -- anywhere anywhere tcp dpt:https
ACCEPT tcp -- anywhere anywhere tcp dpt:ssmtp
ACCEPT tcp -- 88.191.254.0/24 anywhere tcp dpt:snmp state NEW,ESTABLISHED
ACCEPT udp -- 88.191.254.0/24 anywhere udp dpt:snmp state NEW,ESTABLISHED
Chain fail2ban-ssh (1 references)
target prot opt source destination
RETURN all -- anywhere anywhere
[MyIP*] : accès au SSH, PostgreSQL et MySQL uniquement depuis mon poste, interdit pour tous les autres.
A mon humble avis, j’ai certainement du rater quelque chose dans les configurations d’iptables, mais je tourne en rond…
Auriez-vous une idée ?
Par avance merci