0

I am having a problem within allowing port redirect to another remote machine with another port, but in the same time the redirection is done based on specific source ip The situation is that i want users from ip xx.xx.xx.x01 only to be able to connect to server xx.xx.xx.x02 at port xxx09 that will redirect them to port xxx10 on server xx.xx.xx.x03 I have used too many configuration either here in stack over flow or from google, but nothing worked as i want, it allow any ip to connect to port xxx09 & then redirect them to port xxx10 on server xx.xx.xx.x03, while i need allowing redirection not from any ip instead from ip xx.xx.xx.x01 only The following is rules that i tested without any success (also tried to do this within csf but get the same result too)

firewall-cmd --permanent --zone=public --list-sources firewall-cmd --permanent --zone=public --add-source=xx.xx.xx.01 firewall-cmd --permanent --zone=public --add-port=xxx09/tcp firewall-cmd --permanent --zone=public --add-masquerade firewall-cmd --permanent --zone=public --add-forward-port=port=xxx09:proto=tcp:toport=xxx10:toaddr=xx.xx.xx.03 firewall-cmd --reload

i also used the following

firewall-cmd --zone=public --add-source=xx.xx.xx.01 firewall-cmd --zone=zone-name --add-source-port=xxx09/tcp --add-source=xx.xx.xx.01 firewall-cmd --permanent --zone=public --add-masquerade firewall-cmd --permanent --zone=public --add-forward-port=port=xxx09:proto=tcp:toport=xxx10:toaddr=xx.xx.xx.03 firewall-cmd --reload

Please any help will be appreciated, i tested all simillar cases rules, without any luck or success, it still accept redirect from any ip, even tried csf & iptables with no success thanks in advance Please all accept my best regards,,

1 Answer 1

0

Finally after three days i got it fixed but using iptables I used the following iptables rules iptables -t nat -A PREROUTING -p tcp --source xx.xx.xx.01 --dport xxx09 -j DNAT --to-destination xx.xx.xx.03:xxx10 iptables -t nat -A POSTROUTING -j MASQUERADE Now i could do port forwarding only from "" I am sorry & i know that the talking was about "Firewalld", but i didnt succeeded to found the solution within "Firewalld" instead found the solution within "Iptables" And also would be glad if i could make this done within "Firewalld" Please & kindly accept all my best regards,,

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .