Je suis sous 98.
Je suis connecté au net via un serveur routeur sous linux
Un autre pc est connecté à ce serveur
J'ai installé BPFTPServer.
Il marche bien en local (quand on passe mon @ IP ; pas de redirection de port)
Le pb c'est pour les connexions au ftp server venant de l'extérieur : comment les rediriger ;
Apres avoir tenté plusieurs facon d'ecrire des iptables que j'ai trouvé sur le net, tjs pas moyen par l'exterieur de se connecter à mon serveur ftp. Je donne l'iptable qui devrait marcher normalement mais
qui ne fait rien (6666 est le port du ftp que je veux utiliser):
iptables -t nat -A PREROUTING -p tcp --dport 6666 -j DNAT --to-destination 192.168.0.25:6666
Est-ce correct et suffisant
Pour information je donne le fichier firewall :
# Generated by iptables-save v1.2.5 on Mon Apr 7 00:49:08 2003
*mangle
REROUTING ACCEPT [529571:38907411]
:INPUT ACCEPT [471282:28105438]
:FORWARD ACCEPT [58277:10800029]
:OUTPUT ACCEPT [905217:1307125072]
OSTROUTING ACCEPT [961840:1317827022]
COMMIT
# Completed on Mon Apr 7 00:49:08 2003
# Generated by iptables-save v1.2.5 on Mon Apr 7 00:49:08 2003
*nat
REROUTING ACCEPT [1366:77073]
OSTROUTING DROP [0:0]
:OUTPUT ACCEPT [2336:142428]
## Prerouting pour jeux
# -A PREROUTING -i ppp0 -p tcp -m tcp --dport 1300:3000 -j DNAT --to-destination 192.168.0.100:1300-3000
# -A PREROUTING -i ppp0 -p udp -m udp --dport 1300:3000 -j DNAT --to-destination 192.168.0.100:1300-3000
# -A PREROUTING -i ppp0 -p tcp -m tcp --dport 6073 -j DNAT --to-destination 192.168.0.100:6073
# -A PREROUTING -i ppp0 -p udp -m udp --dport 6073 -j DNAT --to-destination 192.168.0.100:6073
# -A PREROUTING -i ppp0 -p tcp -m tcp --dport 6112 -j DNAT --to-destination 192.168.0.100:6112
# Generated by iptables-save v1.2.5 on Mon Apr 7 00:49:08 2003
*mangle
REROUTING ACCEPT [529571:38907411]
:INPUT ACCEPT [471282:28105438]
:FORWARD ACCEPT [58277:10800029]
:OUTPUT ACCEPT [905217:1307125072]
OSTROUTING ACCEPT [961840:1317827022]
COMMIT
# Completed on Mon Apr 7 00:49:08 2003
# Generated by iptables-save v1.2.5 on Mon Apr 7 00:49:08 2003
*nat
REROUTING ACCEPT [1366:77073]
OSTROUTING DROP [0:0]
:OUTPUT ACCEPT [2336:142428]
## Prerouting pour jeux
# Generated by iptables-save v1.2.5 on Mon Apr 7 00:49:08 2003
*mangle
REROUTING ACCEPT [529571:38907411]
:INPUT ACCEPT [471282:28105438]
:FORWARD ACCEPT [58277:10800029]
:OUTPUT ACCEPT [905217:1307125072]
OSTROUTING ACCEPT [961840:1317827022]
COMMIT
# Completed on Mon Apr 7 00:49:08 2003
# Generated by iptables-save v1.2.5 on Mon Apr 7 00:49:08 2003
*nat
REROUTING ACCEPT [1366:77073]
OSTROUTING DROP [0:0]
:OUTPUT ACCEPT [2336:142428]
## Prerouting pour jeux
# -A PREROUTING -i ppp0 -p tcp -m tcp --dport 1300:3000 -j DNAT --to-destination 192.168.0.100:1300-3000
# -A PREROUTING -i ppp0 -p udp -m udp --dport 1300:3000 -j DNAT --to-destination 192.168.0.100:1300-3000
# -A PREROUTING -i ppp0 -p tcp -m tcp --dport 6073 -j DNAT --to-destination 192.168.0.100:6073
# -A PREROUTING -i ppp0 -p udp -m udp --dport 6073 -j DNAT --to-destination 192.168.0.100:6073
# -A PREROUTING -i ppp0 -p tcp -m tcp --dport 6112 -j DNAT --to-destination 192.168.0.100:6112
# -A PREROUTING -i ppp0 -p tcp -m tcp --dport 4000 -j DNAT --to-destination 192.168.0.100:4000
# -A PREROUTING -i ppp0 -p tcp -m tcp --dport 47624 -j DNAT --to-destination 192.168.0.100:47624
## prerouting julien
-A PREROUTING -i ppp0 -p tcp -m tcp --dport 59 -j DNAT --to-destination 192.168.0.25:5925:59
-A PREROUTING -i ppp0 -p udp -m udp --dport 59 -j DNAT --to-destination 192.168.0.25:5925:59
## Prerouting pour Emule
-A PREROUTING -i ppp0 -p tcp --dport 4661 -j DNAT --to 192.168.1.36:4661
-A PREROUTING -i ppp0 -p udp --dport 4671 -j DNAT --to 192.168.1.36:4671
-A PREROUTING -i ppp0 -p tcp --dport 4662 -j DNAT --to 192.168.1.36:4662
-A PREROUTING -i PPP0 -p udp --dport 4672 -j DNAT --to 192.168.1.36:4672
-A PREROUTING -i PPP0 -p udp --dport 40000 -j DNAT --to 192.168.0.25:40000
-A POSTROUTING -o ppp0 -j MASQUERADE
-A POSTROUTING -o lo -j ACCEPT
-A POSTROUTING -o eth0 -j ACCEPT
-A POSTROUTING -o eth1 -j ACCEPT
-A POSTROUTING -o eth2 -j ACCEPT
##pour le ftp a Xav
-A PREROUTING -i ppp0 -p tcp --dport 6666 -j DNAT --to-destination 192.168.0.25:6666
-A PREROUTING -i ppp0 -p udp --dport 6666 -j DNAT --to-destination 192.168.0.25:6666
-A OUTPUT -o ppp0 -m tcp -p tcp --sport 6666 --dport 6666 -m state --state RELATED,ESTABLISHED -j ACCEPT
-A PREROUTING -p tcp --dport 6666 -d 192.168.1.1 -j DNAT --to-destination 192.168.0.25:6666
COMMIT
# Completed on Mon Apr 7 00:49:08 2003
# Generated by iptables-save v1.2.5 on Mon Apr 7 00:49:08 2003
*filter
## Pour TeamSpeak
-A INPUT -m udp -p udp --sport 1024:65535 --dport 8767 -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT
-A OUTPUT -o ppp0 -m udp -p udp --sport 8767 --dport 1024:65535 -m state --state RELATED,ESTABLISHED -j ACCEPT
##pour zheroez
-A INPUT -m tcp -p tcp --sport 1024:65535 --dport 40000 -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT
-A OUTPUT -o ppp0 -m tcp -p tcp --sport 40000 --dport 1024:65535 -m state --state RELATED,ESTABLISHED -j ACCEPT
:INPUT DROP [209:11339]
:FORWARD DROP [40:2240]
:OUTPUT DROP [1648:104067]
-A INPUT -i eth0 -j ACCEPT
-A INPUT -i eth1 -j ACCEPT
-A INPUT -i eth2 -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p tcp -m tcp --tcp-flags FIN,SYN,RST,PSH,ACK,URG NONE -j DROP
-A INPUT -p tcp -m tcp --tcp-flags FIN,SYN FIN,SYN -j DROP
-A INPUT -p tcp -m tcp --tcp-flags SYN,RST SYN,RST -j DROP
-A INPUT -p tcp -m tcp --tcp-flags FIN,RST FIN,RST -j DROP
-A INPUT -p tcp -m tcp --tcp-flags FIN,ACK FIN -j DROP
-A INPUT -p tcp -m tcp --tcp-flags PSH,ACK PSH -j DROP
-A INPUT -p tcp -m tcp --tcp-flags ACK,URG URG -j DROP
-A INPUT -i ppp0 -m state --state RELATED,ESTABLISHED -j ACCEPT
-A FORWARD -i lo -j ACCEPT
-A FORWARD -i ppp0 -j ACCEPT
-A FORWARD -i eth0 -j ACCEPT
-A FORWARD -i eth1 -j ACCEPT
-A FORWARD -i eth2 -j ACCEPT
-A FORWARD -p tcp -m tcp --tcp-flags FIN,SYN,RST,PSH,ACK,URG NONE -j DROP
-A FORWARD -p tcp -m tcp --tcp-flags FIN,SYN FIN,SYN -j DROP
-A FORWARD -p tcp -m tcp --tcp-flags SYN,RST SYN,RST -j DROP
-A FORWARD -p tcp -m tcp --tcp-flags FIN,RST FIN,RST -j DROP
-A FORWARD -p tcp -m tcp --tcp-flags FIN,ACK FIN -j DROP
-A FORWARD -p tcp -m tcp --tcp-flags PSH,ACK PSH -j DROP
-A FORWARD -p tcp -m tcp --tcp-flags ACK,URG URG -j DROP
-A OUTPUT -o eth0 -j ACCEPT
-A OUTPUT -o eth1 -j ACCEPT
-A OUTPUT -o eth2 -j ACCEPT
-A OUTPUT -o lo -j ACCEPT
-A OUTPUT -p tcp -m tcp --tcp-flags FIN,SYN,RST,PSH,ACK,URG NONE -j DROP
-A OUTPUT -p tcp -m tcp --tcp-flags FIN,SYN FIN,SYN -j DROP
-A OUTPUT -p tcp -m tcp --tcp-flags SYN,RST SYN,RST -j DROP
-A OUTPUT -p tcp -m tcp --tcp-flags FIN,RST FIN,RST -j DROP
-A OUTPUT -p tcp -m tcp --tcp-flags FIN,ACK FIN -j DROP
-A OUTPUT -p tcp -m tcp --tcp-flags PSH,ACK PSH -j DROP
-A OUTPUT -p tcp -m tcp --tcp-flags ACK,URG URG -j DROP
-A OUTPUT -o ppp0 -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT
COMMIT
# Completed on Mon Apr 7 00:49:08 2003
Merci de répondre à ce drame humain ...