I want to redirect the tcp traffic temporarily to a custom port. On Linux, I use the following command:
iptables -t nat -A OUTPUT -p tcp --dport 1935 -m owner \! --uid-owner root -j REDIRECT
and to reverse the changes:
iptables -t nat -D OUTPUT -p tcp --dport 1935 -m owner \! --uid-owner root -j REDIRECT
They work just fine on Linux but sadly not on OS X. Can someone please give me the equivalent commands or methods that will work on OS X 10.9?