Re: Redirecting packets based on source+destination ip's

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

 



clan@xxxxxxxxxxxxxxxxxx wrote:

To make it work I had to change PREROUTING to OUTPUT.  So is there a way
for that to only effect certain source ip's?

If the packet originated from localhost, then OUTPUT is correct. -s is source and -d is destination ip.

iptables -t nat -A OUTPUT -s 3.3.3.3 -d 1.1.1.1 -p tcp -m tcp --dport 80 -j DNAT --to 2.2.2.2

Should work for you. Remove your previously inserted rule first though.

Please read the manual page of iptables and/or http://iptables-tutorial.frozentux.net/iptables-tutorial.html

HTH,
	Alex


[Index of Archives]     [Linux Netfilter Development]     [Linux Kernel Networking Development]     [Netem]     [Berkeley Packet Filter]     [Linux Kernel Development]     [Advanced Routing & Traffice Control]     [Bugtraq]

  Powered by Linux