SNAT help
Subsystems (2)
hello,
I want to execute my code atNF_IP_POST_ROUTING. For that First i want to know which functions are executing at NF_IP_POST_ROUTING Hook. Then i have enabled SNAT and I have wrriten code at NF_IP_POST_ROUTING but i want to get outgoing packets' IP address as new one SNAT'ed IP address not the one that is before SNAT? How can i do that?
I observe that my code and SNAT are executing
at same HOOK NF_IP_POST_ROUTING. But my code is executed first and then SNAT is doen but how to reverse that?
regards,
cranium
Yahoo! Mail
Stay connected, organized, and protected. Take the tour:
http://tour.mail.yahoo.com/mailtour.html
Quoted 4 lines
i have enabled SNAT and I have wrriten code at
NF_IP_POST_ROUTINGbut i want to get outgoing packets' IP address as new one SNAT'ed IP address not the one that is before SNAT? How can i do that?
I think changing the priority (struct nf_hook_ops.priority) when registering the hook would do your job. ip_nat_out_ops registers a hook with a priority NF_IP_PRI_NAT_SRC.
If you register your hook with a priority greater than NF_IP_PRI_NAT_SRC (like (NF_IP_PRI_NAT_SRC + 1) or NF_IP_PRI_LAST) then your hook will be called after the ip_nat_out_ops hook.
Hope that helps,
-- Asim