Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 0. OS is Debian GNU/Linux 7.8 (wheezy) amd64
- 0.5. login as root
- 1. install packages:
- # apt-get update
- # apt-get install xtables-addons-dkms
- # apt-get install libtext-csv-xs-perl
- 2. create geoip bases dir
- # mkdir -p /usr/share/xt_geoip
- 3. create update script
- # mkdir -p ~/scripts
- # nano -w ~/scripts/geoip-download.sh
- 3.1. scrpt file contents
- #!/bin/bash
- cd /usr/share/xt_geoip
- /usr/lib/xtables-addons/xt_geoip_dl
- cat GeoIPCountryWhois.csv GeoIPv6.csv | /usr/lib/xtables-addons/xt_geoip_build
- 3.2. make script file executable
- # chmod +x ~/scripts/geoip-download.sh
- 4. run this script once to debug:
- # ~/scripts/geoip-download.sh
- 5. check if rules are working
- # iptables -A INPUT -m geoip --src-cc RU -j ACCEPT
- # iptables -D INPUT -m geoip --src-cc RU -j ACCEPT
- if these iptables calls pass without errors, that is ok
- 6. setup the geoip bases weekly update
- # cp ~/scripts/geoip-download.sh /etc/cron.weekly
- 7. profit :-)
- ref: https://chebnix.ru/blog/sysadmins/173.html
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement