This is my current scenario:
I have a proxmox server in the cloud. I installed 2 VMs, that have different IPs (not on the same subnet as the main proxmox server — see THIS to understand why).
On the proxmox machine itself, I have setup a list of iptables rules that work perfectly.
# Allow localhostinterface
/sbin/iptables -A INPUT -i lo -j ACCEPT
#icmp
/sbin/iptables -A INPUT -p ICMP -j ACCEPT
#home network
/sbin/iptables -A INPUT -s xx.xx.xx.xx -j ACCEPT
# Allow already established connections
/sbin/iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
/sbin/iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
# Set default policies
/sbin/iptables -P INPUT DROP
/sbin/iptables -P FORWARD DROP
/sbin/iptables -P OUTPUT ACCEPT
#LOG IPTABLES
/sbin/iptables -N LOGGING
/sbin/iptables -A INPUT -j LOGGING
/sbin/iptables -A LOGGING -m limit --limit 2/min -j LOG --log-prefix "IPTables-Dropped: " --log-level 4
/sbin/iptables -A LOGGING -j DROP
However, for some reason, these rules do not apply to the virtual machines, which are out in the wild with no security at all. Is there a way to apply the same rules valid on the proxmox server to the vms?