Find the answer to your Linux question:
Results 1 to 3 of 3
Hi there, I was hoping to set a linux box up by my router to respond to incoming ICMP packets for a series of WAN delay reading I need, however ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Dec 2009
    Posts
    10

    Forwarding ICMP packets with NAT


    Hi there,
    I was hoping to set a linux box up by my router to respond to incoming ICMP packets for a series of WAN delay reading I need, however I'm very confused about exactly how ICMP is handled.
    Without using a port I can't configure any port based forwarding, but I have an idea that it might be handled by NAT, is this the case?
    Has anyone done this before? The router is a thompson using a propriety unix like kernel from what i can tell.
    Any help would be appreciated.
    Many thanks
    Neil r w

  2. #2
    Super Moderator Roxoff's Avatar
    Join Date
    Aug 2005
    Location
    Nottingham, England
    Posts
    3,916
    I believe that ICMP is protocol at the same level as TCP/IP, but NAT works with the IP layer, so ICMP cannot be routed using it.

    I have no idea if similar forwarding mechanisms exist for ICMP, sorry.
    Linux user #126863 - see http://linuxcounter.net/

  3. #3
    Linux Guru Lazydog's Avatar
    Join Date
    Jun 2004
    Location
    The Keystone State
    Posts
    2,677
    While I have not tried it I do not see any reason why you could not DNAT ICMP traffic to another IP Address. ICMP is a protocol and like any other protocol you should be able to DNAT it.

    you could try something like this;

    Code:
    iptables -t nat -A PREROUTING -p icmp --icmp-type 0 -j DNAT --to-destination 192.168.1.1
    You will have to adjust to your needs. Give it a shot and let us know how you make out.

    Here is a list of different types of ICMP

    Regards
    Robert

    Linux
    The adventure of a life time.

    Linux User #296285
    Get Counted

  4. $spacer_open
    $spacer_close

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •