Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Martín <martin@familia-fiumara.com.ar>
To: eturner@monash.edu.my
Cc: "netfilter@lists.netfilter.org" <netfilter@lists.netfilter.org>
Subject: Re: redirection trouble
Date: Tue, 04 Nov 2003 02:15:32 -0300	[thread overview]
Message-ID: <oprx3kv6lddpszyy@192.168.2.1> (raw)
In-Reply-To: <004a01c3a282$a1430cc0$de0018ac@admin.monash.edu.my>

Ok, I think I got it... but does not work. I see the traffic being 
redirected, but the conection gets lost, I got this in the snuiffer:

02:02:51.640513 192.168.2.1 > 192.168.2.5: icmp: 192.168.2.1 udp port 10000 
unrachable [tos 0x40]

Any Idea?




En Tue, 4 Nov 2003 11:20:42 +0800, Edmund Turner <eturner@monash.edu.my> 
escribió:

>
>
> Martin, Alistairs explanation and solution is correct.
> In short 192.168.2.5 will only see traffic thru and fro 192.168.2.1
> @port 10000. Put a packet analyser or a sniffer on 192.168.2.5 to
> confirm.
> In Iptables if you do a prerouting as such :
>
> #This will redirect all packets to 192.168.2.1 dport 10000 to
> 200.24.24.200:10000
>
> iptables -t nat -I PREROUTING -i eth1 -d 192.168.2.1 -p udp --dport
>> 10000 -j DNAT --to 200.45.45.200:10000
>
> You don’t have to worry about the packets coming in back from
> 200.24.24.200. They will be tracked and sent back to 192.168.2.5 as
> source IP of 192.168.2.1. Im not sure which module is responsible for
> this, but I think its done by the ip_conntrack module. Maybe someone can
> enlighten us on this?
>
>
> Regards
> edmund
>
>> -----Original Message-----
> From: netfilter-admin@lists.netfilter.org
> [mailto:netfilter-admin@lists.netfilter.org] On Behalf Of Martín
> Sent: Tuesday, November 04, 2003 10:37 AM
> To: alistair@nerdnet.ca
> Cc: netfilter@lists.netfilter.org
> Subject: Re: redirection trouble
>
> En Mon, 3 Nov 2003 21:21:09 -0500, Alistair Tonner <Alistair@nerdnet.ca>
>
> escribió:
>
>> On November 3, 2003 08:53 pm, Martín wrote:
>>> This is the situation:
>>>
>>>
>>>
>>> Internal LAN machine (192.168.2.5)
>>>
>>>
>>>
>>> (eth1 192.168.2.1) NAT LINUX ( eth0 192.168.1.10 > adsl ppp0 IP
> dinamic)
>>>
>>>
>>>
>>> Server 200.45.45.200 (service at port 10000)
>>>
>>>
>>>
>>> This is what I intend to do:
>>> For particular reasons, I need that a soft at 192.168.2.5 comunicate 
>>> with a
>>> server with a service at port 10000 (UDP), but this can´t be done 
>>> through
>>> normal NAT. So i want to establish a link between both (server and
>>> 192.168.2.5) manually useing the NAT LINUX
>>> So, 192.168.2.5 comunicates to 192.168.2.1 port 10000, the NAT LINUX
>>> redirect this traffic to the server 200.45.45.200 port 10000. The
> server
>>> will respond to the NAT LINUX who will redirect this traffic to 
>>> 192.168.2.5
>>> (port 10000 also)
>>> I try to do all this in this way:
>>>
>>>
>>> iptables -t nat -I PREROUTING 1 -i eth1 -d 192.168.2.1 -p udp --dport
>
>>> 10000
>>> -j DNAT --to 200.45.45.200
>>>
>>> iptables -t nat -I POSTROUTING 1 -o eth0 -p udp --dport 10000 -j SNAT



-- 
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/


       reply	other threads:[~2003-11-04  5:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <004a01c3a282$a1430cc0$de0018ac@admin.monash.edu.my>
2003-11-04  5:15 ` Martín [this message]
2003-11-04 22:17   ` redirection trouble Alistair Tonner
2003-11-28 17:25   ` Alistair Tonner
     [not found] <007d01c3a294$919eaa60$de0018ac@admin.monash.edu.my>
2003-11-04 15:50 ` Martín
2003-11-04  1:53 Martín
2003-11-04  2:21 ` Alistair Tonner
2003-11-04  2:37   ` Martín

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=oprx3kv6lddpszyy@192.168.2.1 \
    --to=martin@familia-fiumara.com.ar \
    --cc=eturner@monash.edu.my \
    --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