[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

rewriting source and destination of local packets



I want to rewrite source and destination sockets of locally
generated packets. Specifically, packets with the following pair

  1.2.3.4:12345 -> 8.7.6.5:80

should be rewritten as

  127.0.0.1:12345 -> 127.0.0.1:3128

Is it possible to achieve this with iptables? I can do the
destination rewriting just fine (using REDIRECT in the OUTPUT
chain), but to rewrite the source, I need to use SNAT (I think),
which is only valid in POSTROUTING, and by that point in time it's
too late.

Thanks for any inputs.

-- 
Please do not send copies of list mail to me; I read the list!
 
 .''`.     martin f. krafft <madduck@debian.org>
: :'  :    proud Debian developer, admin, user, and author
`. `'`
  `-  Debian - when you have better things to do than fixing a system
 
Invalid/expired PGP subkeys? Use subkeys.pgp.net as keyserver!
 
"all i know is that i'm being sued for unfair business 
 practices by micro$oft. hello pot? it's kettle on line two."
                                                  -- michael robertson

Attachment: signature.asc
Description: Digital signature


Reply to: