{"id":9028,"date":"2026-06-05T10:43:45","date_gmt":"2026-06-05T01:43:45","guid":{"rendered":"https:\/\/hasu0707.duckdns.org\/blog\/?p=9028"},"modified":"2026-06-07T20:10:03","modified_gmt":"2026-06-07T11:10:03","slug":"%ec%b5%9c%ec%8b%a0-%ec%bb%a4%eb%84%90%ec%97%90-xtables-addons-geoip-%eb%aa%a8%eb%93%88-%ec%84%a4%ec%b9%98","status":"publish","type":"post","link":"https:\/\/hasu0707.duckdns.org\/blog\/?p=9028","title":{"rendered":"\ucd5c\uc2e0 \ucee4\ub110\uc5d0 xtables-addons geoip \ubaa8\ub4c8 \uc124\uce58"},"content":{"rendered":"\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"false\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">1. \ube4c\ub4dc\uc5d0 \ud544\uc694\ud55c \ud328\ud0a4\uc9c0 \uc124\uce58\n  apt install -y build-essential libxtables-dev git pkg-config libtool automake autoconf flex bison libmnl-dev libnftnl-dev libtext-csv-xs-perl\n  apt install -y linux-headers-$(uname -r)\n\n  \u203blinux-header \uc124\uce58\uac00 \uc2e4\ud328\ud560 \uacbd\uc6b0 \uc544\ub798\uc758 \uacfc\uc815\uc744 \ub530\ub978\ub2e4.\n    uname -r\n      linux-headers-6.18.33-current-sunxi64\n    apt search linux-headers\n      \ub610\ub294\n    apt-cache search sunxi64\n    \uc704\uc758 \uacfc\uc815\uc73c\ub85c \uc815\ud655\ud55c \ub9ac\ub205\uc2a4 \ud5e4\ub354\ud328\ud0a4\uc9c0 \uba85\uc744 \uc54c\uc544\ub0b4\uc5b4 \uc124\uce58\ud55c\ub2e4.\n    ex) apt -y install linux-headers-current-sunxi64\n\n2. \ucd5c\uc2e0\ubc84\uc804 \ud655\uc778\n  https:\/\/inai.de\/files\/xtables-addons\/\n\n3. \ud655\uc778\ud55c \ucd5c\uc2e0\ubc84\uc804 \ubcc0\uc218 \uc0dd\uc131\n  XTABLES_ADDONS_VER=3.30\n\n4. \ub514\ub809\ud1a0\ub9ac \ub9cc\ub4e4\uace0 \ub2e4\uc6b4\ub85c\ub4dc\n  mkdir work\n  cd work\n  wget --no-check-certificate \"https:\/\/inai.de\/files\/xtables-addons\/xtables-addons-${XTABLES_ADDONS_VER}.tar.zst\"\n  #tar -xJf xtables-addons-${XTABLES_ADDONS_VER}.tar.xz\n  tar -I zstd -xvf xtables-addons-${XTABLES_ADDONS_VER}.tar.zst\n  cd xtables-addons-${XTABLES_ADDONS_VER}\n\n5. \ube4c\ub4dc\n  .\/configure --prefix=\/usr --with-kbuild=\/lib\/modules\/$(uname -r)\/build\n  make\n  make install\n  depmod\n\n6. \ud655\uc778\n  # 1. xt_geoip \ucee4\ub110 \ubaa8\ub4c8 \ub85c\ub4dc\n  depmod\n  modprobe xt_geoip\n\n  # 2. \ubaa8\ub4c8\uc774 \uc815\uc0c1\uc801\uc73c\ub85c \ub85c\ub4dc\ub418\uc5c8\ub294\uc9c0 \ud655\uc778\n  lsmod | grep xt_geoip\n\n  # 3. \ud14c\uc2a4\ud2b8 \uaddc\uce59 \ucd94\uac00 (\uc911\uad6d IP \ucc28\ub2e8 \uc608\uc2dc)\n  iptables -A INPUT -m geoip --src-cc CN -j ACCEPT\n\n  # 4. \uaddc\uce59 \ud655\uc778\n  iptables -L -v -n | grep geoip\n\n7. \ucc28\ud6c4 \ucee4\ub110 \uc5c5\ub370\uc774\ud2b8 \uae08\uc9c0\n  # \ucee4\ub110 \ud328\ud0a4\uc9c0 \uace0\uc815 \ucc98\ub9ac\n  apt-mark hold linux-image-$(uname -r) linux-headers-$(uname -r) linux-modules-$(uname -r) linux-modules-extra-$(uname -r)\n  apt-mark hold linux-image-generic linux-headers-generic\n\n  # \uc790\ub3d9 \uc5c5\ub370\uc774\ud2b8 \uae08\uc9c0\n  systemctl stop apt-daily.timer apt-daily-upgrade.timer\n  systemctl disable apt-daily.timer apt-daily-upgrade.timer\n  systemctl stop unattended-upgrades\n  systemctl disable unattended-upgrades<\/pre>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_import_markdown_pro_load_document_selector":0,"_import_markdown_pro_submit_text_textarea":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[39],"tags":[],"class_list":["post-9028","post","type-post","status-publish","format-standard","hentry","category-os_linux_unix_macos"],"_links":{"self":[{"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/9028","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=9028"}],"version-history":[{"count":0,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/9028\/revisions"}],"wp:attachment":[{"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=9028"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=9028"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=9028"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}