Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Maxim Berlin <mak@rtsnet.ru>
To: netfilter@lists.netfilter.org
Subject: Re: I continued with the problem NAT and Filtering packet
Date: Fri, 6 Dec 2002 21:52:26 +0300	[thread overview]
Message-ID: <1133748700.20021206215226@rtsnet.ru> (raw)
In-Reply-To: <web-160663@gecyt.cu>

Hello Administrador,

Friday, December 06, 2002, Administrador de Red <admin@gecyt.cu> wrote:

AdR> Dear friends thanks very Mouch a some friends that try 
AdR> help me, well I want to say you that  a I continu with the 
AdR> problem the OE don't want to send and recived the email 
AdR> from mail server, I want to send the rules for iptables 
AdR> (Filtering and Nat) well i writing this rules and the file 
AdR> iptables configuration.

AdR> iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 25 -j DNAT --to 172.16.1.4:25
AdR> iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 110 -j DNAT --to 172.16.1.4:110
AdR> iptables -t nat -A POSTROUTING -o eth0 -j SNAT 169.158.130.253
[]

AdR> I need some help  fast. please.

very unfriendly people living here:(

in my meaning, you are interested in
client <-> 169.158.130.253:25  <-> 172.16.1.4:25
client <-> 169.158.130.253:110 <-> 172.16.1.4:110
and 169.158.130.253 is your linux host.
am i correct?

try this:
*******************
#!/bin/bash

IPTABLES=/sbin/iptables
IF=eth0
echo "1" > /proc/sys/net/ipv4/ip_forward
# uncomment two next lines, if you do not have any other rules
#$IPTABLES -t nat -F
#$IPTABLES -F
$IPTABLES -t nat -A PREROUTING -p tcp -i $IF --dport 25 -j DNAT --to 172.16.1.4:25
$IPTABLES -t nat -A PREROUTING -p tcp -i $IF --dport 110 -j DNAT --to 172.16.1.4:110
$IPTABLES -A FORWARD -p tcp -i $IF -o $IF -d 169.158.130.253 --dport 25 -j ACCEPT
$IPTABLES -A FORWARD -p tcp -i $IF -o $IF -d 169.158.130.253 --dport 110 -j ACCEPT
$IPTABLES -t nat -A POSTROUTING -o $IF -j MASQUERADE
*******************
then do
telnet 169.158.130.253 25
from your client.

Best wishes,
 Maxim                            mailto:mak@rtsnet.ru



      reply	other threads:[~2002-12-06 18:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-06 13:02 I continued with the problem NAT and Filtering packet Administrador de Red
2002-12-06 18:52 ` Maxim Berlin [this message]

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=1133748700.20021206215226@rtsnet.ru \
    --to=mak@rtsnet.ru \
    --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