Score:0

iptables/certificate messed up on ubuntu

cn flag
Omi

I have an ubuntu server machine in which I have deployed a docker container running some app. For some tests I needed, I added an iptables entry in the ubuntu machine - to route traffic coming on port 443 to port 8443. Did it as follows:

sudo iptables -A PREROUTING -t nat -p tcp --dport 443 -j REDIRECT --to-ports 8443

Now, I see that the app I am running inside the docker container is facing some bigger issues. Ex: the app itself calls some other external service over ssl. That is now failing. Gives me an error: Connect to ***.abc.com:443 timed out. I know taht this external service is working from other similarly configured machines. I see a similar issue with other external services that my app is trying to reach over ssl.

Looks like I botched up something with the above iptables command. I therefore looked up a bit and tried the following:

sudo iptables -A PREROUTING -t nat -p tcp --dport 443 -j REDIRECT --to-ports 443
sudo iptables -D PREROUTING -t nat -p tcp --dport 443 -j REDIRECT --to-ports 8443

I thought the first line would ensure all traffic to port 443 does go to port 443 indeed and the 2nd line would undo the iptables entry I added earlier.

I also tried restarting the iptables service itself. (Since I did not save the iptables entry)

However, I still see the above mentioned issue. I dont understand why it is impacting traffic from within my docker container to the outside world.

Any inputs on what the problem is.

TIA - Om.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.