Network troubleshooting: Difference between revisions

From miki
Jump to navigation Jump to search
m (Mip moved page Network to Network troubleshooting: There are already a network page. This one is only about troubleshooting.)
Line 9: Line 9:
<source lang=bash>
<source lang=bash>
nc localhost 25
nc localhost 25
# 220 www.immie.org ESMTP Exim 4.84_2 Mon, 06 Jun 2016 20:28:47 +0200
</source>
</source>
220 www.immie.org ESMTP Exim 4.84_2 Mon, 06 Jun 2016 20:28:47 +0200


But when using the IP address, it does not work:
But when using the IP address, it does not work:
<source lang=bash>
<source lang=bash>
nc immie.org 25
nc -v -v www.immie.org 25
# DNS fwd/rev mismatch: www.immie.org != vps282013.ovh.net
# immie.org [91.134.134.85] 25 (smtp) : Connection refused
# sent 0, rcvd 0
</source>
</source>
immie.org [91.134.134.85] 25 (smtp) : Connection refused


The firewall is configured to accept connections though:
The firewall is configured to accept connections though:
<source lang=bash>
<source lang=bash>
iptables -L|grep smtp
iptables -L|grep smtp
# ACCEPT tcp -- anywhere anywhere tcp multiport dports smtp,submission
</source>
</source>
ACCEPT tcp -- anywhere anywhere tcp multiport dports smtp,submission


In fact, we have a DNS issue:
But in fact, exim only listens to localhost interface:
<source lang=bash>
<source lang=bash>
netstat -lpn|grep 25
nc -v -v immie.org 25
# tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 23236/exim4
# tcp6 0 0 ::1:25 :::* LISTEN 23236/exim4
</source>

So we must reconfigure exim4 to accept connection from any interface. Reconfigure exim4 and make sure that local interface field is empty:
<lang=bash>
dpkg-reconfigure exim4-config
grep dc_local_interfaces /etc/exim4/update-exim4.conf.conf
# dc_local_interfaces=''
</lang=bash>

'''Note''': The <code>DNS fwd/rev</code> mismatch actually comes from a wrong {{file|/etc/hosts}} configuration. This file still contained the old host name:
<source lang=bash>
cat /etc/hosts
# 127.0.0.1 localhost
# 91.134.134.85 vps282013.ovh.net vps282013
</source>
</source>
DNS fwd/rev mismatch: immie.org != vps282013.ovh.net
immie.org [91.134.134.85] 25 (smtp) : Connection refused
sent 0, rcvd 0

Revision as of 06:23, 8 June 2016

Troubleshooting network issues

  • Ping DNS server
8.8.8.8       Google DNS server
195.238.2.21  Belgacom DNS server
  • Ping gateway (see netroute)

Can't connect to SMTP server

I can connect to smtp server locally:

nc localhost 25
# 220 www.immie.org ESMTP Exim 4.84_2 Mon, 06 Jun 2016 20:28:47 +0200

But when using the IP address, it does not work:

nc -v -v www.immie.org 25
# DNS fwd/rev mismatch: www.immie.org != vps282013.ovh.net
# immie.org [91.134.134.85] 25 (smtp) : Connection refused
# sent 0, rcvd 0

The firewall is configured to accept connections though:

iptables -L|grep smtp
# ACCEPT     tcp  --  anywhere             anywhere             tcp multiport dports smtp,submission

But in fact, exim only listens to localhost interface:

netstat -lpn|grep 25
# tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      23236/exim4
# tcp6       0      0 ::1:25                  :::*                    LISTEN      23236/exim4

So we must reconfigure exim4 to accept connection from any interface. Reconfigure exim4 and make sure that local interface field is empty: <lang=bash> dpkg-reconfigure exim4-config grep dc_local_interfaces /etc/exim4/update-exim4.conf.conf

  1. dc_local_interfaces=

</lang=bash>

Note: The DNS fwd/rev mismatch actually comes from a wrong /etc/hosts configuration. This file still contained the old host name:

cat /etc/hosts
# 127.0.0.1       localhost
# 91.134.134.85   vps282013.ovh.net vps282013