Changing the desination address in kernel mode netfilter hook

zstingx_at_hotmail.com
Date: 06/19/05

  • Next message: Peter T. Breuer: "Re: LINUX & RTLINUX"
    Date: 19 Jun 2005 05:04:23 -0700
    
    

    Hello,

       I want to be able to recieve UDP packets which are destined
    to machine x and to send them (also by UDP) to different
    addresses.
    I want to do it in kernel mode so that it will be more efficent.
    Let's say at this stage that I know a different IP address
    to which the packet will be sent. (Later it will be a table).
    I wrote a module which receices packets using nf_register_hook()
    of netfilter.It works OK;I am using the NF_IP_PRE_ROUTING hook ; I
    tested sending UDP packets on a certain
    port and I verified they get to the hook method.

    What should I do in order to change the destination IP address
    so it will be to a different address?
    Should I only change the IP address of the destination in the UDP
    header??
    I started digging into the netfilter layer in the kernel but it is
    quite complex.

    Which hook should I use ? is it NF_IP_PRE_ROUTING ?
    or NF_IP_FORWARD ?

    Regards,
    Sting


  • Next message: Peter T. Breuer: "Re: LINUX & RTLINUX"

    Relevant Pages