Article 4Y82F iptables on RHEL6 port forwarding

iptables on RHEL6 port forwarding

by
christr
from LinuxQuestions.org on (#4Y82F)
I've been searching here and googling like crazy trying to find the answer to a question I have. I need to forward a specific port using iptables. I've been able to make it work using RHEL7 and RHEL8 firewalld, but not with RHEL6 iptables. I'm in a situation where I must do this with iptables on RHEL6.

Any inbound connection on port 389 that hits the server must redirect that traffic to another host at 192.168.0.34 using the same port.

For example, this works with RHEL7 and RHEL8:
Code:firewall-cmd --zone=public --add-masquerade --permanent
firewall-cmd --zone=public --add-forward-port=port=389:proto=tcp:toport=389:toaddr=192.168.0.34 --permanent
firewall-cmd --reloadI've tried numerous examples on how to apply this to my /etc/sysconfig/iptables on RHEL6, but nothing works that I've tried. Any suggestions would be greatly appreciated.

Thankslatest?d=yIl2AUoC8zA latest?i=6abj0QCPJS8:uvo8IkHfwTA:F7zBnMy latest?i=6abj0QCPJS8:uvo8IkHfwTA:V_sGLiP latest?d=qj6IDK7rITs latest?i=6abj0QCPJS8:uvo8IkHfwTA:gIN9vFw6abj0QCPJS8
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments