port forwarding on loopback device - Security

This is a discussion on port forwarding on loopback device - Security ; Hi, I want to forward a port bellow 1024 (let's say 889) to port above 1024 (8080), all this on loopback device. Is that possible ? I've tried : sudo iptables -t nat -A PREROUTING -p tcp --dport 889 -i ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: port forwarding on loopback device

  1. port forwarding on loopback device

    Hi,

    I want to forward a port bellow 1024 (let's say 889) to port above
    1024 (8080),
    all this on loopback device. Is that possible ? I've tried :

    sudo iptables -t nat -A PREROUTING -p tcp --dport 889 -i lo -j
    REDIRECT --to-port 8080

    On 808 I've got a tomcat running, than I've tried to telnet to
    127.0.0.1 on 889
    an I get
    Trying 127.0.0.1...
    telnet: Unable to connect to remote host: Connection refused

    What am I doing wrong ?


  2. Re: port forwarding on loopback device

    On Wed, 06 Jun 2007 08:23:32 +0000, thomas.fazekas wrote:

    > Hi,
    >
    > I want to forward a port bellow 1024 (let's say 889) to port above
    > 1024 (8080),
    > all this on loopback device. Is that possible ? I've tried :
    >
    > sudo iptables -t nat -A PREROUTING -p tcp --dport 889 -i lo -j
    > REDIRECT --to-port 8080
    >
    > On 808 I've got a tomcat running, than I've tried to telnet to
    > 127.0.0.1 on 889
    > an I get
    > Trying 127.0.0.1...
    > telnet: Unable to connect to remote host: Connection refused
    >
    > What am I doing wrong ?


    http://iptables.rlworkman.net/chunkyhtml/x4529.html


    --

    Regards
    Robert

    Smile... it increases your face value!


    ----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
    http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
    ----= East and West-Coast Server Farms - Total Privacy via Encryption =----

  3. Re: port forwarding on loopback device

    thomas.fazekas@gmail.com wrote:
    > Hi,
    >
    > I want to forward a port bellow 1024 (let's say 889) to port above
    > 1024 (8080),
    > all this on loopback device. Is that possible ? I've tried :
    >
    > sudo iptables -t nat -A PREROUTING -p tcp --dport 889 -i lo -j
    > REDIRECT --to-port 8080
    >
    > On 808 I've got a tomcat running, than I've tried to telnet to
    > 127.0.0.1 on 889
    > an I get
    > Trying 127.0.0.1...
    > telnet: Unable to connect to remote host: Connection refused
    >
    > What am I doing wrong ?
    >


    For port forwarding on lo, you need to use
    the OUTPUT chain instead of PREROUTING.

    --

    Tauno Voipio
    tauno voipio (at) iki fi

+ Reply to Thread