Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Hinko Kocevar <hinko.kocevar@cetrtapot.si>
To: Michele Petrazzo - Unipex srl <michele.petrazzo@unipex.it>
Cc: netfilter@vger.kernel.org
Subject: Re: icmp forward
Date: Fri, 30 Jan 2009 10:19:23 +0100	[thread overview]
Message-ID: <4982C61B.6030008@cetrtapot.si> (raw)
In-Reply-To: <4982BB4D.5020708@unipex.it>

Michele Petrazzo - Unipex srl wrote:
> Hinko Kocevar wrote:
>> Hi all,
>>
>> I'm an absolute beginner on the netfilter stuff, so please bear with
>> me here.
>>
>> We have a device running linux 2.6.19 kernel with iptables installed.
>> It acts
>> a a gateway for a another mobile device that connects to linux device
>> via irda
>> port - ppp connection. I've managed to port forward telnet port to
>> mobile device
>> with the help of this page
>> http://kreiger.linuxgods.com/kiki/?Port+forwarding+with+netfilter.
>> Our customers want to be able to ping the mobile device behind the
>> linux firewall
>> and IMHO it is not possible for ICMP packets to be forwarded since it
>> is a protocol
>> by itself (not a TCP/UDP style service).
>>
>>
>> Is it possible to 'port forward' ICMP requests?
>>
> 
> Sure? Looking at firsts google reply, you can find
> 
> iptables -A FORWARD -p icmp --icmp-type echo-request -j ACCEPT
> iptables -t nat -A PREROUTING -i eth0 -p icmp DNAT --to-destination
> 10.2.1.1
> 

That seems to work goo, but now the gateway can not reply to ICMP packets...

> end so on...
> 
> Or I miss something?

I was expecting a solution where gateway would still see the ICMP requests, too.

I guess I'll use a telnet service on the mobile device in order to check if it is
alive and NAT the port on gateway to high port number eg. 2323 -> mobile device
23.

Best regards,
Hinko

-- 
Hinko Kočevar, OSS developer
ČETRTA POT, d.o.o.
Planina 3, 4000 Kranj, SI EU
tel     ++386 (0) 4 280 66 03
e-mail  hinko.kocevar@cetrtapot.si
http    www.cetrtapot.si


  parent reply	other threads:[~2009-01-30  9:19 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-30  8:18 icmp forward Hinko Kocevar
2009-01-30  8:33 ` Michele Petrazzo - Unipex srl
2009-01-30  8:53   ` Payam Chychi
2009-01-30  9:19   ` Hinko Kocevar [this message]
2009-01-30  8:49 ` Christoph Paasch
2009-01-30  9:12   ` Hinko Kocevar
2009-01-30 10:53     ` Pascal Hambourg
2009-01-30 11:24       ` Hinko Kocevar
2009-01-30 11:35         ` Hinko Kocevar
2009-01-30 11:42           ` Pascal Hambourg
2009-01-30 11:36         ` Mart Frauenlob
2009-01-30  9:20 ` Mart Frauenlob
2009-01-30 11:36   ` Hinko Kocevar

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=4982C61B.6030008@cetrtapot.si \
    --to=hinko.kocevar@cetrtapot.si \
    --cc=michele.petrazzo@unipex.it \
    --cc=netfilter@vger.kernel.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