Connexion Telnet impossible malgré les ports ouverts

Bonjour,
J’ai créé un serveur mail sous postfix et courier-imap et je souhaiterai m’y connecter via Telnet cependant, quand j’entre : telnet 127.0.0.1 25
je reçois : Trying 127.0.0.1... telnet: Unable to connect to remote host: Connection timed out
Le serveur mail fonctionne correctement, j’ai pu envoyer des mails avec la commande mail, j’utilise le relayhost de mon FAI en guise de SMTP.

Pourtant, j’ai ouvert les ports comme il faut il me semble :
iptables -L :

[code]Chain INPUT (policy DROP)
target prot opt source destination
ACCEPT all – anywhere anywhere
ACCEPT udp – anywhere anywhere udp spt:domain
ACCEPT tcp – anywhere anywhere tcp spt:domain
ACCEPT tcp – anywhere anywhere tcp spt:www state RELATED,ESTABLISHED
ACCEPT tcp – anywhere anywhere tcp spt:https state RELATED,ESTABLISHED
ACCEPT tcp – anywhere anywhere tcp spt:imap2 state RELATED,ESTABLISHED
ACCEPT tcp – anywhere anywhere tcp spt:smtp state RELATED,ESTABLISHED
ACCEPT tcp – anywhere anywhere tcp dpt:2222
ACCEPT tcp – anywhere anywhere tcp dpt:telnet
ACCEPT tcp – anywhere anywhere tcp dpt:www
ACCEPT tcp – anywhere anywhere tcp dpt:mysql

Chain FORWARD (policy DROP)
target prot opt source destination
ACCEPT udp – anywhere anywhere udp spt:domain
ACCEPT udp – anywhere anywhere udp dpt:domain
ACCEPT tcp – anywhere anywhere tcp spt:domain
ACCEPT tcp – anywhere anywhere tcp dpt:domain
ACCEPT tcp – anywhere anywhere tcp dpt:www state NEW,RELATED,ESTABLISHED
ACCEPT tcp – anywhere anywhere tcp dpt:https state NEW,RELATED,ESTABLISHED
ACCEPT tcp – anywhere anywhere tcp spt:www state RELATED,ESTABLISHED
ACCEPT tcp – anywhere anywhere tcp spt:https state RELATED,ESTABLISHED
ACCEPT tcp – anywhere anywhere tcp dpt:imap2 state NEW,RELATED,ESTABLISHED
ACCEPT tcp – anywhere anywhere tcp spt:imap2 state RELATED,ESTABLISHED
ACCEPT tcp – anywhere anywhere tcp dpt:smtp state NEW,RELATED,ESTABLISHED
ACCEPT tcp – anywhere anywhere tcp spt:smtp state RELATED,ESTABLISHED

Chain OUTPUT (policy DROP)
target prot opt source destination
ACCEPT all – anywhere anywhere
ACCEPT udp – anywhere anywhere udp dpt:domain
ACCEPT tcp – anywhere anywhere tcp dpt:domain
ACCEPT tcp – anywhere anywhere tcp dpt:www state NEW,RELATED,ESTABLISHED
ACCEPT tcp – anywhere anywhere tcp dpt:https state NEW,RELATED,ESTABLISHED
ACCEPT tcp – anywhere anywhere tcp dpt:imap2 state NEW,RELATED,ESTABLISHED
ACCEPT tcp – anywhere anywhere tcp dpt:smtp state NEW,RELATED,ESTABLISHED
ACCEPT tcp – anywhere anywhere tcp spt:2222
ACCEPT tcp – anywhere anywhere tcp spt:telnet
ACCEPT tcp – anywhere anywhere tcp spt:www
ACCEPT tcp – anywhere anywhere tcp spt:mysql
[/code]

Sauriez vous d’où vient le problème ?
Merci d’avance

Donne nous le résultat de la commande suivante :

Cette commande (dont j’apprécie les options de netstat) te permet de vérifier sur quelles interfaces écoute ton serveur smtp.

Bonsoir, merci de tenter de m’aider.
Voici le résultat de la commande :

tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 111 9258884 32250/mysqld tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 0 9245331 6198/master tcp6 0 0 :::25 :::* LISTEN 0 9245333 6198/master

Petite hypothèse :

Dans la chaine INPUT (Flux à destination de ton serveur), tu autorise les connexions ayant un statut RELATED et ESTABLISHED mais pas NEW.

Test proposé :

Désactive ton filtrage, fais un test, réactive ton filtrage.

Tu pourra ainsi savoir si cela provient bien du filtrage réalisé via iptables.

J’ai passé toutes mes chaines en ACCEPT puis j’ai supprimé les iptables mais telnet ne marche toujours pas !

