Port Forwarding in Red Hat Version 7


#1

Hello everyone I have a query regarding port forwarding in which i am confused kindly help me because I have to appear for exam.

Question : All traffic of port no 5432 of stationx should be forwarded to port no 80.

I am looking for the solution from both rich rule or simple firewall rule.

thanks


#2

Check this out:
https://access.redhat.com/discussions/1357803


#3
# firewall-cmd --permanent --add-forward-port=port=5432:proto=tcp:toport=80 to other host x.x.x.x on port 80 from stationx 5432 # firewall-cmd --permanent --add-forward-port=port=5432:proto=tcp:toport=80:toaddr=x.x.x.x

#4

thanks a lot sir
its a great help for me.


#5

thanks a lot sir
its a great help by you


#6

sir can you do a little more help for me?
can you do this question via Rich Rule?


#7

sir try this

man firewalld.richlanguage

firewall-cmd --add-rich-rule= ‘rule family=“ipv4” forward-port to-addr= “specify you ip here” to-port=“5432” protocol= “tcp” port = “80”’

that's all.