tags:

views:

19

answers:

0

Please tell if the following iptables rules are correct. I need to forward all traffic to and from port 5060, to port 56789 on the same machine.

iptables -t nat -A PREROUTING -p udp --dport 5060 -j REDIRECT --to-port 56789

iptables -t nat -A PREROUTING -p udp --sport 5060 -j REDIRECT --to-port 56789

iptables -t nat -A OUTPUT -p udp --dport 5060 -j REDIRECT --to-port 56789

iptables -t nat -A OUTPUT -p udp --sport 5060 -j REDIRECT --to-port 56789

Thanks for the reply.