From: Milan Durovic <milan@milica.com.au>
To: netfilter@lists.netfilter.org
Subject: redirecting packets from one destination to a local host
Date: Wed, 30 Jun 2004 14:51:22 +1000 [thread overview]
Message-ID: <40E246CA.9030902@milica.com.au> (raw)
Hi,
I have iptables 1.2.2 (debian woody), kernel 2.4.25. In my network
setup, I have an ADSL modem/router that does NAT and redirects all the
smtp, http, etc requests to a Linux machine on inside. This works fine.
The problem: when I recently installed mailman, its scripts try to
access smtp server via address that maps into the public IP address of
the ADSL modem/router. So, requests never reach the mail server, which
is running on the Linux machine itself.
I want to setup iptables so that any requests originating from the Linux
server and destined to the public IP address of the ADSL modem/router
are redirected to the Linux server itself.
I tried:
iptables -t nat -A OUTPUT -d public_ip -j REDIRECT
(rule was accepted).
I also tried:
iptables -t nat -A OUTPUT -d public_ip -p tcp -j DNAT --to lin_srv_ip
but the command failed ("iptables: Invalid argument").
When I try "telnet public_ip smtp" I get 'connection refused' and when I
then go with "iptables -t nat -v -L" it shows that no packet matched the
REDIRECT rule.
Is there a simple way of achieving this? REDIRECT seems to be the right
sort of action that I want, but it doesn't seem to work.
Regards,
Milan
reply other threads:[~2004-06-30 4:51 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=40E246CA.9030902@milica.com.au \
--to=milan@milica.com.au \
--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.