Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Jason Opperisano <opie@817west.com>
To: netfilter@lists.netfilter.org
Subject: Re: Help!!!
Date: Thu, 23 Jun 2005 10:35:39 -0400	[thread overview]
Message-ID: <20050623143539.GA16666@bender.817west.com> (raw)
In-Reply-To: <14209331.20050623145054@adm.utm.md>

On Thu, Jun 23, 2005 at 02:50:54PM +0300, radu wrote:
> Hello all,
> 
>       My networck config:
> 
>   Internet -> linux box -> My PC(192.168.50.101)
> 
>   linux box
>   eth0 local 192.168.50.0/24
>   eth1 Internet
>   
>   my iptables config:
> 
> iptables -P FORWARD DROP
> iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 4662 -j DNAT --to 192.168.50.101
> iptables -I FORWARD  -d 192.168.50.101 -p tcp --dport 4662 -j ACCEPT
> iptables -I FORWARD -i eth1 -o eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT
> iptables -I FORWARD -s 192.168.50.101 -j ACCEPT
> iptables -t nat -I POSTROUTING -o eth1 -j MASQUERADE

a cleaned-up version of your script:

  iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 4662 \
    -j DNAT --to 192.168.50.101
  iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE

  iptables -P FORWARD DROP
  iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
  iptables -A FORWARD -p tcp -d 192.168.50.101 --dport 4662 -j ACCEPT
  iptables -A FORWARD -s 192.168.50.101 -j ACCEPT

-j

--
"Meg: Oh no! I'm missing the news!
 Peter: We all miss The News, Meg, but Huey Lewis needs time to create,
 and we need to be patient."
        --Family Guy


  parent reply	other threads:[~2005-06-23 14:35 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-23 11:50 Help!!! radu
2005-06-23 12:14 ` Help!!! /dev/rob0
2005-06-23 13:06   ` Re[2]: Help!!! radu
2005-06-23 14:35 ` Jason Opperisano [this message]
  -- strict thread matches above, loose matches on Subject: below --
2006-06-01 11:53 Help! Stephan Higuti
     [not found] ` <a919cbc70606010501r73a6f23ds5405eeb94a4b1942@mail.gmail.com>
2006-06-01 12:05   ` Help! Stephan Higuti
2006-06-01 12:07 ` Help! Sietse van Zanen
2006-06-01 12:34   ` Help! Stephan Higuti
2005-06-23 12:00 Help!!! Baake, Matthias
2004-03-30  1:15 Help! btjiang
2003-07-18 15:22 help!! Tuyo Board Unilago
2002-09-06 14:58 Help!!! Bharat (Hotmail Mithibaiguy)

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=20050623143539.GA16666@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox