Results 1 to 2 of 2

Thread: Port forward

  1. #1
    Junior Member
    Join Date
    Jul 2008
    Location
    SM
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Post Port forward

    Hello,

    I have read Linux iptables: Port Redirection Example
    but I would need some help on port forward.

    I have:

    public_ip(eth0) --pc--10.10.10.1(eth1)------10.10.10.2--storage

    i need acces from internet to storage on port 80

    what I tryed:
    iptables -t nat -A PREROUTING -p tcp -i eth0 -d publicip --dport 80 -j DNAT --to 10.10.10.2:80
    iptables -A FORWARD -p tcp -d 10.10.10.2 --dport 80 -j ACCEPT
    iptables -A INPUT -i eth1 -p tcp -m tcp --dport 80 -j ACCEPT


    but it still does not work

  2. #2
    Is that all you got? rockdalinux's Avatar
    Join Date
    May 2005
    Location
    Planet Vegeta
    Posts
    987
    Thanks
    27
    Thanked 71 Times in 62 Posts
    Rep Power
    19

    Default

    Your rules looks ok to me. What about your default polices? Did you see anything in your logs? You also need a POSTROUTING rule to enable masquerading if the redirection goes to another machine.

    Code:
    iptables -t nat -A POSTROUTING -j MASQUERADE -o ethX
    Rocky Jr.
    What's wrong? I hope I am not making you uncomfortable...

    Never send a boy to do a mans job.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. How to forward an email to other account
    By tom in forum Getting started tutorials
    Replies: 8
    Last Post: 27th June 2012, 01:12 PM
  2. ip forward, ipchain, iptable???
    By Oppey in forum Linux software
    Replies: 2
    Last Post: 24th November 2009, 05:15 AM
  3. Forward xferlogs
    By s_anandkumar in forum Linux software
    Replies: 3
    Last Post: 22nd October 2009, 07:32 PM
  4. why can't forward large email attachment?
    By khaosregion in forum Mail Servers
    Replies: 4
    Last Post: 25th October 2007, 11:49 PM
  5. mail forward between ISPs
    By picioslug in forum Shell scripting
    Replies: 2
    Last Post: 23rd September 2006, 04:53 PM

Posting Permissions

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