Trafic vers l'extérieur complètement bloqué!

Configuration de mon YunoHost

Matériel: Cubox-i4 Pro + disque externe
Accès Internet: ethernet à la maison
YunoHost version:
yunohost: 3.3.4
yunohost-admin: 3.3.1
moulinette: 3.3.1
ssowat: 3.3.2
As tu modifié ton yunohost avec des configuration spécifiques ou bien utilise tu uniquement la web administration et/ou la ligne de commande yunohost ? basique

Description de mon problème

J’accumule les déboires en ce moment :tired_face:
Mon serveur ne semble plus résoudre les noms de domaines. Je vous colle ci-dessous ce que j’ai investigué.

[le problème est plus large, cf message #7]

# ping 9.9.9.9
PING 9.9.9.9 (9.9.9.9) 56(84) bytes of data.
64 bytes from 9.9.9.9: icmp_seq=1 ttl=53 time=45.6 ms
64 bytes from 9.9.9.9: icmp_seq=2 ttl=53 time=45.1 ms
^C
--- 9.9.9.9 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 45.196/45.399/45.602/0.203 ms

# ping google.fr
ping: google.fr: Temporary failure in name resolution

# ll /etc/resolv.conf
lrwxrwxrwx 1 root root 31 Jan 18 21:28 /etc/resolv.conf -> /etc/resolvconf/run/resolv.conf

# more /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 192.168.1.1
search monDomaine.fr

# systemctl status dnsmasq.service  
● dnsmasq.service - dnsmasq - A lightweight DHCP and caching DNS server
   Loaded: loaded (/lib/systemd/system/dnsmasq.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Fri 2019-01-18 22:46:57 CET; 24s ago
Process: 4364 ExecStart=/etc/init.d/dnsmasq systemd-exec (code=exited, status=2)
Process: 4361 ExecStartPre=/usr/sbin/dnsmasq --test (code=exited, status=0/SUCCESS)

Jan 18 22:46:57 systemd[1]: Starting dnsmasq - A lightweight DHCP and caching DNS server...
Jan 18 22:46:57 dnsmasq[4361]: dnsmasq: syntax check OK.
Jan 18 22:46:57 dnsmasq[4364]: dnsmasq: failed to create listening socket for port 53: Address already in use
Jan 18 22:46:57 systemd[1]: dnsmasq.service: Control process exited, code=exited status=2
Jan 18 22:46:57 systemd[1]: Failed to start dnsmasq - A lightweight DHCP and caching DNS server.
Jan 18 22:46:57 systemd[1]: dnsmasq.service: Unit entered failed state.
Jan 18 22:46:57 systemd[1]: dnsmasq.service: Failed with result 'exit-code'.

Que tester pour avancer sur le sujet ?

Car, avec ce soucis :

  • je n’ai plus de mise à jour système
  • le service de mail semble en berne
  • transmission ne fonctionne plus

Merci beaucoup !

si tu changes ton fichier resolv avec:
nameserver 127.0.0.1
cela te donne quoi?

1 Like

Dans resolv.conf, j’ai remplacé
nameserver 192.168.1.1
par
nameserver 127.0.0.1

Faut-il lancer une commande pour que cela soit pris en compte ?
Car juste après, cela ne change rien :
# ping yunohost.org
ping: yunohost.org: Temporary failure in name resolution

C’est possiblement un probleme de cache

Si tu tente avec un nom de domaine pour lequel tu n’as pas tenté de résolution dans les minutes précédentes, cela devrait fonctionner (par exemple, wikipedia.org)

Par contre, c’est curieux que namesever 127.0.0.1 n’était pas déja présent dans le /etc/resolv.conf car le service resolvconf est censé s’en assurer …

Par rapport au nameserver exotique dans resolv.conf, c’est peut être moi qui avais mis cela en bidouillant…

En creusant j’ai remarqué que bind9 était installé sur la machine et était en conflit avec dnsmask. J’ai désinstallé bind9 et maintenant dnsmask fonctionne. Mais je n’ai toujours pas de résolution de noms qui fonctionne.

Perso je dirais que c’est lié à Bind9 du coup …

Le problème semble plus grave. En fait, apparemment tout le trafic sortant semble bloqué. Par exemple, je ne peux pas me connecter en ssh sur mon routeur (alors que cela fonctionne depuis un autre poste). Seul le ping vers l’extérieur fonctionne, si je spécifie une adresse IP :

# ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=121 time=35.4 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=121 time=34.0 ms

# host linuxfr.org 8.8.8.8 
;; connection timed out; no servers could be reached

Un problème de IPtable ?

# iptables -L
Chain INPUT (policy DROP)
target     prot opt source               destination         
f2b-pam-generic  tcp  --  anywhere             anywhere            
f2b-recidive  tcp  --  anywhere             anywhere            
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:ssh
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:smtp
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:domain
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:http
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:https
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:imaps
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:xmpp-client
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:xmpp-server
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:5290
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:51413
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:6600
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:nfs
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:32765
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:32766
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:32767
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:submission
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:8000
ACCEPT     udp  --  anywhere             anywhere             udp dpt:domain
ACCEPT     udp  --  anywhere             anywhere             udp dpt:6600
ACCEPT     udp  --  anywhere             anywhere             udp dpt:nfs
ACCEPT     udp  --  anywhere             anywhere             udp dpt:32765
ACCEPT     udp  --  anywhere             anywhere             udp dpt:32766
ACCEPT     udp  --  anywhere             anywhere             udp dpt:32767
ACCEPT     udp  --  anywhere             anywhere             udp dpt:51413
ACCEPT     udp  --  anywhere             anywhere             udp dpt:587
ACCEPT     udp  --  anywhere             anywhere             udp dpt:8000
ACCEPT     all  --  anywhere             anywhere            
ACCEPT     icmp --  anywhere             anywhere            

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         

Chain f2b-dovecot (0 references)
target     prot opt source               destination         
RETURN     all  --  anywhere             anywhere            

Chain f2b-nginx-http-auth (0 references)
target     prot opt source               destination         
RETURN     all  --  anywhere             anywhere            

Chain f2b-pam-generic (1 references)
target     prot opt source               destination         
RETURN     all  --  anywhere             anywhere            

Chain f2b-postfix (0 references)
target     prot opt source               destination         
RETURN     all  --  anywhere             anywhere            

Chain f2b-postfix-sasl (0 references)
target     prot opt source               destination         
RETURN     all  --  anywhere             anywhere            

Chain f2b-recidive (1 references)
target     prot opt source               destination         
RETURN     all  --  anywhere             anywhere            

Chain f2b-sshd (0 references)
target     prot opt source               destination         
RETURN     all  --  anywhere             anywhere            

Chain f2b-sshd-ddos (0 references)
target     prot opt source               destination         
RETURN     all  --  anywhere             anywhere            

Chain f2b-yunohost (0 references)
target     prot opt source               destination         
RETURN     all  --  anywhere             anywhere



# iptables -S
-P INPUT DROP
-P FORWARD ACCEPT
-P OUTPUT ACCEPT
-N f2b-dovecot
-N f2b-nginx-http-auth
-N f2b-pam-generic
-N f2b-postfix
-N f2b-postfix-sasl
-N f2b-recidive
-N f2b-sshd
-N f2b-sshd-ddos
-N f2b-yunohost
-A INPUT -p tcp -j f2b-pam-generic
-A INPUT -p tcp -j f2b-recidive
-A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 25 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 53 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 443 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 993 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 5222 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 5269 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 5290 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 51413 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 6600 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 2049 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 32765 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 32766 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 32767 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 587 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 8000 -j ACCEPT
-A INPUT -p udp -m udp --dport 53 -j ACCEPT
-A INPUT -p udp -m udp --dport 6600 -j ACCEPT
-A INPUT -p udp -m udp --dport 2049 -j ACCEPT
-A INPUT -p udp -m udp --dport 32765 -j ACCEPT
-A INPUT -p udp -m udp --dport 32766 -j ACCEPT
-A INPUT -p udp -m udp --dport 32767 -j ACCEPT
-A INPUT -p udp -m udp --dport 51413 -j ACCEPT
-A INPUT -p udp -m udp --dport 587 -j ACCEPT
-A INPUT -p udp -m udp --dport 8000 -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A f2b-dovecot -j RETURN
-A f2b-nginx-http-auth -j RETURN
-A f2b-pam-generic -j RETURN
-A f2b-postfix -j RETURN
-A f2b-postfix-sasl -j RETURN
-A f2b-recidive -j RETURN
-A f2b-sshd -j RETURN
-A f2b-sshd-ddos -j RETURN
-A f2b-yunohost -j RETURN

Problème réglé \o/

Rien de lié à Yunohost, le problème venait du fait que je chargeais un noyau déprécié par Armbian, dont certains modules n’étaient plus présents sur ma machine…

Merci à ceux qui ont tenté de m’aider.
Le mieux serait peut être de supprimer tout le fil, car il n’y a aucun intérêt à archiver cela…

1 Like