[SOLVED] Firewall does not seem to be applied to VM

Nov 16, 2018
30
4
13
47
Belgium
Hello!

I just installed a centos 8.1 VM on a proxmox 6.1-8 (zfs). I have enabled the firewall in which I have 3 rules (2 sshs - old and new port - and one for ping).

Capture d’écran 2020-05-01 à 19.06.35.png

In Firewall options:

Capture d’écran 2020-05-01 à 19.07.17.png

but on my VM:

[root@gandalf ~]# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination


I would expect to see the rules here, no?
If I disable the ssh rule - port 22, it works (ssh is configured on port 22).

If I changed the ssh port to 8181 and restart the service, I can not connect anymore to my VM (except via the console).

What did I miss?

Thx!
 
vm rules && host rules (configured at datacenter level or host level) are not related.
(vm rules are in host iptables FORWARD rules, && host rules are in host iptables INPUT/OUTPUT rules).

Simply do an "iptables-save" on proxmox host, you should see rules for vms && for hosts;
 
Thx Spirit.

I finally found that the problem was not related to the Proxmox firewall but to the centos 8.1 firewalld. I just had to add the 8181 port to make it work.


Thx for your help!
 
Last edited:

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!