Skip to content

Instantly share code, notes, and snippets.

View HariHend1973's full-sized avatar

Hari Hendaryanto HariHend1973

View GitHub Profile
@HariHend1973
HariHend1973 / ipset_update.sh
Created October 21, 2018 07:16 — forked from porjo/ipset_update.sh
Create Geo fencing country blocks for use by iptables
#!/bin/bash
#
# Update the ipset that iptables references for allowing/blocking based on country.
# Takes 2 parameters: ipset name (no spaces), country name e.g. 'Australia'
#
# iptables should have an existing '--match-set' rule e.g
# $ iptables -I INPUT -p tcp --dport 22 -m set --match-set australia4 src -j ACCEPT
# $ ip6tables -I INPUT -p tcp --dport 22 -m set --match-set australia6 src -j ACCEPT
#