Hi,
I've the same problem - I can't block access to the port 22 of the node from the public IP.
I'm using Proxmox 4.4-1.
@Datacenter level: Enable Firewall YES, Input Policy DROP, Output Policy ACCEPT
@Host level: Enable Firewall YES, and the below rules:
So by default, I believe since the Input Policy is DROP, port 22 should now be blocked... But it isn't!
Iptables-save output:
-A PVEFW-HOST-IN -i lo -j ACCEPT
-A PVEFW-HOST-IN -m conntrack --ctstate INVALID -j DROP
-A PVEFW-HOST-IN -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A PVEFW-HOST-IN -m conntrack --ctstate INVALID,NEW -j PVEFW-smurfs
-A PVEFW-HOST-IN -p tcp -j PVEFW-tcpflags
-A PVEFW-HOST-IN -p igmp -j RETURN
-A PVEFW-HOST-IN -d 92.216.138.208/32 -p tcp -m tcp --dport 8006 -j RETURN
-A PVEFW-HOST-IN -d 92.216.138.208/32 -p udp -m udp --dport 1194 -j RETURN
-A PVEFW-HOST-IN -d 92.216.138.208/32 -p tcp -m tcp --dport 443 -j RETURN
-A PVEFW-HOST-IN -d 92.216.138.208/32 -p tcp -m tcp --dport 80 -j RETURN
-A PVEFW-HOST-IN -p tcp -m set --match-set PVEFW-0-management-v4 src -m tcp --dport 8006 -j RETURN
-A PVEFW-HOST-IN -p tcp -m set --match-set PVEFW-0-management-v4 src -m tcp --dport 5900:5999 -j RETURN
-A PVEFW-HOST-IN -p tcp -m set --match-set PVEFW-0-management-v4 src -m tcp --dport 3128 -j RETURN
-A PVEFW-HOST-IN -p tcp -m set --match-set PVEFW-0-management-v4 src -m tcp --dport 22 -j RETURN
-A PVEFW-HOST-IN -s 92.216.138.0/24 -d 92.216.138.0/24 -p udp -m udp --dport 5404:5405 -j RETURN
-A PVEFW-HOST-IN -s 92.216.138.0/24 -p udp -m addrtype --dst-type MULTICAST -m udp --dport 5404:5405 -j RETURN
-A PVEFW-HOST-IN -j PVEFW-Drop
-A PVEFW-HOST-IN -j NFLOG --nflog-prefix ":0:7
VEFW-HOST-IN: policy DROP: "
-A PVEFW-HOST-IN -j DROP
-A PVEFW-HOST-IN -m comment --comment "PVESIG:YL/replaced"
Now, according to wbumiller's messages, there's a default rule for port 22 (and 8006) generated by Proxmox to always allow connection on such port, which can be overriden by a REJECT (or DROP) additional rule. So I tried the below rule @Host level:
Port 22 is still opened!
Iptables-save output:
-A PVEFW-HOST-IN -i lo -j ACCEPT
-A PVEFW-HOST-IN -m conntrack --ctstate INVALID -j DROP
-A PVEFW-HOST-IN -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A PVEFW-HOST-IN -m conntrack --ctstate INVALID,NEW -j PVEFW-smurfs
-A PVEFW-HOST-IN -p tcp -j PVEFW-tcpflags
-A PVEFW-HOST-IN -p igmp -j RETURN
-A PVEFW-HOST-IN -p tcp -m tcp --dport 22 -j PVEFW-reject
-A PVEFW-HOST-IN -d 92.216.138.208/32 -p tcp -m tcp --dport 8006 -j RETURN
-A PVEFW-HOST-IN -d 92.216.138.208/32 -p udp -m udp --dport 1194 -j RETURN
-A PVEFW-HOST-IN -d 92.216.138.208/32 -p tcp -m tcp --dport 443 -j RETURN
-A PVEFW-HOST-IN -d 92.216.138.208/32 -p tcp -m tcp --dport 80 -j RETURN
-A PVEFW-HOST-IN -p tcp -m set --match-set PVEFW-0-management-v4 src -m tcp --dport 8006 -j RETURN
-A PVEFW-HOST-IN -p tcp -m set --match-set PVEFW-0-management-v4 src -m tcp --dport 5900:5999 -j RETURN
-A PVEFW-HOST-IN -p tcp -m set --match-set PVEFW-0-management-v4 src -m tcp --dport 3128 -j RETURN
-A PVEFW-HOST-IN -p tcp -m set --match-set PVEFW-0-management-v4 src -m tcp --dport 22 -j RETURN
-A PVEFW-HOST-IN -s 92.216.138.0/24 -d 92.216.138.0/24 -p udp -m udp --dport 5404:5405 -j RETURN
-A PVEFW-HOST-IN -s 92.216.138.0/24 -p udp -m addrtype --dst-type MULTICAST -m udp --dport 5404:5405 -j RETURN
-A PVEFW-HOST-IN -j PVEFW-Drop
-A PVEFW-HOST-IN -j NFLOG --nflog-prefix ":0:7
VEFW-HOST-IN: policy DROP: "
-A PVEFW-HOST-IN -j DROP
-A PVEFW-HOST-IN -m comment --comment "PVESIG:replaced"
I really can't understand why the port 22 is still not blocked.
Thanks for your help.