?????Linux???????????????????
???????????? ???????[ 2016/1/4 10:50:25 ] ?????????????? Linux
?????????????????????Linux?????????????????????Щ????£?????????????λ?????????????????????????????????????????????????????????Щ????????????????????IP???????????????£????????????????????????????????????SSH????????????????????????з???????????????????Щ?????????????????????????????????????????????????????????????????洢????
??????????Щ??????????????????????????????????????????й?????м??????????????????????????????????TCP?????(TCP wrapper)???????????????(????SSH??NFS??httpd)?????????????????????????????????????????ó???????????????????TCP???????????TCP?????????????????????????(???????Arch Linux??????TCP??????????)???????????????????GeoIP?????????ipset?????????????iptables????????????????????????????iptables?????????ó??????????????????á?
?????????????н?????????????iptables??GeoIP???????????????????xtables-addons????Щ?????????????????????б?????????£?xtables-addons?????????netfilter/iptables???????xtables-addons???????????xt_geoip????飬??????????netfilter/iptables????????????????/??????????NAT??????????????????????xt_geoip??????????±???????iptables??????????xtables-addons??飬???????????????????(/lib/modules/`uname -r`/build)?????????????????????????????xtables-addons??xt_geoip??????????iptables?????á?
????????xt_geoip??ipset??????????????(http://xtables-addons.sourceforge.net/geoip.php)????xt_geoip????????????????ipset????????????????棬??????е?ipset????????????
?????????????????????????????iptables/xt_geoip?????????/??????????????????
??????Xtables-addons?????Linux??
?????????????α???xtables-addons??????????????????Linux?????
????????xtables-addons??????????????????????????
????·????????????????Debian??Ubuntu??Linux Mint??
????$ sudo apt-get install iptables-dev xtables-addons-common libtext-csv-xs-perl pkg-config
????·????????????????CentOS??RHEL??Fedora??
????CentOS/RHEL 6???????EPEL?????(????perl-Text-CSV_XS)??
????$ sudo yum install gcc-c++ make automake kernel-devel-`uname -r` wget unzip iptables-devel perl-Text-CSV_XS
???????????Xtables-addons
???????????(http://xtables-addons.sourceforge.net)?????μ?xtables-addons??????????/????????????????
????$wget http://downloads.sourceforge.net/project/xtables-addons/Xtables-addons/xtables-addons
????-2.10.tar.xz
????$ tar xf xtables-addons-2.10.tar.xz
????$ cd xtables-addons-2.10
????$ ./configure
????$ make
????$ sudo make install
????????????????????????????SELinux???????????(CentOS??RHEL??Fedora)???б??????SELinux????????????????????SELinux?????iptables???xt_geoip??顣
????$ sudo chcon -vR --user=system_u /lib/modules/$(uname -r)/extra/*.ko
????$ sudo chcon -vR --type=lib_t /lib64/xtables/*.so
?????Xtables-addons???GeoIP?????
?????????????GeoIP?????xt_geoip????????????????IP?????????????????xtables-addons????????????????????????????????MaxMind????GeoIP????????????????xt_geoip?????????????????Щ???λ?????????????geoip????????檔????????????????????GeoIP???????????????????????
????$ cd geoip
????$ ./xt_geoip_dl
????$ ./xt_geoip_build GeoIPCountryWhois.csv
????$ sudo mkdir -p /usr/share/xt_geoip
????$ sudo cp -r {BE??LE} /usr/share/xt_geoip
??????MaxMind???????GeoIP???????????99.8%???????????????????????????????GeoIP??????????£???????????????е??????????????????α???GeoIP?????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11