Tagged: iptables Toggle Comment Threads | Keyboard Shortcuts

  • Jay Versluis 10:54 pm on February 10, 2015 Permalink | Reply
    Tags: , firewalld, iptables   

    Categories: Linux ( 101 )   

    How to set firewall rules from a GUI in CentOS 

    CentOS-LogoSick and tired of countless command line statements to set your firewall rules? Me too. No matter what I try, I never get the results quite right. There’s always some switch I forget and ultimately something isn’t working.

    For years I was thinking, “there has to be an easier way, like there is in Plesk”?

    And today I found that there is: a rather un-obvious tool called system-config-firewall. It’s a godsend and works in CentOS 6 with iptables, and in CentOS 7 with firewalld.


    To make use of it, install the following two packages:

    yum install system-config-firewall system-config-firewall-tui

    The first one is a version that runs under Gnome and KDE, and second one works on the command line.

    The Command Line Version

    You can invoke the command line version by running

    sudo system-config-firewall-tui

    and it will present you with the following interface. You may need to switch the firewall off temporarily, but the tool will tell you if that’s necessary:

    Screen Shot 2015-02-10 at 22.33.26

    Here’s how to use the interface:

    • use the cursor keys to move up and down
    • use the SPACE bar to select items
    • use TAB to choose the next option
    • and once selected, hit RETURN

    Screen Shot 2015-02-10 at 22.33.52


    system-config-firewall has several built-in presets, such as DNS, FTP, Mail, standard and secure http ports and many others. If you need to open a specific port, hit Add on the “other” screen and define both the port and the protocol. In this example I’m opening port 3306 for incoming MySQL traffic:

    Screen Shot 2015-02-10 at 22.39.30

    Step forward through all available options, or select Close to move back to the first screen. Make sure the Firewall Enabled option is ticked, then hit OK and all your rules will be saved.

    The Desktop Version

    If you have Gnome or KDE installed, you can invoke the Desktop Version from the command line like this:

    sudo system-firewall-config

    In addition, there should also be a handy menu item under System – Administration – Firewall which will start the same thing.

    Screen Shot 2015-02-10 at 22.48.05

    The options are much the same, perhaps a little easier on the eye and easier to select. In addition you have a Wizard which will let you start your firewall rules with a clean slate (great if you’ve been previously poking around on the command line, potentially messing things up).

    Screen Shot 2015-02-10 at 22.48.53

    Thousand thanks to all the developers who have written this tool: Thomas Woerner, Chris Lumens, Florian Festi, Brent Fox and many others.

    • paulm 5:25 pm on June 11, 2016 Permalink | Reply

      you can also try a SAAS solution for managing iptables -> https://www.efw.io/Forum it can do AWS cloud integration if needed.

      • Craig Crawford 1:33 pm on November 26, 2016 Permalink | Reply

        That is a seriously dumb service. Managing the firewall of any Linux OS is incredibly easy enough to not need such a service.

    • Lem 9:30 pm on June 6, 2017 Permalink | Reply

      After a seemingly successful install on centOS7
      Just get bash: system-firewall-config-tui:: command not found

      Anything else I should know?

      • Jay Versluis 11:12 pm on June 6, 2017 Permalink | Reply

        Hi Lem,

        d’oh, that was a stupid typo I snuck in there… the CORRECT command is actually system-config-firewall-tui (see what I did there…?) I’ll update the article now. Thanks for bringing this to my attention!

        Happy Firewalling!

  • Jay Versluis 10:29 pm on March 11, 2014 Permalink | Reply
    Tags: , , , iptables, passive   

    Categories: Plesk ( 76 )   

    How to allow passive FTP connections in Plesk on Amazon EC2 

    AWS LogoPassive FTP connections should work out of the box in Plesk. If no other firewall or NAT is interfering with it.

    I’ve recently noticed that when I install Plesk on Amazon EC2 every passive FTP connection fails with an error such as “Server sent passive reply with unroutable address. Passive mode failed.”

    The reason for this mishap is twofold:

    EC2 instances are behind a NAT, and therefore have an internal (unroutable) IP, and an external (public) IP. When a passive connection request comes in, ProFTP – Plesk’s default FTP Server – tells the connecting client its internal private IP address, and in turn quite rightly fails to connect to it.

    On top of that, we need to make sure to open a range of ports we want to use for passive FTP connections and tell ProFTP only to use those.

    Let’s do all this this step by step!

    (More …)

    • jersoncito 1:37 pm on July 13, 2014 Permalink | Reply

      I was facing the same problem after I updated Plesk 11.5.30 Update #47 (Centos 6.5 dedicated server 1and1)

      This worked perfect for me:

      1) Patching ProFTP according to the instructions given by Jay
      2) Creating the Firewall custom rule using Plesk control panel.

      Thanks so much Jay!

    • Andrew 5:31 pm on January 14, 2015 Permalink | Reply

      Very Helpful!

    • Devin Greco 4:06 pm on August 11, 2015 Permalink | Reply

      Hey any chance you can tell me where I can add the masquerade IP on a Windows Plesk server? I’m having the same issue and I can only seem to edit the port range.

    • sudhan ks 7:12 pm on July 26, 2016 Permalink | Reply

      I was just looking for this fix. You came like an angel ^^

      • Jay Versluis 8:43 pm on July 26, 2016 Permalink | Reply

        Thank you 🙂

    • Nicat Manafov 4:32 am on September 25, 2016 Permalink | Reply

      Very very thanks 🙂 !!

  • Jay Versluis 4:34 pm on November 17, 2013 Permalink | Reply
    Tags: , iptables   

    Categories: Plesk ( 76 )   

    How to open the web interface ports for Plesk on CentOS 

    After installing Parallels Plesk on a fresh server you may need to open ports 8443 and 8447 to access the web interface. These ports are not open by default. If your installation went fine but you can’t access Plesk in your browser via https://yourdomain.com:8443 then it’s likely that those ports aren’t open.

    Port 8443 is for Plesk Panel, and 8447 is for additional packages you can install via the web interface. Thanks a million to John Veldboom to this critical tip!

    Here’s how to do it:

    vi /etc/sysconfig/iptables

    Now add the following two lines under the INPUT ACCEPT section:

    -A INPUT -m state --state NEW -m tcp -p tcp --dport 8443 -j ACCEPT
    -A INPUT -m state --state NEW -m tcp -p tcp --dport 8447 -j ACCEPT

    Restart the service for those changes to take effect:

    service iptables restart

    This should also work on Fedora and of course RedHat Linux.

    If you get an error message upon restart, it may be that copy/paste replaced the minus signs in those switches. Just go through and replace every – manually.

    • Andy Brown 12:34 pm on March 24, 2016 Permalink | Reply

      As of CentOS 7 firewalld has replaced iptables as the default port configuration tool, I found this out the hard way after following the instructions above and still having issues. For anyone looking to do this I had to do the following to open port 8447:

      firewall-cmd –zone=public –add-port=8447/tcp –permanent
      firewall-cmd –reload

      Hope you get well soon Jay.

      • Jay Versluis 12:38 pm on March 24, 2016 Permalink | Reply

        Indeed it has, thanks for sharing Andy! I’ll try my best to hang in there health wise :-/

  • Jay Versluis 11:43 am on November 20, 2011 Permalink | Reply
    Tags: , iptables   

    Categories: Plesk ( 76 )   

    How to install Plesk on CentOS 6 

    The other day I got myself a brand new server – so barebones that I had to do everything myself, including picking a Linux distribution. Sadly the one I wanted (CentOS 6) did not come bundled with Plesk so I had to install it manually.

    I thought I’d better take some notes so I can retrace my steps.

    At the time of writing, Plesk 10.3 is current, with 10.4 just around the corner. Keep this in mind – things tend to change drastically with every major release.

    (More …)

    • cristina 1:49 am on August 28, 2012 Permalink | Reply


      How can I use the ff command to install the plesk 9.5.4 linux?:

      wget -O – http://autoinstall.plesk.com/one-click-installer | sh

      Kindly help me.

      • Jay Versluis 9:30 am on August 29, 2012 Permalink | Reply

        The auto installer won’t work on older versions of Plesk, it will only install the latest version available on a new server. Right now that’s Plesk 11.0.9 – I highly recommend it over Plesk 9.

        If Parallels provide files for older Plesk versions they can likely be found here: http://www.parallels.com/products/plesk/download/.

        Note that you have to enter your details first before you get to the download page. Hope this helps 😉

    • John Veldboom 4:35 pm on September 1, 2012 Permalink | Reply

      You will also need to open the Plesk default ports (8443 & 8447) in iptables
      vi /etc/sysconfig/iptables
      -A INPUT -m state –state NEW -m tcp -p tcp –dport 8443 -j ACCEPT

      • reza 3:50 am on April 19, 2013 Permalink | Reply

        This really helps a lot
        This is the only right guide to access the plesk panel after new installation
        Thank John Veldboom so much

      • Jay Versluis 2:36 pm on November 17, 2013 Permalink | Reply

        Awesome tip indeed, John – I’ll add it to the guide!

    • Emile Harmel 10:43 am on June 13, 2013 Permalink | Reply

      I have installed plesk but when i goto my browser it times out, i accepted all the firewalls to. any ideas :0)

      • Jay Versluis 10:58 am on June 13, 2013 Permalink | Reply

        Tricky one… how are you logging in, via yourdomain.com:8443? That’s the secured port. See if the unsecured port works on yourdomain.com:8880 – perhaps it makes a difference.

    • Martin 5:23 am on October 9, 2014 Permalink | Reply

      Thanks a bundle man. I have been looking for hours for this information. The Linux is a closed bastion for those who are not really knowledgeable on it.

      • Jay Versluis 9:02 am on October 9, 2014 Permalink | Reply

        Thanks Martin, glad to hear it was helpful. I couldn’t agree more about Linux: it’s so difficult to find relevant information. What helped me a lot was The Linux Command Line by William Shotts: http://linuxcommand.org

Compose new post
Next post/Next comment
Previous post/Previous comment
Show/Hide comments
Go to top
Go to login
Show/Hide help
shift + esc