On 28 October 2011 12:20, Mezei Zoltan <span dir="ltr"><<a href="mailto:mezei.zoltan@gmail.com">mezei.zoltan@gmail.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Fri, Oct 28, 2011 at 12:44, John Haxby <<a href="mailto:john.haxby@gmail.com">john.haxby@gmail.com</a>> wrote:<br>
> iptables -t nat -A POSTROUTING -p udp -m udp --sport <host-ip> -p 371 \<br>
>      -j SNAT --to-source <license-ip>:371<br>
<br>
</div>You should use the OUTPUT chain in the nat table for this purpose,<br>
otherwise, correct.<br><br></blockquote><div><br>Even when  I corrected the "--sport <host-ip> -p 371" to "-s <host-ip> --sport 371" it failed.<br><br># iptables -t nat -A OUTPUT -p udp -m udp -s 192.168.1.1 --sport 371 -j SNAT --to-source <a href="http://192.168.1.2:371">192.168.1.2:371</a><br>
iptables: Invalid argument. Run `dmesg' for more information.<br><br># dmesg | tail -1<br>ip_tables: SNAT target: used from hooks OUTPUT, but only usable from POSTROUTING<br></div></div>