Use iptables and disable firewalld

7 posts / 0 new
Last post
#1 Wed, 06/13/2018 - 09:19
kilkenny

Use iptables and disable firewalld

I'm trying out Virtualmin on a Debian 9 VPS. I typically do not use control panels and have done everything on a VPS simply with SSH.

I had a working prerouting rule that seems to be overriden by Virtualmin. It is saved in the rules file and shows up in the Linux Firewall tab, however that tab says:

Warning! It appears that FirewallD is being used to generate your system's firewall. Maybe you should use the FirewallD module instead.

I poked around FirewallD and don't want to use it. How do I disable FirewallD and instead use Linux Firewall / iptables without breaking Virtualmin?

Thu, 06/14/2018 - 08:09
Diabolico
Diabolico's picture

Now you have two choices:
1. Wipe out everything
2. Install fresh Debian
3. Remove firewalld if is installed
4. Install iptables before Virtualmin
5. Proceed with Virtualmin and the rest

The second solution is to keep as it is now and follow from step 3, e.g. remove firewalld and then install iptables.

How to do i'm not sure as i dont use Debian but google have a lot of guides and it should be fairly easy to follow them. If is similar to Centos, then it should be just few commands to copy/paste and execute

- I often come to the conclusion that my brain has too many tabs open. -
Failing at desktop publishing & graphic design since 1994.

Sun, 03/10/2019 - 12:44 (Reply to #2)
DanielStonek

Centos 7
Despite
systemctl stop firewalld
systemctl disable firewalld
systemctl mask firewalld
yum remove firewalld
yum install iptables-services

fresh Virtualmin install installs firewalld again and uses it instead of iptables

Thu, 06/14/2018 - 08:32
scotwnw

apt purge firewalld

apt install iptables

Then in webmin, networking, firewall - down at bottom, "reset" it. Pick an option for ports and it will put all the default virtualmin rules back. I believe the default is the bottom one. "Block all except ports used for virtual hosting. Or you can just open the necessary ports manually.

Wed, 02/20/2019 - 15:07
webinger

did i understand you correctly here: The second solution is to keep as it is now and follow from step 3, e.g. remove firewalld and then install iptables.

  1. Remove firewalld if is installed
  2. Install iptables before Virtualmin
  3. Proceed with Virtualmin and the rest

so i jave to uninstall firewalld AND IP tables AND Virtualmin and reinstall it again Virtualmin lastly?

Fri, 11/08/2019 - 16:37
acosonic

@ Diabolico how can I buy you a drink? :)

That's the ONLY way to make UFW work on Ubuntu 16.04...

Tue, 11/12/2019 - 01:55
acosonic

Actually, @scotwnw solution worked on ubuntu 16.04 server...

Confirmed, since @Diabolico's solution didn't work virtualmin installed firewalld and ruined firewall...

Topic locked