Results 1 to 3 of 3

Thread: wl-700ge + kamikaze/x-wrt: wie ports für emule/bittorrent freigeben

  1. #1

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

    ich hab kamikaze 7.09 mit x-wrt und mldonkey.
    doch egal ob ich regeln in der iptables.conf mache
    Code:
    #!/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

  2. #2
    kommt schon, kann doch nicht sein, dass keiner ne ahnung hat

  3. #3
    Join Date
    Jul 2007
    Location
    Austria
    Posts
    1,336
    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
    Attached Files Attached Files
    Alle HowTo's, all howto's

    RT-N16 1.9.2.7-rtn-r3121, Samba, VSFTP, Lightthpd, PHP, Perl, MySQL, Serendipity, Aria2web, HDD 640GB
    RT-N66U, 16GB MicroSD/ 2 Partitions, 2,5" HDD 1TB, running with Merlin's FW and Entware, 16 Mbit A1,
    Netgear DGND 3700V2, QNAP TS119PII 4 TB, QNAP TS209 2 TB Raid1, Backup Synology DS107+ 1 TB, HP CP1515n

Similar Threads

  1. Replies: 7
    Last Post: 09-12-2008, 19:19
  2. W500g Premium: Mehrere Ports freigeben
    By VfB2007 in forum German Discussion - Deutsch (DE)
    Replies: 2
    Last Post: 31-05-2007, 23:55
  3. Wie den roten Knopf am router für Befehl nutzen?
    By DaSonix in forum German Discussion - Deutsch (DE)
    Replies: 6
    Last Post: 22-04-2007, 15:36
  4. Ports forwarden,aber wie ? beim WL-500gP
    By berndeckstein in forum German Discussion - Deutsch (DE)
    Replies: 0
    Last Post: 25-01-2007, 12:01
  5. Spiele Ports freigeben in dem Fall FIFA 06
    By heNNeBorG in forum German Discussion - Deutsch (DE)
    Replies: 2
    Last Post: 24-03-2006, 22:45

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •