{"id":1163,"date":"2013-11-01T03:57:08","date_gmt":"2013-11-01T09:57:08","guid":{"rendered":"http:\/\/blog.supportpro.com\/?p=1163"},"modified":"2018-10-04T00:32:07","modified_gmt":"2018-10-04T06:32:07","slug":"country-wise-ip-block","status":"publish","type":"post","link":"https:\/\/www.supportpro.com\/blog\/country-wise-ip-block\/","title":{"rendered":"Block IP in iptables based on country code"},"content":{"rendered":"<p>It is very easy to block IP (country wise) with the help of CSF the default firewall from Cpanel.But it is not the case when we try with IPTables.<\/p>\n<p>In this blog I will try to demonstrate how to Block IP from a certain country with the help of IPtables.For example purpose I choose Afghanistan and China.<\/p>\n<p><!--more--><\/p>\n<p>I will give step by step instruction to install and automate the scrtipt given below.<\/p>\n<blockquote><p>#!\/bin\/bash<br \/>\n# Purpose: Block all traffic from AFGHANISTAN (af) and CHINA (CN).<\/p>\n<p>Use ISO code. #<br \/>\n# &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\nISO=&#8221;af cn&#8221;<br \/>\n### Set PATH ###<br \/>\nIPT=\/sbin\/iptables<br \/>\nWGET=\/usr\/bin\/wget<br \/>\nEGREP=\/bin\/egrep<br \/>\n### No editing below ###<br \/>\nSPAMLIST=&#8221;countrydrop&#8221;<br \/>\nZONEROOT=&#8221;\/root\/iptables&#8221;<br \/>\nDLROOT=&#8221;http:\/\/www.ipdeny.com\/ipblocks\/data\/countries&#8221;<br \/>\ncleanOldRules(){<br \/>\n$IPT -F<br \/>\n$IPT -X<br \/>\n$IPT -t nat -F<br \/>\n$IPT -t nat -X<br \/>\n$IPT -t mangle -F<br \/>\n$IPT -t mangle -X<br \/>\n$IPT -P INPUT ACCEPT<br \/>\n$IPT -P OUTPUT ACCEPT<br \/>\n$IPT -P FORWARD ACCEPT<br \/>\n}<br \/>\n# create a dir<br \/>\n[ ! -d $ZONEROOT ] &amp;&amp; \/bin\/mkdir -p $ZONEROOT<br \/>\n# clean old rules<br \/>\ncleanOldRules<br \/>\n# create a new iptables list<br \/>\n$IPT -N $SPAMLIST<br \/>\nfor c in $ISO<br \/>\ndo<br \/>\n# local zone file<br \/>\ntDB=$ZONEROOT\/$c.zone<br \/>\n# get fresh zone file<br \/>\n$WGET -O $tDB $DLROOT\/$c.zone<br \/>\n# country specific log message<br \/>\nSPAMDROPMSG=&#8221;$c Country Drop&#8221;<br \/>\n# get<br \/>\nBADIPS=$(egrep -v &#8220;^#|^$&#8221; $tDB)<br \/>\nfor ipblock in $BADIPS<br \/>\ndo<br \/>\n$IPT -A $SPAMLIST -s $ipblock -j LOG &#8211;log-prefix<br \/>\n&#8220;$SPAMDROPMSG&#8221;<br \/>\n$IPT -A $SPAMLIST -s $ipblock -j DROP<br \/>\ndone<br \/>\ndone<br \/>\n# Drop everything<br \/>\n$IPT -I INPUT -j $SPAMLIST<br \/>\n$IPT -I OUTPUT -j $SPAMLIST<br \/>\n$IPT -I FORWARD -j $SPAMLIST<br \/>\n# call your other iptable script<br \/>\n# \/path\/to\/other\/iptables.sh<br \/>\nexit 0<\/p><\/blockquote>\n<p>Step 1<\/p>\n<p>Save above script as root user and customize ISO variable to point out country name using ISO country names. Once done install the script as follows using crontab<\/p>\n<blockquote><p># @weekly \/path\/to\/country.block.iptables.sh<\/p><\/blockquote>\n<p>To start blocking immediately type:<\/p>\n<blockquote><p># \/path\/to\/country.block.iptables.sh<\/p><\/blockquote>\n<p>Step 2<\/p>\n<p>Another, alternative to above shell script is to use geoip iptables patch. This is not standard iptables modules. You need to download patch and compile Linux kernel.<\/p>\n<p>If you require help, <a href=\"https:\/\/www.supportpro.com\/requestquote.php\">contact SupportPRO Server Admin<\/a><\/p>\n<p style=\"text-align: center;\"><!--HubSpot Call-to-Action Code --><span id=\"hs-cta-wrapper-9d590242-d641-4383-94b4-8cfd62f0af6b\" class=\"hs-cta-wrapper\"><span id=\"hs-cta-9d590242-d641-4383-94b4-8cfd62f0af6b\" class=\"hs-cta-node hs-cta-9d590242-d641-4383-94b4-8cfd62f0af6b\"><!-- [if lte IE 8]><\/p>\n\n\n\n\n\n<div id=\"hs-cta-ie-element\"><\/div>\n\n\n<![endif]--><a href=\"https:\/\/cta-redirect.hubspot.com\/cta\/redirect\/2725694\/9d590242-d641-4383-94b4-8cfd62f0af6b\"><img decoding=\"async\" id=\"hs-cta-img-9d590242-d641-4383-94b4-8cfd62f0af6b\" class=\"hs-cta-img\" style=\"border-width: 0px;\" src=\"https:\/\/no-cache.hubspot.com\/cta\/default\/2725694\/9d590242-d641-4383-94b4-8cfd62f0af6b.png\" alt=\"Server not running properly? Get A FREE Server Checkup By Expert Server Admins - $125 Value\" \/><\/a><\/span><script charset=\"utf-8\" src=\"https:\/\/js.hscta.net\/cta\/current.js\"><\/script><script type=\"text\/javascript\"> hbspt.cta.load(2725694, '9d590242-d641-4383-94b4-8cfd62f0af6b', {}); <\/script><\/span><!-- end HubSpot Call-to-Action Code --><\/p>\n","protected":false},"excerpt":{"rendered":"<p>It is very easy to block IP (country wise) with the help of CSF the default firewall from Cpanel.But it is not the case when we try with IPTables. In&hellip;<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_lmt_disableupdate":"","_lmt_disable":"","footnotes":""},"categories":[6],"tags":[],"class_list":["post-1163","post","type-post","status-publish","format-standard","hentry","category-linux-basics"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO Pro 4.9.9 - aioseo.com -->\n\t<meta name=\"description\" content=\"It is very easy to block IP (country wise) with the help of CSF the default firewall from Cpanel.But it is not the case when we try with IPTables. In this blog I will try to demonstrate how to Block IP from a certain country with the help of IPtables.For example purpose I choose Afghanistan\" \/>\n\t<meta name=\"robots\" content=\"max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n\t<meta name=\"author\" content=\"Bella\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.supportpro.com\/blog\/country-wise-ip-block\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO Pro (AIOSEO) 4.9.9\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Server Management Tips | SupportPRO Blog\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Block IP in iptables based on country code | Server Management Tips\" \/>\n\t\t<meta property=\"og:description\" content=\"It is very easy to block IP (country wise) with the help of CSF the default firewall from Cpanel.But it is not the case when we try with IPTables. In this blog I will try to demonstrate how to Block IP from a certain country with the help of IPtables.For example purpose I choose Afghanistan\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.supportpro.com\/blog\/country-wise-ip-block\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2013-11-01T09:57:08+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2018-10-04T06:32:07+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Block IP in iptables based on country code | Server Management Tips\" \/>\n\t\t<meta name=\"twitter:description\" content=\"It is very easy to block IP (country wise) with the help of CSF the default firewall from Cpanel.But it is not the case when we try with IPTables. In this blog I will try to demonstrate how to Block IP from a certain country with the help of IPtables.For example purpose I choose Afghanistan\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.supportpro.com\\\/blog\\\/country-wise-ip-block\\\/#article\",\"name\":\"Block IP in iptables based on country code | Server Management Tips\",\"headline\":\"Block IP in iptables based on country code\",\"author\":{\"@id\":\"https:\\\/\\\/www.supportpro.com\\\/blog\\\/author\\\/jeslin-j\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.supportpro.com\\\/blog\\\/#organization\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/no-cache.hubspot.com\\\/cta\\\/default\\\/2725694\\\/9d590242-d641-4383-94b4-8cfd62f0af6b.png\",\"@id\":\"https:\\\/\\\/www.supportpro.com\\\/blog\\\/country-wise-ip-block\\\/#articleImage\"},\"datePublished\":\"2013-11-01T03:57:08-06:00\",\"dateModified\":\"2018-10-04T00:32:07-06:00\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.supportpro.com\\\/blog\\\/country-wise-ip-block\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.supportpro.com\\\/blog\\\/country-wise-ip-block\\\/#webpage\"},\"articleSection\":\"Linux Basics\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.supportpro.com\\\/blog\\\/country-wise-ip-block\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.supportpro.com\\\/blog#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.supportpro.com\\\/blog\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.supportpro.com\\\/blog\\\/category\\\/linux\\\/#listItem\",\"name\":\"Linux\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.supportpro.com\\\/blog\\\/category\\\/linux\\\/#listItem\",\"position\":2,\"name\":\"Linux\",\"item\":\"https:\\\/\\\/www.supportpro.com\\\/blog\\\/category\\\/linux\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.supportpro.com\\\/blog\\\/category\\\/linux\\\/linux-basics\\\/#listItem\",\"name\":\"Linux Basics\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.supportpro.com\\\/blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.supportpro.com\\\/blog\\\/category\\\/linux\\\/linux-basics\\\/#listItem\",\"position\":3,\"name\":\"Linux Basics\",\"item\":\"https:\\\/\\\/www.supportpro.com\\\/blog\\\/category\\\/linux\\\/linux-basics\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.supportpro.com\\\/blog\\\/country-wise-ip-block\\\/#listItem\",\"name\":\"Block IP in iptables based on country code\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.supportpro.com\\\/blog\\\/category\\\/linux\\\/#listItem\",\"name\":\"Linux\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.supportpro.com\\\/blog\\\/country-wise-ip-block\\\/#listItem\",\"position\":4,\"name\":\"Block IP in iptables based on country code\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.supportpro.com\\\/blog\\\/category\\\/linux\\\/linux-basics\\\/#listItem\",\"name\":\"Linux Basics\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.supportpro.com\\\/blog\\\/#organization\",\"name\":\"SupportPRO\",\"description\":\"SupportPRO Blog\",\"url\":\"https:\\\/\\\/www.supportpro.com\\\/blog\\\/\",\"telephone\":\"+18476076123\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.supportpro.com\\\/blog\\\/author\\\/jeslin-j\\\/#author\",\"url\":\"https:\\\/\\\/www.supportpro.com\\\/blog\\\/author\\\/jeslin-j\\\/\",\"name\":\"Bella\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.supportpro.com\\\/blog\\\/country-wise-ip-block\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3ec60f871b6d1ea5ee6a2feb8075ecca0c69b8da9dba65a45ba102b7359682ed?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Bella\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.supportpro.com\\\/blog\\\/country-wise-ip-block\\\/#webpage\",\"url\":\"https:\\\/\\\/www.supportpro.com\\\/blog\\\/country-wise-ip-block\\\/\",\"name\":\"Block IP in iptables based on country code | Server Management Tips\",\"description\":\"It is very easy to block IP (country wise) with the help of CSF the default firewall from Cpanel.But it is not the case when we try with IPTables. In this blog I will try to demonstrate how to Block IP from a certain country with the help of IPtables.For example purpose I choose Afghanistan\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.supportpro.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.supportpro.com\\\/blog\\\/country-wise-ip-block\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.supportpro.com\\\/blog\\\/author\\\/jeslin-j\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.supportpro.com\\\/blog\\\/author\\\/jeslin-j\\\/#author\"},\"datePublished\":\"2013-11-01T03:57:08-06:00\",\"dateModified\":\"2018-10-04T00:32:07-06:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.supportpro.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.supportpro.com\\\/blog\\\/\",\"name\":\"Server Management Tips\",\"description\":\"SupportPRO Blog\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.supportpro.com\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO Pro -->\r\n\t\t<title>Block IP in iptables based on country code | Server Management Tips<\/title>\n\n","aioseo_head_json":{"title":"Block IP in iptables based on country code | Server Management Tips","description":"It is very easy to block IP (country wise) with the help of CSF the default firewall from Cpanel.But it is not the case when we try with IPTables. In this blog I will try to demonstrate how to Block IP from a certain country with the help of IPtables.For example purpose I choose Afghanistan","canonical_url":"https:\/\/www.supportpro.com\/blog\/country-wise-ip-block\/","robots":"max-snippet:-1, max-image-preview:large, max-video-preview:-1","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.supportpro.com\/blog\/country-wise-ip-block\/#article","name":"Block IP in iptables based on country code | Server Management Tips","headline":"Block IP in iptables based on country code","author":{"@id":"https:\/\/www.supportpro.com\/blog\/author\/jeslin-j\/#author"},"publisher":{"@id":"https:\/\/www.supportpro.com\/blog\/#organization"},"image":{"@type":"ImageObject","url":"https:\/\/no-cache.hubspot.com\/cta\/default\/2725694\/9d590242-d641-4383-94b4-8cfd62f0af6b.png","@id":"https:\/\/www.supportpro.com\/blog\/country-wise-ip-block\/#articleImage"},"datePublished":"2013-11-01T03:57:08-06:00","dateModified":"2018-10-04T00:32:07-06:00","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/www.supportpro.com\/blog\/country-wise-ip-block\/#webpage"},"isPartOf":{"@id":"https:\/\/www.supportpro.com\/blog\/country-wise-ip-block\/#webpage"},"articleSection":"Linux Basics"},{"@type":"BreadcrumbList","@id":"https:\/\/www.supportpro.com\/blog\/country-wise-ip-block\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/www.supportpro.com\/blog#listItem","position":1,"name":"Home","item":"https:\/\/www.supportpro.com\/blog","nextItem":{"@type":"ListItem","@id":"https:\/\/www.supportpro.com\/blog\/category\/linux\/#listItem","name":"Linux"}},{"@type":"ListItem","@id":"https:\/\/www.supportpro.com\/blog\/category\/linux\/#listItem","position":2,"name":"Linux","item":"https:\/\/www.supportpro.com\/blog\/category\/linux\/","nextItem":{"@type":"ListItem","@id":"https:\/\/www.supportpro.com\/blog\/category\/linux\/linux-basics\/#listItem","name":"Linux Basics"},"previousItem":{"@type":"ListItem","@id":"https:\/\/www.supportpro.com\/blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/www.supportpro.com\/blog\/category\/linux\/linux-basics\/#listItem","position":3,"name":"Linux Basics","item":"https:\/\/www.supportpro.com\/blog\/category\/linux\/linux-basics\/","nextItem":{"@type":"ListItem","@id":"https:\/\/www.supportpro.com\/blog\/country-wise-ip-block\/#listItem","name":"Block IP in iptables based on country code"},"previousItem":{"@type":"ListItem","@id":"https:\/\/www.supportpro.com\/blog\/category\/linux\/#listItem","name":"Linux"}},{"@type":"ListItem","@id":"https:\/\/www.supportpro.com\/blog\/country-wise-ip-block\/#listItem","position":4,"name":"Block IP in iptables based on country code","previousItem":{"@type":"ListItem","@id":"https:\/\/www.supportpro.com\/blog\/category\/linux\/linux-basics\/#listItem","name":"Linux Basics"}}]},{"@type":"Organization","@id":"https:\/\/www.supportpro.com\/blog\/#organization","name":"SupportPRO","description":"SupportPRO Blog","url":"https:\/\/www.supportpro.com\/blog\/","telephone":"+18476076123"},{"@type":"Person","@id":"https:\/\/www.supportpro.com\/blog\/author\/jeslin-j\/#author","url":"https:\/\/www.supportpro.com\/blog\/author\/jeslin-j\/","name":"Bella","image":{"@type":"ImageObject","@id":"https:\/\/www.supportpro.com\/blog\/country-wise-ip-block\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/3ec60f871b6d1ea5ee6a2feb8075ecca0c69b8da9dba65a45ba102b7359682ed?s=96&d=mm&r=g","width":96,"height":96,"caption":"Bella"}},{"@type":"WebPage","@id":"https:\/\/www.supportpro.com\/blog\/country-wise-ip-block\/#webpage","url":"https:\/\/www.supportpro.com\/blog\/country-wise-ip-block\/","name":"Block IP in iptables based on country code | Server Management Tips","description":"It is very easy to block IP (country wise) with the help of CSF the default firewall from Cpanel.But it is not the case when we try with IPTables. In this blog I will try to demonstrate how to Block IP from a certain country with the help of IPtables.For example purpose I choose Afghanistan","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/www.supportpro.com\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/www.supportpro.com\/blog\/country-wise-ip-block\/#breadcrumblist"},"author":{"@id":"https:\/\/www.supportpro.com\/blog\/author\/jeslin-j\/#author"},"creator":{"@id":"https:\/\/www.supportpro.com\/blog\/author\/jeslin-j\/#author"},"datePublished":"2013-11-01T03:57:08-06:00","dateModified":"2018-10-04T00:32:07-06:00"},{"@type":"WebSite","@id":"https:\/\/www.supportpro.com\/blog\/#website","url":"https:\/\/www.supportpro.com\/blog\/","name":"Server Management Tips","description":"SupportPRO Blog","inLanguage":"en-US","publisher":{"@id":"https:\/\/www.supportpro.com\/blog\/#organization"}}]},"og:locale":"en_US","og:site_name":"Server Management Tips | SupportPRO Blog","og:type":"article","og:title":"Block IP in iptables based on country code | Server Management Tips","og:description":"It is very easy to block IP (country wise) with the help of CSF the default firewall from Cpanel.But it is not the case when we try with IPTables. In this blog I will try to demonstrate how to Block IP from a certain country with the help of IPtables.For example purpose I choose Afghanistan","og:url":"https:\/\/www.supportpro.com\/blog\/country-wise-ip-block\/","article:published_time":"2013-11-01T09:57:08+00:00","article:modified_time":"2018-10-04T06:32:07+00:00","twitter:card":"summary","twitter:title":"Block IP in iptables based on country code | Server Management Tips","twitter:description":"It is very easy to block IP (country wise) with the help of CSF the default firewall from Cpanel.But it is not the case when we try with IPTables. In this blog I will try to demonstrate how to Block IP from a certain country with the help of IPtables.For example purpose I choose Afghanistan"},"aioseo_meta_data":{"post_id":"1163","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"seo_analyzer_scan_date":"2026-06-17 13:09:24","breadcrumb_settings":null,"limit_modified_date":false,"open_ai":null,"ai":null,"created":"2021-12-10 16:14:49","updated":"2026-07-01 00:10:10"},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t<a href=\"https:\/\/www.supportpro.com\/blog\" title=\"Home\">Home<\/a>\n<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t<a href=\"https:\/\/www.supportpro.com\/blog\/category\/linux\/\" title=\"Linux\">Linux<\/a>\n<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t<a href=\"https:\/\/www.supportpro.com\/blog\/category\/linux\/linux-basics\/\" title=\"Linux Basics\">Linux Basics<\/a>\n<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\tBlock IP in iptables based on country code\n<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.supportpro.com\/blog"},{"label":"Linux","link":"https:\/\/www.supportpro.com\/blog\/category\/linux\/"},{"label":"Linux Basics","link":"https:\/\/www.supportpro.com\/blog\/category\/linux\/linux-basics\/"},{"label":"Block IP in iptables based on country code","link":"https:\/\/www.supportpro.com\/blog\/country-wise-ip-block\/"}],"_links":{"self":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts\/1163","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/comments?post=1163"}],"version-history":[{"count":5,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts\/1163\/revisions"}],"predecessor-version":[{"id":3134,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts\/1163\/revisions\/3134"}],"wp:attachment":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/media?parent=1163"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/categories?post=1163"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/tags?post=1163"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}