Results 1 to 3 of 3
  1. #1

    IPTables Rule to forward 80 to


    I'm trying to figure out an IPTables rule to forward incoming traffic on say port 80 to port 8080.

    This is usually done quite easily by doing this:
    iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080
    However, the service I'm running *only* accepts traffic coming from - therefore I need the source IP to be - currently it's still the remote IP using the rule above.

    I can hack this by putting in a NginX reverse proxy and technically this works fine - the issue here is that it uses an awful lot of CPU (High bandwidth service) - so I was hoping to do it all via IPTables and leave NginX out of it...

    Any ideas would be grately appreciated.

    Stuart Munro

  2. #2
    Join Date
    Nov 2001
    Ashburn, VA
    Use --to-destination instead of --to-port. Might need to use DNAT instead of REDIRECT, but I don't remember off the top of my head.
    Affordable web hosting, design, & domain registration services since 2001

  3. #3
    I would say use Socat for port redirections, iptables wouldn't be a good solution.

Similar Threads

  1. Forward 8080 port from eth0 to eth1
    By Cameleon in forum Hosting Security and Technology
    Replies: 2
    Last Post: 04-23-2013, 04:52 PM
  2. Iptables allow all forward in/out for all IPs
    By Hostlola in forum VPS Hosting
    Replies: 2
    Last Post: 02-22-2013, 05:56 AM
  3. IPtables forward question
    By zanderion in forum Programming Discussion
    Replies: 1
    Last Post: 03-16-2012, 04:41 PM
  4. iptables route out/to of
    By nand in forum Hosting Security and Technology
    Replies: 2
    Last Post: 04-09-2006, 07:31 AM
  5. IPTables Forward IP
    By MattF in forum Hosting Security and Technology
    Replies: 1
    Last Post: 09-17-2003, 11:44 AM

Posting Permissions

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