Hi!
UFW runs fine here. Whenever the container is restarted, the UFW rules are applied automatically.
To make sense whether it works or not, we should have a common test.
Here it is,
-
Launch a new container,
lxc launch ubuntu:18.04 ufw -
Get a shell into the container and install a Web server.
sudo apt update sudo apt install -y nginx logout -
Test that the Web server is accessible from the host.
$ curl http://10.10.10.100/ <!DOCTYPE html> <html> <head> <title>Welcome to nginx!</title> <style> body { -
Get back into the container and enable UFW.
$ sudo ufw enable Firewall is active and enabled on system startup -
Then, try to access the web server from the host.
$ curl http://10.10.10.100/ (does not connect!) -
Restart the container and try to access again.
$ lxc restart ufw $ curl http://10.10.10.100/ (does not connect!)