Changing the desination address in kernel mode netfilter hook
Date: 19 Jun 2005 05:04:23 -0700
I want to be able to recieve UDP packets which are destined
to machine x and to send them (also by UDP) to different
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
I started digging into the netfilter layer in the kernel but it is
Which hook should I use ? is it NF_IP_PRE_ROUTING ?
or NF_IP_FORWARD ?