Docker docs:

Docker routes container traffic in the nat table, which means that packets are diverted before it reaches the INPUT and OUTPUT chains that ufw uses. Packets are routed before the firewall rules can be applied, effectively ignoring your firewall configuration.

  • Static_Rocket
    link
    fedilink
    English
    arrow-up
    109
    ·
    1 month ago

    This was a large part of the reason I switched to rootless podman for everything

    • False
      link
      fedilink
      arrow-up
      21
      ·
      1 month ago

      Explicitly binding certain ports to the container has a similar effect, no?

      • doughless
        link
        fedilink
        arrow-up
        10
        ·
        1 month ago

        I still need to allow the ports in my firewall when using podman, even when I bind to 0.0.0.0.

        • qazOP
          link
          fedilink
          English
          arrow-up
          3
          ·
          1 month ago

          Also when using a rootfull Podman socket?

          • doughless
            link
            fedilink
            arrow-up
            5
            ·
            1 month ago

            I haven’t tried rootful since I haven’t had issues with rootless. I’ll have to check on that and get back to you.

          • doughless
            link
            fedilink
            arrow-up
            3
            ·
            1 month ago

            When running as root, I did not need to add the firewall rule.

            • qazOP
              link
              fedilink
              English
              arrow-up
              2
              ·
              1 month ago

              Thanks for checking

      • Static_Rocket
        link
        fedilink
        English
        arrow-up
        4
        ·
        1 month ago

        It’s better than nothing but I hate the additional logs that came from it constantly fighting firewalld.