Port Forwarding not working for Internal requests
I am trying to configure port forwarding on my server running Redhat 7.3. The idea is to forward requests to xxxx:8080 to 192.168.3.1:80. (xxxx is the static IP I have.) It works fine if I try to connect to xxxx:8080 from a computer outside of my LAN, but DOESN'T WORK inside my LAN. Of course, I can use 192.168.3.1 to load the page, which means the problem is solely with port forwarding. I definitely need to get this working because I have IP addresses in my HTML and other files, and I can't do testing if xxxx:8080 doesn't work in my LAN.
Anyone else having the same problem with Port Forwarding of requests from $INTIF? Any advice? Did I do something wrong or is it possible to do? Thanks. My port forwarding section of iptables.sh is attached below....
//Accept connections to port 8080
iptables -A INPUT -i $EXTIF -p tcp -d $EXTIP --dport 8080 -j ACCEPT
iptables -A OUTPUT -o $EXTIF -p tcp -s $EXTIP --sport 8080 ! --syn -j ACCEPT
iptables -t nat -A PREROUTING -p tcp -i $EXTIF -d $EXTIP --dport 8080 -j DNAT --to 192.168.3.1:80
iptables -A FORWARD -p tcp -i $EXTIF -d 192.168.3.1 --dport 80 -j ACCEPT
//This doesn't work.....
iptables -t nat -A PREROUTING -p tcp -i $INTIF -d $EXTIP --dport 8080 -j DNAT --to 192.168.3.1:80
iptables -A FORWARD -p tcp -i $INTIF -d 192.168.3.1 --dport 80 -j ACCEPT