[Iptables] Besoin d'aide à sa configuration

J’ai découvert ce menu avec ton screen et en scrutant le manager d’OVH :/.

En rebootant le serveur je me rend compte que mon principale service, http, ne fonctionne pas:

[quote]koshie@Sirius:~$ sudo iptables -L -v
sudo: unable to resolve host Sirius
Chain INPUT (policy DROP 30 packets, 2784 bytes)
pkts bytes target prot opt in out source destination
0 0 ACCEPT udp – any any anywhere anywhere udp dpt:64738
0 0 ACCEPT tcp – any any anywhere anywhere tcp dpt:64738
6388 15M ACCEPT all – any any anywhere anywhere state RELATED,ESTABLISHED
25 1530 ACCEPT all – lo any anywhere anywhere
5 420 ACCEPT icmp – any any anywhere anywhere
2 120 ACCEPT tcp – any any anywhere anywhere tcp dpt:ssh
0 0 ACCEPT tcp – any any anywhere anywhere tcp dpt:domain
0 0 ACCEPT udp – any any anywhere anywhere udp dpt:domain

Chain FORWARD (policy DROP 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination

Chain OUTPUT (policy DROP 266 packets, 47951 bytes)
pkts bytes target prot opt in out source destination
5459 431K ACCEPT all – any any anywhere anywhere state RELATED,ESTABLISHED
25 1530 ACCEPT all – any lo anywhere anywhere
0 0 ACCEPT icmp – any any anywhere anywhere
0 0 ACCEPT tcp – any any anywhere anywhere tcp dpt:ssh
0 0 ACCEPT tcp – any any anywhere anywhere tcp dpt:domain
217 15584 ACCEPT udp – any any anywhere anywhere udp dpt:domain
0 0 ACCEPT udp – any any anywhere anywhere udp dpt:ntp
4 240 ACCEPT tcp – any any anywhere anywhere tcp dpt:http
0 0 ACCEPT tcp – any any anywhere anywhere tcp dpt:https
[/quote]

Or depuis le problème ma config n’a bien évidemment pas été modifié. Et nginx tourne:

[quote]koshie@Sirius:~$ sudo service nginx status
[ ok ] nginx is running.
[/quote]

Encore quelque chose qui foire, mais SSH marche au moins.

Comme les logs ne réagissent pas j’en conclus (en néophyte toujours) que le service n’est même pas contacté?

Re,
Tu devrais plutôt donner la sortie de:

[code]# Generated by iptables-save v1.4.14 on Mon Apr 29 17:32:32 2013
*raw
:PREROUTING ACCEPT [7631]
:OUTPUT ACCEPT [7074:683767]
COMMIT

Completed on Mon Apr 29 17:32:32 2013

Generated by iptables-save v1.4.14 on Mon Apr 29 17:32:32 2013

*nat
:PREROUTING ACCEPT [735:62325]
:INPUT ACCEPT [38:3144]
:OUTPUT ACCEPT [1279:209424]
:POSTROUTING ACCEPT [292:20465]
COMMIT

Completed on Mon Apr 29 17:32:32 2013

Generated by iptables-save v1.4.14 on Mon Apr 29 17:32:32 2013

*mangle
:PREROUTING ACCEPT [7631]
:INPUT ACCEPT [7631]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [7076:684207]
:POSTROUTING ACCEPT [6089:495248]
COMMIT

Completed on Mon Apr 29 17:32:32 2013

Generated by iptables-save v1.4.14 on Mon Apr 29 17:32:32 2013

*filter
:INPUT DROP [697:59097]
:FORWARD DROP [0:0]
:OUTPUT DROP [987:188959]
-A INPUT -p udp -m udp --dport 64738 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 64738 -j ACCEPT
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 53 -j ACCEPT
-A INPUT -p udp -m udp --dport 53 -j ACCEPT
-A OUTPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A OUTPUT -o lo -j ACCEPT
-A OUTPUT -p icmp -j ACCEPT
-A OUTPUT -p tcp -m tcp --dport 22 -j ACCEPT
-A OUTPUT -p tcp -m tcp --dport 53 -j ACCEPT
-A OUTPUT -p udp -m udp --dport 53 -j ACCEPT
-A OUTPUT -p udp -m udp --dport 123 -j ACCEPT
-A OUTPUT -p tcp -m tcp --dport 80 -j ACCEPT
-A OUTPUT -p tcp -m tcp --dport 443 -j ACCEPT
COMMIT

Completed on Mon Apr 29 17:32:32 2013

[/code]

Non, c’était juste pour exprimer mon étonnement qu’on ait besoin d’un tutoriel pour tout ouvrir (avec un peu d’ironie certes, je ne peux pas m’en empêcher). Par contre je comprends très bien que tu aies voulu supprimer tout filtrage, afin de retrouver l’accès total à ton serveur.

Normal, ton script ne crée pas de règle acceptant le port TCP 80 ni 443 dans INPUT.

Bah je t’avouerai que je rebute à chercher dans les “entrailles” d’une doc officiel qui sont parfois laborieuse (pour pas forcement grand chose à faire). Donc un tuto c’est pratique, mais manifestement celui-ci à un problème puisque je l’ai copié/collé et j’ai juste ajouté la partie Mumble.

J’ai essayé les commandes suivantes:

Et ça fonctionne, elles sont donc ajouté à mon /etc/init.d/firewall et je vais redémarrer pour tester. Je testerai ensuite mon irssi et mumble afin de m’assurer que tout marche.

Je vais aussi le signaler à l’auteur du tuto.

Merci

Irssi le client IRC ? Je n’ai pas vu de règle pour le port IRC (6667 par défaut).

Maintenant, si:

[quote]# IRC

irc.lolipower.org

iptables -t filter -A OUTPUT -p tcp --dport 9999 -j ACCEPT

euroserv.fr.quakenet.org

iptables -t filter -A OUTPUT -p tcp --dport 6667 -j ACCEPT

irc.epiknet.org

iptables -t filter -A OUTPUT -p tcp --dport 7002 -j ACCEPT

irc.freenode.org

iptables -t filter -A OUTPUT -p tcp --dport 7000 -j ACCEPT[/quote]

Après reboot, it works :wink: !

Merci

Affaire résolue ?
si oui ==> coche verte.