Imaginons que ton serveur possède l’eth0 avec pour @IP 192.168.1.1
Fais un telnet 192.168.1.1 25 en ayant pris soin au préalable de faire un tcpdump -i eth0 port 25

Vois tu arriver le paquet TCP à destination du port 25 ?

Cela permet de lever le doute sur le réseau et de s’orienter vers le service qui écoute sur le port 25 (il y a t-il des “networks” autorisés à contacter le service SMTP ?)

J’ai tenté le telnet avec 3 valeurs différentes : localhost, 192.168.1.14 et le nom de domaine qui pointe vers mon serveur.

Dans le cas de localhost, je vois les paquets (encore heureux ! :smiley: )
Dans le cas du nom de domaine, ça marche également, les paquets arrivent.

Cependant, quand j’entre 192.168.1.14, je n’ai aucun paquet !

Et du coté de la configuration du service :

[code]Restriction de la fonction relais
Dans sa configuration par défaut, Postfix gère simplement les autorisations de relais : tous les clients des réseaux répertoriés dans la directive mynetworks sont autorisés à envoyer du courrier à l’extérieur tandis que les autres ne sont autorisés à envoyer du courrier qu’à destination des domaines gérés par le serveur. Cette configuration se traduit dans Postfix par la valeur par défaut suivante du fichier de configuration main.cf :


smtpd_recipient_restrictions =
permit_mynetworks,
reject_unauth_destination
-------------------------------------[/code]
http://www.unixgarden.com/index.php/gnu-linux-magazine/configuration-avancee-de-postfix

Un PING du nom de domaine te retourne quelle IP ?

Peux tu essayer le TELNET depuis un poste client (et non pas directement du serveur) ? Si oui, tu vois bien le paquet arriver ?

Ma configuration à ce niveau est là même que celle que vous venez de m’envoyer.
De toute façon, l’erreur ne doit pas venir de Postfix étant donné que telnet ne peut pas se connecter du tout.

Si ce n’est pas un blocage par iptables, je ne vois qu’une autre explication : l’interface de loopback lo n’est pas active.
Que dit ifconfig -a ?

Voici le résultat de ifconfig -a :

[code]eth0 Link encap:Ethernet HWaddr 00:22:41:24:08:ea
inet adr:192.168.1.14 Bcast:192.168.1.255 Masque:255.255.255.0
adr inet6: fe80::222:41ff:fe24:8ea/64 Scope:Lien
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:786146 errors:0 dropped:0 overruns:0 frame:0
TX packets:301796 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 lg file transmission:1000
RX bytes:209324423 (199.6 MiB) TX bytes:69098040 (65.8 MiB)
Interruption:17

eth1 Link encap:Ethernet HWaddr 00:21:e9:db:85:7b
adr inet6: fe80::221:e9ff:fedb:857b/64 Scope:Lien
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:176 errors:0 dropped:0 overruns:0 frame:79562
TX packets:176 errors:16937 dropped:0 overruns:0 carrier:0
collisions:0 lg file transmission:1000
RX bytes:19888 (19.4 KiB) TX bytes:25168 (24.5 KiB)
Interruption:16

eth1:avahi Link encap:Ethernet HWaddr 00:21:e9:db:85:7b
inet adr:169.254.10.0 Bcast:169.254.255.255 Masque:255.255.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interruption:16

lo Link encap:Boucle locale
LOOPBACK MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 lg file transmission:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

pan0 Link encap:Ethernet HWaddr 4e:38:44:56:a5:0b
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 lg file transmission:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
[/code]

et le contenu de mon /etc/network/interfaces qui est peut etre mal configuré :

[code]# The loopback network interface
auto lo
iface lo inet loopback

The primary network interface

allow-hotplug eth0
auto eth0
iface eth0 inet dhcp
[/code]

A savoir que je suis connecté en ethernet évidemment

L’interface de loopback est bien inactive. Pourtant le fichier interfaces semble bon.
Que donne “ifup lo” ?

Ahhhhhhh, eh bien, ça marche !
Ouah, merci merci merci, mille fois merci ! :clap:
Je ne m’en sortais plus avec ce problème, bravo.

Merci à vous deux pour l’aide que vous m’avez fourni,
A bientot

Ouais, mais ça n’explique pas pourquoi l’interface lo n’était pas active alors que d’après le fichier interfaces elle aurait dû l’être.

[quote=“sword11”]Ahhhhhhh, eh bien, ça marche !
Ouah, merci merci merci, mille fois merci ! :clap:
Je ne m’en sortais plus avec ce problème, bravo.

Merci à vous deux pour l’aide que vous m’avez fourni,
A bientot[/quote]

Salut,
Résolu ? La coche verte stp!

***** À LIRE AVANT DE POSTER *****