{"id":3867,"date":"2016-05-09T17:48:22","date_gmt":"2016-05-09T17:48:22","guid":{"rendered":"https:\/\/www.inmotionhosting.com\/support\/2016\/05\/09\/basic-apf-commands\/"},"modified":"2022-12-15T14:03:51","modified_gmt":"2022-12-15T19:03:51","slug":"basic-apf-commands","status":"publish","type":"post","link":"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/basic-apf-commands\/","title":{"rendered":"Basic APF Commands"},"content":{"rendered":"\n<p>In this <a href=\"https:\/\/www.inmotionhosting.com\/dedicated-servers\">Dedicated Hosting<\/a> tutorial we will cover <strong>basic APF commands<\/strong>. The basic commands include <em>Allowing IP&#8217;s<\/em>, <em>Blocking IP&#8217;s<\/em>, and <em>Unblocking IP&#8217;s<\/em>. After explaining what the command does, we will show you an example of the APF Command.<\/p>\n\n\n\n<div class=\"alert alert-warning\" role=\"alert\"><strong>Note:<\/strong> You will need <a href=\"https:\/\/www.inmotionhosting.com\/support\/amp\/obtain-root-access\/\">root access<\/a> in order to use these commands.<\/div>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"#allow-ip\">Allowing IP Addresses in APF<\/a><\/li>\n\n\n\n<li><a href=\"#block-ip\">Blocking IP Addresses in APF<\/a><\/li>\n\n\n\n<li><a href=\"#unblock-ip\">Unblocking IP Addresses in APF<\/a><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"allow-ip\">Allowing IP Addresses in APF<\/h2>\n\n\n\n<ol class=\"article_list wp-block-list\">\n<li><a href=\"https:\/\/www.inmotionhosting.com\/support\/server\/ssh\/connect-ssh\/\">Log into your server via SSH<\/a>.<\/li>\n\n\n\n<li>Here is a breakdown of the the APF command for <strong>allowing<\/strong> IP&#8217;s in APF. Be sure to replace this example IP address with the actual IP you want to allow:<br><pre>apf -a 12.34.56.789<\/pre><br>You can also follow the IP address with a note regarding what you are allowing. Below is an example of the command (highlighted in <span style=\"color: red;\">red<\/span>) in your shell instance:<br><code><em>root@ded999 [~]<\/em># <span style=\"color: red;\"><strong>apf -a 123.456.789 Allowing Office IP<\/strong><\/span><\/code><\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"block-ip\">Blocking IP Addresses in APF<\/h2>\n\n\n\n<ol class=\"article_list wp-block-list\">\n<li><a href=\"https:\/\/www.inmotionhosting.com\/support\/server\/ssh\/connect-ssh\/\">Log into your server via SSH<\/a>.<\/li>\n\n\n\n<li>Here is a breakdown of the the APF command for <strong>blocking<\/strong> IP&#8217;s in APF.  Remember to replace this example IP address with the actual IP you want to block:<br><pre>apf -d 12.34.56.789<\/pre><br>Again, you can also follow the IP address with a note regarding what you are allowing. Below is an example of the command (highlighted in <span style=\"color: red;\">red<\/span>) in your shell instance:<br><code><em>root@ded999 [~]<\/em># <span style=\"color: red;\"><strong>apf -d 123.456.789 Blocking Office IP<\/strong><\/span><\/code><\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"unblock-ip\">Unblocking IP Addresses in APF<\/h2>\n\n\n\n<ol class=\"article_list wp-block-list\">\n<li><a href=\"https:\/\/www.inmotionhosting.com\/support\/server\/ssh\/connect-ssh\/\">Log into your server via SSH<\/a>.<\/li>\n\n\n\n<li>Here is a breakdown of the the APF command for <strong>unblocking<\/strong> IP&#8217;s in APF. Don&#8217;t forget to replace this IP address with the one you want to unblock:<br><pre>apf -u 12.34.56.789<\/pre><br>Below is an example of the command (highlighted in <span style=\"color: red;\">red<\/span>) in your shell instance:<br><code><em>root@ded999 [~]<\/em># <span style=\"color: red;\"><strong>apf -u 123.456.789<\/strong><\/span><\/code><\/li>\n<\/ol>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>Congratulations, now you are familiar with the basic APF including <em>Allowing IP&#8217;s<\/em>, <em>Blocking IP&#8217;s<\/em>, and <em>Unblocking IP&#8217;s<\/em>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this Dedicated Hosting tutorial we will cover basic APF commands. The basic commands include Allowing IP&#8217;s, Blocking IP&#8217;s, and Unblocking IP&#8217;s. After explaining what the command does, we will show you an example of the APF Command. Note: You will need root access in order to use these commands. Allowing IP Addresses in APF<a class=\"moretag\" href=\"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/basic-apf-commands\/\"> Read More ><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4308],"tags":[],"class_list":["post-3867","post","type-post","status-publish","format-standard","hentry","category-linux"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Basic APF Commands | InMotion Hosting<\/title>\n<meta name=\"description\" content=\"Learn Basic APF Commands for Allowing IP&#039;s, Blocking IP&#039;s, and Unblocking IP&#039;s.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/basic-apf-commands\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Basic APF Commands | InMotion Hosting\" \/>\n<meta property=\"og:description\" content=\"Learn Basic APF Commands for Allowing IP&#039;s, Blocking IP&#039;s, and Unblocking IP&#039;s.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/basic-apf-commands\/\" \/>\n<meta property=\"og:site_name\" content=\"InMotion Hosting Support Center\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/inmotionhosting\/\" \/>\n<meta property=\"article:published_time\" content=\"2016-05-09T17:48:22+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-12-15T19:03:51+00:00\" \/>\n<meta name=\"author\" content=\"InMotion Hosting Contributor\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/InMotionHosting\" \/>\n<meta name=\"twitter:site\" content=\"@InMotionHosting\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"InMotion Hosting Contributor\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/basic-apf-commands\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/basic-apf-commands\/\"},\"author\":{\"name\":\"InMotion Hosting Contributor\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/5fbfcaed32a2672fb83ab312f5b7237b\"},\"headline\":\"Basic APF Commands\",\"datePublished\":\"2016-05-09T17:48:22+00:00\",\"dateModified\":\"2022-12-15T19:03:51+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/basic-apf-commands\/\"},\"wordCount\":288,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\"},\"articleSection\":[\"Linux\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/basic-apf-commands\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/basic-apf-commands\/\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/basic-apf-commands\/\",\"name\":\"Basic APF Commands | InMotion Hosting\",\"isPartOf\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#website\"},\"datePublished\":\"2016-05-09T17:48:22+00:00\",\"dateModified\":\"2022-12-15T19:03:51+00:00\",\"description\":\"Learn Basic APF Commands for Allowing IP's, Blocking IP's, and Unblocking IP's.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/basic-apf-commands\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/basic-apf-commands\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/basic-apf-commands\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.inmotionhosting.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Basic APF Commands\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#website\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/\",\"name\":\"InMotion Hosting Support Center\",\"description\":\"Web Hosting Support &amp; Tutorials\",\"publisher\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.inmotionhosting.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\",\"name\":\"InMotion Hosting\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg\",\"contentUrl\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg\",\"width\":696,\"height\":696,\"caption\":\"InMotion Hosting\"},\"image\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/inmotionhosting\/\",\"https:\/\/x.com\/InMotionHosting\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/5fbfcaed32a2672fb83ab312f5b7237b\",\"name\":\"InMotion Hosting Contributor\",\"description\":\"InMotion Hosting contributors are highly knowledgeable individuals who create relevant content on new trends and troubleshooting techniques to help you achieve your online goals!\",\"sameAs\":[\"https:\/\/www.linkedin.com\/company\/inmotion-hosting\/\",\"https:\/\/x.com\/https:\/\/twitter.com\/InMotionHosting\"],\"url\":\"https:\/\/www.inmotionhosting.com\/support\/author\/john-paul\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Basic APF Commands | InMotion Hosting","description":"Learn Basic APF Commands for Allowing IP's, Blocking IP's, and Unblocking IP's.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/basic-apf-commands\/","og_locale":"en_US","og_type":"article","og_title":"Basic APF Commands | InMotion Hosting","og_description":"Learn Basic APF Commands for Allowing IP's, Blocking IP's, and Unblocking IP's.","og_url":"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/basic-apf-commands\/","og_site_name":"InMotion Hosting Support Center","article_publisher":"https:\/\/www.facebook.com\/inmotionhosting\/","article_published_time":"2016-05-09T17:48:22+00:00","article_modified_time":"2022-12-15T19:03:51+00:00","author":"InMotion Hosting Contributor","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/InMotionHosting","twitter_site":"@InMotionHosting","twitter_misc":{"Written by":"InMotion Hosting Contributor","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/basic-apf-commands\/#article","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/basic-apf-commands\/"},"author":{"name":"InMotion Hosting Contributor","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/5fbfcaed32a2672fb83ab312f5b7237b"},"headline":"Basic APF Commands","datePublished":"2016-05-09T17:48:22+00:00","dateModified":"2022-12-15T19:03:51+00:00","mainEntityOfPage":{"@id":"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/basic-apf-commands\/"},"wordCount":288,"commentCount":0,"publisher":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#organization"},"articleSection":["Linux"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.inmotionhosting.com\/support\/server\/linux\/basic-apf-commands\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/basic-apf-commands\/","url":"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/basic-apf-commands\/","name":"Basic APF Commands | InMotion Hosting","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#website"},"datePublished":"2016-05-09T17:48:22+00:00","dateModified":"2022-12-15T19:03:51+00:00","description":"Learn Basic APF Commands for Allowing IP's, Blocking IP's, and Unblocking IP's.","breadcrumb":{"@id":"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/basic-apf-commands\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.inmotionhosting.com\/support\/server\/linux\/basic-apf-commands\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/basic-apf-commands\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.inmotionhosting.com\/support\/"},{"@type":"ListItem","position":2,"name":"Basic APF Commands"}]},{"@type":"WebSite","@id":"https:\/\/www.inmotionhosting.com\/support\/#website","url":"https:\/\/www.inmotionhosting.com\/support\/","name":"InMotion Hosting Support Center","description":"Web Hosting Support &amp; Tutorials","publisher":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.inmotionhosting.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.inmotionhosting.com\/support\/#organization","name":"InMotion Hosting","url":"https:\/\/www.inmotionhosting.com\/support\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/","url":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg","contentUrl":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg","width":696,"height":696,"caption":"InMotion Hosting"},"image":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/inmotionhosting\/","https:\/\/x.com\/InMotionHosting"]},{"@type":"Person","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/5fbfcaed32a2672fb83ab312f5b7237b","name":"InMotion Hosting Contributor","description":"InMotion Hosting contributors are highly knowledgeable individuals who create relevant content on new trends and troubleshooting techniques to help you achieve your online goals!","sameAs":["https:\/\/www.linkedin.com\/company\/inmotion-hosting\/","https:\/\/x.com\/https:\/\/twitter.com\/InMotionHosting"],"url":"https:\/\/www.inmotionhosting.com\/support\/author\/john-paul\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"primary_category":{"id":4308,"name":"Linux","slug":"linux","link":"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/"},"_links":{"self":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/3867","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/comments?post=3867"}],"version-history":[{"count":3,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/3867\/revisions"}],"predecessor-version":[{"id":102015,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/3867\/revisions\/102015"}],"wp:attachment":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/media?parent=3867"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/categories?post=3867"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/tags?post=3867"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}