All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Opperisano <opie@817west.com>
To: netfilter@lists.netfilter.org
Subject: Re: IP Forwading from Local IP to Live IP
Date: Tue, 19 Apr 2005 07:42:26 -0400	[thread overview]
Message-ID: <20050419114226.GA19155@bender.817west.com> (raw)
In-Reply-To: <002a01c544b5$2222c300$0b01a8c0@dap.edu.ph>

On Tue, Apr 19, 2005 at 03:55:18PM +0800, elg3ne wrote:
> Hi guys, Im new to iptables.. hope someone can help me to this.
> 
> The situation is this, I have a webserver running on a local network machine
> (192.168.1.3) & I want it to be accessible outside my network. Is it
> possible?
> 
> setup is like this:
> 
> workstation (192.168.1.3) ---> HUB ---> server ( LIVE IP, accessible
> everywhere on the net )
> 
> when user access the live IP ex. 10.0.0.3 can he forward to get the files on
> the worstation?

three line guide to "port-forwarding:"

  iptables -t nat -A PREROUTING -i $EXT_IF -p tcp --dport $OUTSIDE_PORT \
    -j DNAT --to-destination $INSIDE_HOST_IP:$INSIDE_PORT

  iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT

  iptables -A FORWARD -i $EXT_IF -p tcp --syn \
    -d $INSIDE_HOST_IP --dport $INSIDE_PORT -j ACCEPT

where example values for all the variables are:

  EXT_IF="eth0"
  OUTSIDE_PORT="80"
  INSIDE_HOST_IP="192.168.1.3"
  INSIDE_PORT="8080"

HTH...

-j

--
"Peter: Lois, When I'm through with them, our kids will be so smart,
 they'll be able to program their own VCRs without spilling piping hot
 gravy all over myself."
        --Family Guy


  parent reply	other threads:[~2005-04-19 11:42 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-15 15:51 Logging Mario Udina
2004-03-15 16:07 ` Logging Frederic de Villamil
2004-03-15 16:08 ` Logging Antony Stone
2005-04-19  7:55   ` IP Forwading from Local IP to Live IP elg3ne
2005-04-19  7:44     ` Taylor Grant
2005-04-19  8:41       ` elg3ne
2005-04-19 19:12         ` Taylor, Grant
2005-04-19 11:42     ` Jason Opperisano [this message]
2004-03-15 16:25 ` Logging Frank Gruellich
2004-03-15 16:36 ` Logging forum

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050419114226.GA19155@bender.817west.com \
    --to=opie@817west.com \
    --cc=netfilter@lists.netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.