I am not really familiar with iptables and all the nuances of the different rules. I am in the process of learning but I need this expedited which is why I'm asking here.
I am running a WebLogic container inside Docker on an AWS EC2 instance. The container is running using
docker run -d -p 8002:8002 weblogic. I didn't build the image so there are some things that must stay. I need the WebLogic server to be accessible from the outside on port 443 due to network restrictions, even though it is built to be access through port 8002.
I've tried various iptables rules but none of them are successfully forwarding. The container is still accessible on 8002 even with the rules forwarding 8002 -> 443 in place.
RHEL 7.3 and the Dockerfile is built for iptables, not firewalld. Some of this stuff I have no control over so I have to work with what I have.
One of the iptables commands I tried was:
iptables -t nat -A OUTPUT -p tcp --dport 8002 -j DNAT --to-destination 127.0.0.1:443
Note: I do know to run
service iptables save. I can verify the rules exist using
EDIT: Here are my iptables rules currently
-P INPUT ACCEPT -P FORWARD ACCEPT -P OUTPUT ACCEPT -N DOCKER -N DOCKER-ISOLATION -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT -A INPUT -p icmp -j ACCEPT -A INPUT -i lo -j ACCEPT -A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT -A INPUT -j REJECT --reject-with icmp-host-prohibited -A FORWARD -j DOCKER-ISOLATION -A FORWARD -o docker0 -j DOCKER -A FORWARD -o docker0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT -A FORWARD -i docker0 ! -o docker0 -j ACCEPT -A FORWARD -i docker0 -o docker0 -j ACCEPT -A FORWARD -j REJECT --reject-with icmp-host-prohibited -A FORWARD -i eth0 -p tcp -m tcp --dport 443 -j ACCEPT -A DOCKER -d 172.17.0.2/32 ! -i docker0 -o docker0 -p tcp -m tcp --dport 8002 -j ACCEPT -A DOCKER-ISOLATION -j RETURN