ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Linux Iptables Firewall Automation

    IT Discussion
    firewall iptables linux
    11
    39
    6.6k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • R
      RobLewisss
      last edited by scottalanmiller

      Hi guys! I'm looking for a solution that can help me automate firewall rules on multiple machines. I've searched high and low on the world wide web, but I can't seem to find a firewall manager that works on multiple machines. Any suggestions?

      1 Reply Last reply Reply Quote 3
      • scottalanmillerS
        scottalanmiller
        last edited by

        Hey @RobLewisss welcome to the MangoLassi community!

        1 Reply Last reply Reply Quote 0
        • scottalanmillerS
          scottalanmiller
          last edited by

          Well it depends on several factors, like what exactly you want to automate. A very common approach for small shops is to simply maintain a master firewall config file and push it out via SCP/SFTP or, if you want, pull it in the same manner with a script on the Linux box. You can even pull it from a GIT repo like GitHub or BitBucket. Or SVN, or whatever. Even HTTP.

          What the DevOps model would do is use a tool like Ansible, Chef, Puppet or SaltStack to maintain the firewall files on countless hosts at once.

          I'm not aware of anyone using a firewall manager for this task, nor am I aware of any firewall managers in general. For IPTables itself, working directly with the configuration file is probably the easiest option.

          travisdh1T 1 Reply Last reply Reply Quote 2
          • travisdh1T
            travisdh1 @scottalanmiller
            last edited by

            @scottalanmiller Do you remember what file(s) firewalld uses for it's config off the top of your head yet? I'm drawing a blank.

            Cloning iptables rules was/is so easy, just copy the /etc/sysconfig/iptables file to the new host.

            scottalanmillerS coliverC 2 Replies Last reply Reply Quote 3
            • scottalanmillerS
              scottalanmiller @travisdh1
              last edited by

              @travisdh1 said in Linux Iptables Firewall Automation:

              @scottalanmiller Do you remember what file(s) firewalld uses for it's config off the top of your head yet? I'm drawing a blank.

              Cloning iptables rules was/is so easy, just copy the /etc/sysconfig/iptables file to the new host.

              Yeah, traditional IPTables is SO much easier. I hate FirewallD so far.

              1 Reply Last reply Reply Quote 2
              • coliverC
                coliver @travisdh1
                last edited by

                @travisdh1 said in Linux Iptables Firewall Automation:

                @scottalanmiller Do you remember what file(s) firewalld uses for it's config off the top of your head yet? I'm drawing a blank.

                Cloning iptables rules was/is so easy, just copy the /etc/sysconfig/iptables file to the new host.

                Firewall-cmd I think.

                scottalanmillerS 1 Reply Last reply Reply Quote 0
                • scottalanmillerS
                  scottalanmiller @coliver
                  last edited by

                  @coliver said in Linux Iptables Firewall Automation:

                  @travisdh1 said in Linux Iptables Firewall Automation:

                  @scottalanmiller Do you remember what file(s) firewalld uses for it's config off the top of your head yet? I'm drawing a blank.

                  Cloning iptables rules was/is so easy, just copy the /etc/sysconfig/iptables file to the new host.

                  Firewall-cmd I think.

                  That's the command, but where is the text file it is altering?

                  wirestyle22W 1 Reply Last reply Reply Quote 1
                  • wirestyle22W
                    wirestyle22 @scottalanmiller
                    last edited by wirestyle22

                    @scottalanmiller said in Linux Iptables Firewall Automation:

                    @coliver said in Linux Iptables Firewall Automation:

                    @travisdh1 said in Linux Iptables Firewall Automation:

                    @scottalanmiller Do you remember what file(s) firewalld uses for it's config off the top of your head yet? I'm drawing a blank.

                    Cloning iptables rules was/is so easy, just copy the /etc/sysconfig/iptables file to the new host.

                    Firewall-cmd I think.

                    That's the command, but where is the text file it is altering?

                    /etc/sysconfig/iptables right? I thought this was redundant

                    scottalanmillerS 1 Reply Last reply Reply Quote 0
                    • scottalanmillerS
                      scottalanmiller @wirestyle22
                      last edited by

                      @wirestyle22 said in Linux Iptables Firewall Automation:

                      @scottalanmiller said in Linux Iptables Firewall Automation:

                      @coliver said in Linux Iptables Firewall Automation:

                      @travisdh1 said in Linux Iptables Firewall Automation:

                      @scottalanmiller Do you remember what file(s) firewalld uses for it's config off the top of your head yet? I'm drawing a blank.

                      Cloning iptables rules was/is so easy, just copy the /etc/sysconfig/iptables file to the new host.

                      Firewall-cmd I think.

                      That's the command, but where is the text file it is altering?

                      /etc/sysconfig/iptables right?

                      That's the one we were saying was so easy, the IPTables one. What one is FirewallD using, though?

                      wirestyle22W 1 Reply Last reply Reply Quote 1
                      • wirestyle22W
                        wirestyle22 @scottalanmiller
                        last edited by

                        @scottalanmiller said in Linux Iptables Firewall Automation:

                        @wirestyle22 said in Linux Iptables Firewall Automation:

                        @scottalanmiller said in Linux Iptables Firewall Automation:

                        @coliver said in Linux Iptables Firewall Automation:

                        @travisdh1 said in Linux Iptables Firewall Automation:

                        @scottalanmiller Do you remember what file(s) firewalld uses for it's config off the top of your head yet? I'm drawing a blank.

                        Cloning iptables rules was/is so easy, just copy the /etc/sysconfig/iptables file to the new host.

                        Firewall-cmd I think.

                        That's the command, but where is the text file it is altering?

                        /etc/sysconfig/iptables right?

                        That's the one we were saying was so easy, the IPTables one. What one is FirewallD using, though?

                        /usr/lib/firewalld/ or /etc/firewalld are the only things I know of. 😞

                        travisdh1T 1 Reply Last reply Reply Quote 0
                        • coliverC
                          coliver
                          last edited by

                          I know that you can add your own services by creating XML files. But overall I agree that IPtables is easier to manage.

                          wirestyle22W scottalanmillerS 2 Replies Last reply Reply Quote 0
                          • wirestyle22W
                            wirestyle22 @coliver
                            last edited by

                            @coliver said in Linux Iptables Firewall Automation:

                            I know that you can add your own services by creating XML files. But overall I agree that IPtables is easier to manage.

                            I've read that but have never done it myself.

                            coliverC 1 Reply Last reply Reply Quote 0
                            • coliverC
                              coliver @wirestyle22
                              last edited by

                              @wirestyle22 said in Linux Iptables Firewall Automation:

                              @coliver said in Linux Iptables Firewall Automation:

                              I know that you can add your own services by creating XML files. But overall I agree that IPtables is easier to manage.

                              I've read that but have never done it myself.

                              I did when I was configuring a Mangos server. It's pretty easy and it, to me, was easier then editing IPTables commands. Although that's just because I'm not used to IPTables.

                              1 Reply Last reply Reply Quote 1
                              • scottalanmillerS
                                scottalanmiller @coliver
                                last edited by

                                @coliver said in Linux Iptables Firewall Automation:

                                I know that you can add your own services by creating XML files. But overall I agree that IPtables is easier to manage.

                                yeah, that's nice and I've tried that a little. It's a neat idea but... really, IPTables is so easy, this adds so much complication.

                                1 Reply Last reply Reply Quote 1
                                • dafyreD
                                  dafyre
                                  last edited by

                                  I'm not really that familiar with IPtables ... but I've been toying with it more and more... I just wish it were easier.

                                  coliverC wirestyle22W N 3 Replies Last reply Reply Quote 0
                                  • coliverC
                                    coliver @dafyre
                                    last edited by

                                    @dafyre said in Linux Iptables Firewall Automation:

                                    I'm not really that familiar with IPtables ... but I've been toying with it more and more... I just wish it were easier.

                                    The syntax takes a long time for to wrap my head around. Whereas with FirewallD it was pretty easy to do. I still think iptables is easier to manage though, especially when you can pull the files from one server to the next and it replicates the settings.

                                    travisdh1T 1 Reply Last reply Reply Quote 2
                                    • wirestyle22W
                                      wirestyle22 @dafyre
                                      last edited by

                                      @dafyre said in Linux Iptables Firewall Automation:

                                      I'm not really that familiar with IPtables ... but I've been toying with it more and more... I just wish it were easier.

                                      This is why im so excited for my incoming server (tomorrow fyi). I get to play with whatever I want. Super excited.

                                      1 Reply Last reply Reply Quote 1
                                      • travisdh1T
                                        travisdh1 @wirestyle22
                                        last edited by

                                        @wirestyle22 said in Linux Iptables Firewall Automation:

                                        @scottalanmiller said in Linux Iptables Firewall Automation:

                                        @wirestyle22 said in Linux Iptables Firewall Automation:

                                        @scottalanmiller said in Linux Iptables Firewall Automation:

                                        @coliver said in Linux Iptables Firewall Automation:

                                        @travisdh1 said in Linux Iptables Firewall Automation:

                                        @scottalanmiller Do you remember what file(s) firewalld uses for it's config off the top of your head yet? I'm drawing a blank.

                                        Cloning iptables rules was/is so easy, just copy the /etc/sysconfig/iptables file to the new host.

                                        Firewall-cmd I think.

                                        That's the command, but where is the text file it is altering?

                                        /etc/sysconfig/iptables right?

                                        That's the one we were saying was so easy, the IPTables one. What one is FirewallD using, though?

                                        /usr/lib/firewalld/ or /etc/firewalld are the only things I know of. 😞

                                        Found my current config in /etc/firewalld/zones/public.xml. If you have any sort of complex firewall, you'd need to move the entirety of /etc/firewalld 😞

                                        stacksofplatesS 1 Reply Last reply Reply Quote 1
                                        • travisdh1T
                                          travisdh1 @coliver
                                          last edited by

                                          @coliver said in Linux Iptables Firewall Automation:

                                          @dafyre said in Linux Iptables Firewall Automation:

                                          I'm not really that familiar with IPtables ... but I've been toying with it more and more... I just wish it were easier.

                                          The syntax takes a long time for to wrap my head around. Whereas with FirewallD it was pretty easy to do. I still think iptables is easier to manage though, especially when you can pull the files from one server to the next and it replicates the settings.

                                          I think me and @scottalanmiller are still struggling to learn how to use firewall-cmd rather than editing /etc/sysconfig/iptables. So far I haven't had to do any fancy things with muliple zones or anything like that. I'm afraid the new system will make doing things easier to do things with it you're best leaving off to a real layer-3 router.

                                          coliverC scottalanmillerS 2 Replies Last reply Reply Quote 0
                                          • coliverC
                                            coliver @travisdh1
                                            last edited by

                                            @travisdh1 said in Linux Iptables Firewall Automation:

                                            @coliver said in Linux Iptables Firewall Automation:

                                            @dafyre said in Linux Iptables Firewall Automation:

                                            I'm not really that familiar with IPtables ... but I've been toying with it more and more... I just wish it were easier.

                                            The syntax takes a long time for to wrap my head around. Whereas with FirewallD it was pretty easy to do. I still think iptables is easier to manage though, especially when you can pull the files from one server to the next and it replicates the settings.

                                            I think me and @scottalanmiller are still struggling to learn how to use firewall-cmd rather than editing /etc/sysconfig/iptables. So far I haven't had to do any fancy things with muliple zones or anything like that. I'm afraid the new system will make doing things easier to do things with it you're best leaving off to a real layer-3 router.

                                            You can do zones with FirewallD pretty easily. When typing in your command just use --zone=zone to tell it what zone to work with.

                                            stacksofplatesS 1 Reply Last reply Reply Quote 1
                                            • 1
                                            • 2
                                            • 1 / 2
                                            • First post
                                              Last post