Iptables Port Redirect Not Working For Localhost on Oracle Linux 6
(Doc ID 2517055.1)
Last updated on SEPTEMBER 14, 2021
Applies to:
Oracle Cloud Infrastructure - Version N/A and laterLinux OS - Version Oracle Linux 5.0 to Oracle Linux 6.10 with Unbreakable Enterprise Kernel [4.1.12] [Release OL5 to OL6U10]
Linux x86-64
Linux x86-64 on Oracle Public Cloud
Symptoms
Redirecting a web service from port 80 to any other port might not work when the access comes from the same host (Localhost)
=======================
From Localhost to port 80
=======================
Error:
[root@localhost ~]# curl http://127.0.0.1:80
curl: (7) couldn't connect to host
[root@localhost ~]#
[root@localhost ~]# curl http://<host IP >:80
curl: (7) couldn't connect to host
[root@localhost ~]#
=======================
From outside to port 80
=======================
Working:
[root@desktop-localhost ]# curl http:// <public-ip >:80
Welcome to Oracle Support
Changes
Web service is listening to port 9080
Redirection port for port 80 is set to port 9080 on IPtables configuration.
Cause
To view full details, sign in with your My Oracle Support account. |
|
Don't have a My Oracle Support account? Click to get started! |
In this Document
Symptoms |
Changes |
Cause |
Solution |