In short, any packet arriving at the port 80 and 443 of my dedicated server gets forwarded to my proxy container. This works like a charm, all my services are running fine, I can connect to the port 80 and 443. The problem is that my server cannot connect to itself, packets sent to 127.0.0.1 do not get forwarded ?
Could somebody help me identify my problem and help solve it ?
I’m definitely NOT one of the gurus here (just a user trying to learn/understand) so if my comments are later severely modified by someone who ‘knows’ - - - well sorry !
Do you have any of the network type analysis packages installed?
$ netstat -naltp
The results of which would likely be useful in diagnosing the issue and an old standby:
$ ifconfig
should also give some useful information, so - - - please?
Actually I was wrong, it doesn’t work entirely. The server can now connect to itself but the packets from my containers to my server do not get forwarded to the proxy container. This is the setup I used to forward from my containers (using the lxdbr0 interface):
I wish I knew more (still very much a learner at this stuff!) but reading the output you have directed localhost (your 127.0.0.1 connection) to connect to specific tasks. That means that your localhost:53 is talking to your container (I think) and localhost:953 is talking to something else.
My idea is that you have directed localhost to do these two things for you - - - and it is. What you have taken away from localhost is its ‘loop back’ abilities. Here is where I’m going to stop with specifics but I’m thinking if you specify localhost with no specific port your ability to do a loop back should reappear. If that works would you please say (I would appreciate knowing that that worked - - - grin!).
However, when LXD 3.0 is released in a month or so (with Ubuntu 18.04), it would be possible to use LXD instead of iptables. LXD 3.0 has a proxy device which is different from iptables, and I think it will be able to work just as you are expecting.