Automatically generate GCP shell commands to set firewall that blocks ingress from certain region
Get the latest IP list here, and choose the output format as CIDR.
Note that this program requires C++17 standard, make sure your compiler is not too old
mkdir build && cd build
cmake .. -G Ninja
ninja
./command_generator -i (input ip list) -id (GCP project id)
chmod +x block_china.sh
./block_china.sh
If you are updating firewall rules, make sure clear the old ones before adding the latest rules.