Log in

Bekijk de volledige versie : wl-700ge + kamikaze/x-wrt: wie ports für emule/bittorrent freigeben



nice
13-05-2009, 18:21
ich hab kamikaze 7.09 mit x-wrt und mldonkey.
doch egal ob ich regeln in der iptables.conf mache
#!/bin/sh
# Copyright (C) 2006 OpenWrt.org

IF=ppp0
IPTABLES=iptables
MLDONKEY_HOST=192.168.1.1
EDONKEY_PORT=4662
KAD_PORT=8443
OVERNET_PORT=5865
BITTORRENT_PORT=6882
OPENNAP_PORT=9999

iptables -F input_rule
iptables -F output_rule
iptables -F forwarding_rule
iptables -t nat -F prerouting_rule
iptables -t nat -F postrouting_rule

# The following chains are for traffic directed at the IP of the
# WAN interface

iptables -F input_wan
iptables -F forwarding_wan
iptables -t nat -F prerouting_wan

### Open port to WAN
## -- This allows port 22 to be answered by (dropbear on) the router
# iptables -t nat -A prerouting_wan -p tcp --dport 22 -j ACCEPT
# iptables -A input_wan -p tcp --dport 22 -j ACCEPT

### Port forwarding
## -- This forwards port 8080 on the WAN to port 80 on 192.168.1.2
# iptables -t nat -A prerouting_wan -p tcp --dport 8080 -j DNAT --to 192.168.1.2:80
# iptables -A forwarding_wan -p tcp --dport 80 -d 192.168.1.2 -j ACCEPT

#donkey nach .ini
iptables -t nat -A prerouting_wan -p tcp --dport 19019 -j DNAT --to 192.168.1.1
iptables -A forwarding_wan -p tcp --dport 19019 -d 192.168.1.1 -j ACCEPT
iptables -t nat -A prerouting_wan -p tcp --dport 20861 -j DNAT --to 192.168.1.1
iptables -A forwarding_wan -p tcp --dport 20861 -d 192.168.1.1 -j ACCEPT
iptables -t nat -A prerouting_wan -p tcp --dport 9336 -j DNAT --to 192.168.1.1
iptables -A forwarding_wan -p tcp --dport 9336 -d 192.168.1.1 -j ACCEPT
iptables -t nat -A prerouting_wan -p tcp --dport 4662 -j DNAT --to 192.168.1.1
iptables -A forwarding_wan -p tcp --dport 4662 -d 192.168.1.1 -j ACCEPT
iptables -t nat -A prerouting_wan -p tcp --dport 4661 -j DNAT --to 192.168.1.1
iptables -A forwarding_wan -p tcp --dport 4661 -d 192.168.1.1 -j ACCEPT
iptables -t nat -A prerouting_wan -p tcp --dport 9510 -j DNAT --to 192.168.1.1
iptables -A forwarding_wan -p tcp --dport 9510 -d 192.168.1.1 -j ACCEPT

iptables -t nat -A prerouting_wan -p udp --dport 19019 -j DNAT --to 192.168.1.1
iptables -A forwarding_wan -p udp --dport 19019 -d 192.168.1.1 -j ACCEPT
iptables -t nat -A prerouting_wan -p udp --dport 20861 -j DNAT --to 192.168.1.1
iptables -A forwarding_wan -p udp --dport 20861 -d 192.168.1.1 -j ACCEPT
iptables -t nat -A prerouting_wan -p udp --dport 9336 -j DNAT --to 192.168.1.1
iptables -A forwarding_wan -p udp --dport 9336 -d 192.168.1.1 -j ACCEPT
iptables -t nat -A prerouting_wan -p udp --dport 4662 -j DNAT --to 192.168.1.1
iptables -A forwarding_wan -p udp --dport 4662 -d 192.168.1.1 -j ACCEPT
iptables -t nat -A prerouting_wan -p udp --dport 4661 -j DNAT --to 192.168.1.1
iptables -A forwarding_wan -p udp --dport 4661 -d 192.168.1.1 -j ACCEPT
iptables -t nat -A prerouting_wan -p udp --dport 9510 -j DNAT --to 192.168.1.1
iptables -A forwarding_wan -p udp --dport 9510 -d 192.168.1.1 -j ACCEPT


