Find the answer to your Linux question:
Results 1 to 4 of 4
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Linux Port Forwarding


    configuer http reverse proxy

    also
    how to forward port 8081 to 8080

  2. #2
    Linux Guru Lazydog's Avatar
    Join Date
    Jun 2004
    Location
    The Keystone State
    Posts
    2,798
    With REDIRECT

    Regards
    Robert

    Linux
    The adventure of a life time.

    Linux User #296285
    Get Counted

  3. #3
    Try this

    --iptables -A INPUT -i eth0 -p tcp --dport 8081 -j ACCEPT
    --iptables -A INPUT -i eth0 -p tcp --dport 8080 -j ACCEPT
    --iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 8081 -j REDIRECT --to-port 8080

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Guru Lazydog's Avatar
    Join Date
    Jun 2004
    Location
    The Keystone State
    Posts
    2,798
    Quote Originally Posted by NixSavy View Post
    Try this

    --iptables -A INPUT -i eth0 -p tcp --dport 8081 -j ACCEPT
    --iptables -A INPUT -i eth0 -p tcp --dport 8080 -j ACCEPT
    --iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 8081 -j REDIRECT --to-port 8080
    The first rule is not necessary as you are not looking to allow port 8081 to connect. The last rule will change the port before any routing is done.

    Regards
    Robert

    Linux
    The adventure of a life time.

    Linux User #296285
    Get Counted

Posting Permissions

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