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

    CentOS 7 Open Firewall Ports Range on FirewallD

    IT Discussion
    centos 7 linux rhel 7 firewalld firewall-cmd firewall iptables centos rhel
    3
    8
    20.0k
    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.
    • scottalanmillerS
      scottalanmiller
      last edited by

      This syntax is strangely hard to find. So here it is. For CentOS 7 or RHEL 7 running FirewallD which is managed by way of the firewall-cmd command, this is the general syntax for a port range:

      firewall-cmd --zone=public --add-port=10000-20000/udp --permanent
      
      1 Reply Last reply Reply Quote 2
      • JaredBuschJ
        JaredBusch
        last edited by

        While I have never made a how to with a port range, the basic firewalld syntax is used all over the place on this forum by me and every system that I have ever seen that accepts a port range does so with the range hyphenated from lower boundary to upper boundary.

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

          @JaredBusch said:

          While I have never made a how to with a port range, the basic firewalld syntax is used all over the place on this forum by me and every system that I have ever seen that accepts a port range does so with the range hyphenated from lower boundary to upper boundary.

          I would have thought that this was a colon, though, not a hyphen.

          JaredBuschJ 1 Reply Last reply Reply Quote 0
          • JaredBuschJ
            JaredBusch @scottalanmiller
            last edited by

            @scottalanmiller said:

            @JaredBusch said:

            While I have never made a how to with a port range, the basic firewalld syntax is used all over the place on this forum by me and every system that I have ever seen that accepts a port range does so with the range hyphenated from lower boundary to upper boundary.

            I would have thought that this was a colon, though, not a hyphen.

            I have never seen it commonly used with a colon to represent a range

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

              @JaredBusch said:

              @scottalanmiller said:

              @JaredBusch said:

              While I have never made a how to with a port range, the basic firewalld syntax is used all over the place on this forum by me and every system that I have ever seen that accepts a port range does so with the range hyphenated from lower boundary to upper boundary.

              I would have thought that this was a colon, though, not a hyphen.

              I have never seen it commonly used with a colon to represent a range

              Native IPTables. 🙂

              JaredBuschJ 1 Reply Last reply Reply Quote 1
              • JaredBuschJ
                JaredBusch @scottalanmiller
                last edited by

                @scottalanmiller said:

                @JaredBusch said:

                @scottalanmiller said:

                @JaredBusch said:

                While I have never made a how to with a port range, the basic firewalld syntax is used all over the place on this forum by me and every system that I have ever seen that accepts a port range does so with the range hyphenated from lower boundary to upper boundary.

                I would have thought that this was a colon, though, not a hyphen.

                I have never seen it commonly used with a colon to represent a range

                Native IPTables. 🙂

                I rarely work with native IPTables. That would explain a difference in point of view.

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

                  @JaredBusch said:

                  @scottalanmiller said:

                  @JaredBusch said:

                  @scottalanmiller said:

                  @JaredBusch said:

                  While I have never made a how to with a port range, the basic firewalld syntax is used all over the place on this forum by me and every system that I have ever seen that accepts a port range does so with the range hyphenated from lower boundary to upper boundary.

                  I would have thought that this was a colon, though, not a hyphen.

                  I have never seen it commonly used with a colon to represent a range

                  Native IPTables. 🙂

                  I rarely work with native IPTables. That would explain a difference in point of view.

                  Yeah, and for me I pretty much have done raw edits on /etc/sysconfig/iptables and never used external tools. Now with FirewallD I'm relearning the syntax for everything on Linux firewalls.

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

                    @scottalanmiller said:

                    @JaredBusch said:

                    @scottalanmiller said:

                    @JaredBusch said:

                    @scottalanmiller said:

                    @JaredBusch said:

                    While I have never made a how to with a port range, the basic firewalld syntax is used all over the place on this forum by me and every system that I have ever seen that accepts a port range does so with the range hyphenated from lower boundary to upper boundary.

                    I would have thought that this was a colon, though, not a hyphen.

                    I have never seen it commonly used with a colon to represent a range

                    Native IPTables. 🙂

                    I rarely work with native IPTables. That would explain a difference in point of view.

                    Yeah, and for me I pretty much have done raw edits on /etc/sysconfig/iptables and never used external tools. Now with FirewallD I'm relearning the syntax for everything on Linux firewalls.

                    Well, at least I'm not the only one then. Learning how to use firewall-cmd still feels a bit odd.

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