OVH Cloud OVH Cloud

firewall & ftp

2 réponses
Avatar
smu
Bonjour,

J'ai du mal à configurer ma passerelle/firewall. Actuellement, je cherche
juste à faire du FTP à partir de cette machine.

Voilà ce que j'ai configuré comme règles :

iptables --append OUTPUT --out-interface eth0 --protocol tcp --source-port
20 \
--match state --state ESTABLISHED,RELATED --jump ACCEPT

iptables --append INPUT --in-interface eth0 --protocol tcp \
--detination-port 20 --match state --state ESTABLISHED \
--jump ACCEPT

iptables --append OUTPUT --out-interface eth0 --protocol tcp --source-port
21 \
--match state --state ESTABLISHED --jump ACCEPT

iptables --append INPUT --in-interface eth0 --protocol tcp \
--detination-port 21 --match state --state ESTABLISHED \
--jump ACCEPT

iptables --append OUTPUT --out-interface eth0 --protocol tcp \
--source-port 1024:65535 --detination-port 1024:65535 --match state \
--state ESTABLISHED,RELATED --jump ACCEPT

iptables --append INPUT --in-interface eth0 --protocol tcp \
--source-port 1024:65535 --detination-port 1024:65535 --match state \
--state ESTABLISHED --jump ACCEPT

J'ai aussi chargé le module ip_conntrack_ftp.

Et voilà ce que j'obtiens après la commande 'ls' :

ftp> ls
227 Entering Passive Mode (x,x,x,x,128,17).
ftp: connect: Connection time out
ftp>

N'ayant pas trouvé la solution avec google, je suppose que quelque chose m'a
échappé dans la configuration d'iptables.

Si une âme charitable pouvait m'aider...

D'avance merci

smu

2 réponses

Avatar
smu
"smu" a écrit dans le message de
news:400bbacd$0$22314$
Bonjour,

J'ai du mal à configurer ma passerelle/firewall. Actuellement, je cherche
juste à faire du FTP à partir de cette machine.

Voilà ce que j'ai configuré comme règles :

iptables --append OUTPUT --out-interface eth0 --protocol tcp --source-port
20
--match state --state ESTABLISHED,RELATED --jump ACCEPT

iptables --append INPUT --in-interface eth0 --protocol tcp
--detination-port 20 --match state --state ESTABLISHED
--jump ACCEPT

iptables --append OUTPUT --out-interface eth0 --protocol tcp --source-port
21
--match state --state ESTABLISHED --jump ACCEPT

iptables --append INPUT --in-interface eth0 --protocol tcp
--detination-port 21 --match state --state ESTABLISHED
--jump ACCEPT

iptables --append OUTPUT --out-interface eth0 --protocol tcp
--source-port 1024:65535 --detination-port 1024:65535 --match state
--state ESTABLISHED,RELATED --jump ACCEPT

iptables --append INPUT --in-interface eth0 --protocol tcp
--source-port 1024:65535 --detination-port 1024:65535 --match state
--state ESTABLISHED --jump ACCEPT

J'ai aussi chargé le module ip_conntrack_ftp.

Et voilà ce que j'obtiens après la commande 'ls' :

ftp> ls
227 Entering Passive Mode (x,x,x,x,128,17).
ftp: connect: Connection time out
ftp>

N'ayant pas trouvé la solution avec google, je suppose que quelque chose
m'a

échappé dans la configuration d'iptables.

Si une âme charitable pouvait m'aider...

D'avance merci

smu


En creusant un peu, j'ai réussi à me connecter en le modifiant comme
ci-dessous :

iptables --append OUTPUT --out-interface eth0 --protocol tcp --source-port
20
--match state --state ESTABLISHED,RELATED --jump ACCEPT

iptables --append INPUT --in-interface eth0 --protocol tcp
--detination-port 20 --match state --state ESTABLISHED
--jump ACCEPT

iptables --append OUTPUT --out-interface eth0 --protocol tcp --source-port
21
--match state --state ESTABLISHED --jump ACCEPT

iptables --append INPUT --in-interface eth0 --protocol tcp
--detination-port 21 --match state --state ESTABLISHED
--jump ACCEPT

iptables --append OUTPUT --out-interface eth0 --protocol tcp
--source-port 1024:65535 --detination-port 1024:65535 --jump ACCEPT

iptables --append INPUT --in-interface eth0 --protocol tcp
--source-port 1024:65535 --detination-port 1024:65535 --jump ACCEPT

Mais cela me semble trop permissif.

Est ce que l'un d'entre vous à une idée sur la chose.

D'avance merci

smu

Avatar
MH
Pour configurer iptables, il existe un utilitaire (mode X) assez sympathique
:
Firewall Builder (fwbuilder)
Pour les fainéants comme moi, c'est l'idéale !
MH