Hi guys,
I'm trying to setup some firewall rules to protect a VM, but I fail badly and don't have a starting point to find out why.
I read https://pve.proxmox.com/wiki/Firewall and according to that document, I should be fine defining all rules on the cluster/datacenter level.
Here's some more info about my setup:
pve-firewall localnet
Proxmox host network setup
Clusterfirewall
Any hints or suggestions welcome.
Regards
Schnuffle
I'm trying to setup some firewall rules to protect a VM, but I fail badly and don't have a starting point to find out why.
- The proxmox host has a public IP X.Y.Z.80 from the network X.Y.Z.64/26
- The VM uses a bridged network and also has a public IP X.Y.Z.69
I read https://pve.proxmox.com/wiki/Firewall and according to that document, I should be fine defining all rules on the cluster/datacenter level.
- Can a VM rule be used at the cluster/datacenter level?
- Can somebody show me a cluster rule setup, that prevents access to some VM services ( like SSH or HTTP/S )?
- Shouldn't the Rule "IN DROP -dest sdm # Drop ALL to SDM server" disallow access to the VMs SSH ( in this case all ports ) port?
Here's some more info about my setup:
pve-firewall localnet
local hostname: virt2
local IP address: X.Y.Z.80
network auto detect: X.Y.Z.64/26
using detected local_network: X.Y.Z.64/26
local IP address: X.Y.Z.80
network auto detect: X.Y.Z.64/26
using detected local_network: X.Y.Z.64/26
Proxmox host network setup
auto lo
iface lo inet loopback
iface lo inet6 loopback
iface enp0s31f6 inet manual
auto vmbr0
iface vmbr0 inet static
address X.Y.Z.80
netmask 255.255.255.192
gateway X.Y.Z.65
bridge_ports enp0s31f6
bridge_stp off
bridge_fd 1
bridge_hello 2
bridge_maxage 12
iface lo inet loopback
iface lo inet6 loopback
iface enp0s31f6 inet manual
auto vmbr0
iface vmbr0 inet static
address X.Y.Z.80
netmask 255.255.255.192
gateway X.Y.Z.65
bridge_ports enp0s31f6
bridge_stp off
bridge_fd 1
bridge_hello 2
bridge_maxage 12
Clusterfirewall
[OPTIONS]
enable: 1
[ALIASES]
virt2 X.Y.Z.80 # Virt2 Proxmox host
sdm X.Y.Z.69 # SDM Server
[RULES]
IN ACCEPT -dest virt2 -p tcp -dport 22 # Allow SSH to Virt2 server
IN ACCEPT -dest virt2 -p tcp -dport 3128 # Allow Spice connection
IN ACCEPT -dest virt2 -p tcp -dport 8006 # Allow access to Proxmox web panel
|IN ACCEPT -dest sdm -p tcp -dport 22 # Allow SSH to SDM server
|IN ACCEPT -dest sdm -p tcp -dport 80 # Allow HTTP to SDM server
|IN ACCEPT -dest sdm -p tcp -dport 443 # Allow HTTPS to SDM server
IN DROP -dest sdm # Drop ALL toSDM server
[group ssh] # Allow SSH
IN ACCEPT -p tcp -dport 22 # Allow SSH
[group webserver] # Allo HTTP/S traffic
IN ACCEPT -p tcp -dport 443 # Allow HTTPS
IN ACCEPT -p tcp -dport 80 # Allow HTTP
enable: 1
[ALIASES]
virt2 X.Y.Z.80 # Virt2 Proxmox host
sdm X.Y.Z.69 # SDM Server
[RULES]
IN ACCEPT -dest virt2 -p tcp -dport 22 # Allow SSH to Virt2 server
IN ACCEPT -dest virt2 -p tcp -dport 3128 # Allow Spice connection
IN ACCEPT -dest virt2 -p tcp -dport 8006 # Allow access to Proxmox web panel
|IN ACCEPT -dest sdm -p tcp -dport 22 # Allow SSH to SDM server
|IN ACCEPT -dest sdm -p tcp -dport 80 # Allow HTTP to SDM server
|IN ACCEPT -dest sdm -p tcp -dport 443 # Allow HTTPS to SDM server
IN DROP -dest sdm # Drop ALL toSDM server
[group ssh] # Allow SSH
IN ACCEPT -p tcp -dport 22 # Allow SSH
[group webserver] # Allo HTTP/S traffic
IN ACCEPT -p tcp -dport 443 # Allow HTTPS
IN ACCEPT -p tcp -dport 80 # Allow HTTP
Any hints or suggestions welcome.
Regards
Schnuffle