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

Re: Policy routing on local packets



Thanks everyone for your answers. I've already knew that the iptables rule in POSTROUTING chain would be the solution but I was learning iproute2 and its usage.
So that's why I was trying iptables marking + iproute2 rules.

Thanks :)

Pascal Hambourg escribió:
Gerardo Castillo Alvarado a écrit :
Andreas Onderka escribió:

iptables -t nat -A POSTROUTING -p tcp -o <extIF> --sport 25 -j SNAT
--to-source <IP2>

Don't forget that the SNAT target is for static ip.

Otherwise, you should use MASQUERADE if you are on a dynamic IP address.

Irrelevant. MASQUERADE does not allow to specifiy the new source address. It just uses the default interface address. In other words, it would do nothing.




Reply to: