Files
Firewall-IPWhitelist/cloudflare-vmmanager.sh
T
2021-10-14 02:41:16 -04:00

17 lines
606 B
Bash

#!/bin/bash
output(){
echo -e '\e[36m'$1'\e[0m';
}
output "Cloudflare IPWhitelist Script for VMmanager 6"
output "Copyright © 2021 Thien Tran <contact@tommytran.io>."
output "Support: https://thientran.io/discord"
/usr/bin/yum -y install curl
/sbin/iptables -I DOCKER-USER -p tcp --dport 443 -j DROP
/sbin/iptables -I DOCKER-USER -p tcp -s $(curl -sSL https://www.cloudflare.com/ips-v4 | paste -d, -s) --dport 443 -j ACCEPT
output "Cloudflare IPv4s have been whitelisted on port 443!"
output "To make this persistent, run this script at startup. It will also update the list of Cloudflare's IPs."