I would like to ask question regarding to forward-port rule for firewalld.
OS I am using is ,
CentOS Linux release 7.3.1611 (Core)
Forward requests to httpd listening on 127.0.0.1:80
[root@development /]# netstat -atunp | grep httpd tcp 0 0 127.0.0.1:80 0.0.0.0:* LISTEN 2601/httpd
I have set firewalld rule as below.
[root@development /]# firewall-cmd --list-all --zone=external external (active) target: default icmp-block-inversion: no interfaces: eth0 sources: services: ssh ports: protocols: masquerade: yes forward-ports: sourceports: icmp-blocks: rich rules: rule family="ipv4" forward-port port="8080" protocol="tcp" to-port="80"
However, if I send request from external host, firewalld rejects request to port 8080.
In this case,
192.168.11.2 (client) -------> 192.168.11.13 (8080)
[root@dellinspiron13z asset]# curl -XGET 192.168.11.13:8080 curl: (7) Failed to connect to 192.168.11.13 port 8080: Connection refused
If the process is running as 0.0.0.0:80 , it works perfectly.
Is there anyway to redirect requests to localhost port?