Linux Gurus: HELP configure seedbox

Discussion in 'OT Technology' started by SiempreFresco, Mar 25, 2009.

  1. SiempreFresco

    SiempreFresco New Member

    Joined:
    Jun 16, 2003
    Messages:
    7,142
    Likes Received:
    0
    Location:
    NYC
    So I'm trying to setup a webserver/seedbox with Debian 5 runnning.

    Trying to run utorrent with the WEBui. Problem is I've been getting shitty speeds on my torrents because I don't know what the fuck I'm doing with the iptables.

    Here is my iptable:
    Chain INPUT (policy ACCEPT)
    target prot opt source destination
    ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
    ACCEPT tcp -- dyn-river-232-158.dyn.columbia.edu www.domainname.com tcp dpt:ssh
    ACCEPT tcp -- dyn-river-232-158.dyn.columbia.edu webadmin.netwebsupport.com tcp dpt:ssh
    ACCEPT tcp -- anywhere webadmin.netwebsupport.com tcp dpt:ssh
    ACCEPT tcp -- anywhere webadmin.netwebsupport.com tcp dpt:smtp
    ACCEPT tcp -- anywhere webadmin.netwebsupport.com tcp dpts:ftp-data:ftp
    ACCEPT tcp -- anywhere webadmin.netwebsupport.com tcp dpt:www
    ACCEPT tcp -- anywhere webadmin.netwebsupport.com tcp dpt:https
    ACCEPT tcp -- anywhere webadmin.netwebsupport.com tcp dpt:imap2
    ACCEPT tcp -- anywhere webadmin.netwebsupport.com tcp dpt:imaps
    ACCEPT tcp -- anywhere webadmin.netwebsupport.com tcp dpt:pop3
    ACCEPT tcp -- anywhere webadmin.netwebsupport.com tcp dpt:pop3s
    ACCEPT all -- localhost webadmin.netwebsupport.com
    ACCEPT tcp -- anywhere webadmin.netwebsupport.com tcp dpts:6881:6999
    ACCEPT tcp -- anywhere webadmin.netwebsupport.com tcp dpts:6881:6999
    ACCEPT tcp -- anywhere webadmin.netwebsupport.com tcp dpts:5900:5908
    ACCEPT tcp -- anywhere anywhere tcp dpts:6881:6999

    Chain FORWARD (policy ACCEPT)
    target prot opt source destination
    ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
    ACCEPT tcp -- www.domainname.com anywhere tcp dpts:6881:6889

    Chain OUTPUT (policy ACCEPT)
    target prot opt source destination
    ACCEPT all -- anywhere anywhere state NEW,RELATED,ESTABLISHED
    ACCEPT tcp -- anywhere anywhere tcp dpts:6881:6999

    Here are the commands I used to build this table:
    # iptables -A INPUT -s 160.39.232.158 -d 72.68.151.54 -p tcp --dport 22 -j ACCEPT

    SSH:
    # iptables -A INPUT -d webadmin.netwebsupport.com -p tcp --dport 22 -j ACCEPT

    Sendmail/Postfix:
    # iptables -A INPUT -d webadmin.netwebsupport.com -p tcp --dport 25 -j ACCEPT

    FTP: (Notice how you can specify a range of ports 20-21)
    # iptables -A INPUT -d webadmin.netwebsupport.com -p tcp --dport 20:21 -j ACCEPT

    Passive FTP Ports Maybe: (Again, specifying ports 50000 through 50050 in one rule)
    # iptables -A INPUT -d webadmin.netwebsupport.com -p tcp --dport 50000:50050 -j ACCEPT

    HTTP/Apache
    # iptables -A INPUT -d webadmin.netwebsupport.com -p tcp --dport 80 -j ACCEPT

    SSL/Apache
    # iptables -A INPUT -d webadmin.netwebsupport.com -p tcp --dport 443 -j ACCEPT

    IMAP
    # iptables -A INPUT -d webadmin.netwebsupport.com -p tcp --dport 143 -j ACCEPT

    IMAPS
    # iptables -A INPUT -d webadmin.netwebsupport.com -p tcp --dport 993 -j ACCEPT

    POP3
    # iptables -A INPUT -d webadmin.netwebsupport.com -p tcp --dport 110 -j ACCEPT

    POP3S
    # iptables -A INPUT -d webadmin.netwebsupport.com -p tcp --dport 995 -j ACCEPT

    Any Traffic From Localhost:
    # iptables -A INPUT -d webadmin.netwebsupport.com -s 127.0.0.1 -j ACCEPT

    Torrent:
    # iptables -A INPUT -d webadmin.netwebsupport.com -p tcp --dport 6881:6999 -j ACCEPT

    VNC:
    # iptables -A INPUT -d webadmin.netwebsupport.com -p tcp --dport 5900:5908 -j ACCEPT


    Torrent stuff:
    iptables -A INPUT -p tcp --destination-port 6881:6999 -j ACCEPT
    iptables -A OUTPUT -p tcp --source-port 6881:6999 -j ACCEPT
    iptables -t nat -A PREROUTING -p tcp --dport 6881:6889 -j DNAT --to-destination 192.168.2.54
    iptables -A FORWARD -s 192.168.2.54 -p tcp --dport 6881:6889 -j ACCEPT


    I get decent down, but nowhere near where it should be, but absolutely no up speed.

    This is my first time messing with a linux server. Any suggestions?
     

Share This Page