Saulius Menkevicius wrote:
Now, I want to make some traffic that comes from some client and that should go through gateway 10.0.0.1 to be forwarded to 10.0.0.2 (without any changes). The need is to make the forwarding transparent to both 10.0.0.2 and the client.in 10.0.0.1
ip rule add from YOUR_CLIENT [to DESTINATION] table fbsd.out
ip route add default via 10.0.0.2 dev $DEV table fbsd.out
I think this should do the job (for more information http://lartc.org/)
you create a routing table (fbsd.out) that will use 10.0.0.2 as gateaway for packets comming from your client.
I did not test this config, since I'm marking packets in the FORWARD chain of the mangle table and use
ip rule add fwmark to route them.
hope this helps.
andrea