## MLDonkey acting as Edonkey2000 client
$IPTABLES -I FORWARD -p tcp --dport $EDONKEY_PORT -j ACCEPT
$IPTABLES -I FORWARD -p udp --dport $(($EDONKEY_PORT + 4)) -j ACCEPT
$IPTABLES -t nat -I PREROUTING -i $IF -p tcp --dport $EDONKEY_PORT -j DNAT --to-destination $MLDONKEY_HOST
$IPTABLES -t nat -I PREROUTING -i $IF -p udp --dport $(($EDONKEY_PORT + 4)) -j DNAT --to-destination $MLDONKEY_HOST

## MLDonkey acting as Kad client
$IPTABLES -I FORWARD -p tcp --dport $KAD_PORT -j ACCEPT
$IPTABLES -I FORWARD -p udp --dport $KAD_PORT -j ACCEPT
$IPTABLES -t nat -I PREROUTING -i $IF -p tcp --dport $KAD_PORT -j DNAT --to-destination $MLDONKEY_HOST
$IPTABLES -t nat -I PREROUTING -i $IF -p udp --dport $KAD_PORT -j DNAT --to-destination $MLDONKEY_HOST

## MLDonkey acting as Overnet client
$IPTABLES -I FORWARD -p tcp --dport $OVERNET_PORT -j ACCEPT
$IPTABLES -I FORWARD -p udp --dport $OVERNET_PORT -j ACCEPT
$IPTABLES -t nat -I PREROUTING -i $IF -p tcp --dport $OVERNET_PORT -j DNAT --to-destination $MLDONKEY_HOST
$IPTABLES -t nat -I PREROUTING -i $IF -p udp --dport $OVERNET_PORT -j DNAT --to-destination $MLDONKEY_HOST

## MLDonkey acting as Edonkey2000 server
# $IPTABLES -I FORWARD -p tcp --dport $(($EDONKEY_PORT - 1)) -j ACCEPT
# $IPTABLES -t nat -I PREROUTING -i $IF -p tcp --dport $(($EDONKEY_PORT - 1)) -j DNAT --to-destination $MLDONKEY_HOST

## MLDonkey acting as BitTorrent client
$IPTABLES -I FORWARD -p tcp --dport $BITTORRENT_PORT -j ACCEPT
$IPTABLES -t nat -I PREROUTING -i $IF -p tcp --dport $BITTORRENT_PORT -j DNAT --to-destination $MLDONKEY_HOST

## MLDonkey acting as OpenNap client
$IPTABLES -I FORWARD -p tcp --dport $OPENNAP_PORT -j ACCEPT
$IPTABLES -t nat -I PREROUTING -i $IF -p tcp --dport $OPENNAP_PORT -j DNAT --to-destination $MLDONKEY_HOST


### DMZ
## -- Connections to ports not handled above will be forwarded to 192.168.1.2
# iptables -t nat -A prerouting_wan -j DNAT --to 192.168.1.2
# iptables -A forwarding_wan -d 192.168.1.2 -j ACCEPT


oder meinetwegen im webinterface gleich mal ne portrange von 4000-10000 auf 192.168.1.1 weiterleiten lasse ... irgendwie mag mldonkey nur mit lowid bzw torrent garnicht.

heisst: wahrscheinlich ist kein port offen...
was ist jetzt falsch ?

wenn ihr ne lösung wisst, verwerf ich auch gern meine komplett - ich verzweifel langsam an dem mist

nice
30-05-2009, 23:25
kommt schon, kann doch nicht sein, dass keiner ne ahnung hat

newbiefan
31-05-2009, 12:24
Naja, ich brauche das alles nicht........

Aber was mir so ad hoc auffällt:
1.) iptables=/usr/sbin/iptables (verifizieren ob in kamikaze gleich)
2.) Es werden keine Chains angelegt, deine Chains werden ja nur geleert.
z.Bspl.: $iptables -N deinechains
3.) Es werden auch keine eigenen Chains gelöscht.
$iptables -X
4.) Und dann fehlt auch noch der Aufruf deiner chains, z.Bspl. auf der INPUT Seite: $iptables -A INPUT -j deinechain
Das musst du für alle Hauptchains machen.

Gib einmal ein: /usr/sbin/iptables -nv -L
und poste die Ausgabe.
Mit diesem Befehl kannst Du deine iptables Einstellung sehen.
Zum besseren Verständnis lege ich dir einen Script (avbf) bei - dabei wird
nur die INPUT Chain umgeleitet - im Prinzip machst du das gleiche für alle relevanten Chains. Dann rufst du bei startup den script auf, vorausgesetzt du hast ihn ausführbar gemacht (chmod 755 /deinpfad/deinscript).
Beachte, dass alle Regeln streng von oben nach unten abgearbeitet werden.
Ich empfehle dringend, dich etwas in iptables einzulesen.

Viel Spass