I’ve installed LXD on a Centos 7.6 VPS using the default options and following the steps on @stgraber’s guide LXD on Centos 7.
Then created a Centos 7.6 container and installed NGINX and RSync server.
Attached the IP assigned by the birdge as a fixed IP to the container assuming it is using the default bridge lxdbr0:
$ lxc stop
$ lxc network attach lxdbr0 eth0 eth0
$ lxc config device set eth0 ipv4.address [IP address]
$ lxc start
I am not familiar with FirewallD.
I assume that, internally, FirewallD creates iptables rules. If you were to investigate this issue further, you would look into the set of iptables rules that have been created.
In addition, you mention that any access to google.com would bring the homepage of your nginx.
This is weird, as if you have created a captive portal by accident.
I would consider the google.com issue as a primarily FirewallD issue and not a LXD issue.
I have an identical issue on Ubuntu 18 running lxd containers. And oddly enough the apparrent redirection persists even after running “ufw disable” to disable the firewall,
Here is the tcpdump. If I, from the container try to telnet to bbc port 443
IP 10.223.8.144.47004 > 10.223.8.144.https: Flags [S],
This is the ip address of the container
If I change the target port to 444 I get the expected result
IP 10.223.8.144.37332 > 151.101.128.81.snpp: Flags [S],
which is sending to the bbc ip address
Maybe my incoming redirect rules are not configured properly, something I should look at.
This might be the problem, My redirect rules do not specify the incoming interface such as eth0, maybe the problem will be solved if I update the rule to specify the interface
-A PREROUTING -p tcp --dport 80 -j DNAT --to 10.223.8.144:80
-A PREROUTING -p tcp --dport 443 -j DNAT --to 10.223.8.144:443