{"id":2722,"date":"2013-05-17T12:16:38","date_gmt":"2013-05-17T12:16:38","guid":{"rendered":"https:\/\/www.inmotionhosting.com\/support\/2013\/05\/17\/how-to-open-a-port-in-your-firewall\/"},"modified":"2023-01-27T18:22:29","modified_gmt":"2023-01-27T23:22:29","slug":"how-to-open-a-port-in-your-firewall","status":"publish","type":"post","link":"https:\/\/www.inmotionhosting.com\/support\/server\/ssh\/how-to-open-a-port-in-your-firewall\/","title":{"rendered":"How to Open a Port in Your Firewall"},"content":{"rendered":"\n<p>I was recently asked how to open ports within the firewall. Since it&#8217;s been quite a while since I&#8217;ve had to do something like this, I took the time to relearn and write some documentation.<\/p>\n\n\n\n<p>In this tutorial, I&#8217;ll cover how to open a port on your server and test that it is open. More specifically, we will open port 9090.<\/p>\n\n\n\n<p>Please note! This tutorial assumes you have a <a href=\"https:\/\/www.inmotionhosting.com\/vps-hosting\">VPS Server<\/a> or a <a href=\"https:\/\/www.inmotionhosting.com\/dedicated-servers\">Dedicated Server<\/a>, that you have <a href=\"\/support\/server\/ssh\/root-access-faq\/\">root access<\/a>, and that you know how to <a href=\"\/support\/server\/ssh\/how-to-login-ssh\/\">connect to your server via SSH<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 1: Check if the Port is Open Already<\/h2>\n\n\n\n<p>The first thing we want to do is <a href=\"\/support\/email\/communicating-email-server-telnet\/\">test using telnet<\/a> to ensure port 9090 is not already open. Please note that you may need to <a href=\"\/support\/website\/enable-telnet\/\">enable telnet<\/a> in Windows first. The command below was run from cmd.exe in Windows 7:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><span style=\"color: red;\">telnet example.com 9090<\/span><\/pre>\n\n\n\n<p>And we got the following results:<\/p>\n\n\n\n<pre id=\"block-1b22db18-5a17-476e-8fff-463f9dd49a74\" class=\"wp-block-preformatted\">Connecting To example.com...Could not open connection to the host, on port 9090: Connect failed<\/pre>\n\n\n\n<p>As you can see, <span style=\"color: orange; font-weight: bold;\">the connection failed<\/span>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 2: Open the Port<\/h2>\n\n\n\n<p>To open a port, first open for edit your APF configuration file &#8211; \/etc\/apf\/conf.apf:<br>(The below was ran within PuTTY after connecting vis SSH)<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><span style=\"color: red;\">vim \/etc\/apf\/conf.apf<\/span><\/pre>\n\n\n\n<p>Then, find the following lines and add the port in question:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># Common ingress (inbound) TCP ports IG_TCP_CPORTS=\"20,21,25,53,80,110,113,143,443,465,993,995,2049,2077,2078,2082,2083,2086,2087,2089,2095,2096,3306,5222,<span style=\"color: red;\">9090<\/span>,12001\"  # Common ingress (inbound) UDP ports IG_UDP_CPORTS=\"53,161,32786,111,2049,<span style=\"color: red;\">9090<\/span>\"<\/pre>\n\n\n\n<p>After editing the file and adding the ports, restart APF:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><span style=\"color: red;\">service apf restart<\/span><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Step 3: Test Again to See if the Port is Open<\/h2>\n\n\n\n<p>Now that APF is restarted, we can once again use telnet to test if the port is open:<br>(The command below was ran from cmd.exe in Windows 7)<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><span style=\"color: red;\">telnet example.com 9090<\/span><\/pre>\n\n\n\n<pre id=\"block-0bb77759-315b-4b4f-b148-7113616e2c6a\" class=\"wp-block-preformatted\">Connecting To example.com... 220-vps###.inmotionhosting.com ESMTP Exim 4.80 #2 Fri, 17 May 2013 05:11:39 -0700 220-We do not authorize the use of this system to transport unsolicited, 220 and\/or bulk e-mail.<\/pre>\n\n\n\n<p>As you can see, instead of the <em>Connect failed<\/em> message, we received <span style=\"color: orange;\">the greeting from the application running on port 9090<\/span>. Congratulations, you now know how to open a port on your server using ssh!<\/p>\n\n\n\n<div class=\"alert alert-warning\" role=\"alert\"><strong>Please note!<\/strong> If you do not have any services running on your server listening to the port in question, you won&#8217;t get a response when you do a telnet test. In the above scenario, we <a href=\"\/support\/server\/ssh\/how-to-run-exim-on-an-additional-port\/\">setup exim to listen on port 9090<\/a>, which is why we received a response.<\/div>\n","protected":false},"excerpt":{"rendered":"<p>I was recently asked how to open ports within the firewall. Since it&#8217;s been quite a while since I&#8217;ve had to do something like this, I took the time to relearn and write some documentation. In this tutorial, I&#8217;ll cover how to open a port on your server and test that it is open. More<a class=\"moretag\" href=\"https:\/\/www.inmotionhosting.com\/support\/server\/ssh\/how-to-open-a-port-in-your-firewall\/\"> Read More ><\/a><\/p>\n","protected":false},"author":2,"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":[4307],"tags":[],"class_list":["post-2722","post","type-post","status-publish","format-standard","hentry","category-ssh"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Open a Port in Your Firewall | InMotion Hosting<\/title>\n<meta name=\"description\" content=\"Learn how to edit your APF configuration file and open additional ports on your server.\" \/>\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\/ssh\/how-to-open-a-port-in-your-firewall\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Open a Port in Your Firewall | InMotion Hosting\" \/>\n<meta property=\"og:description\" content=\"Learn how to edit your APF configuration file and open additional ports on your server.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.inmotionhosting.com\/support\/server\/ssh\/how-to-open-a-port-in-your-firewall\/\" \/>\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=\"2013-05-17T12:16:38+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-01-27T23:22:29+00:00\" \/>\n<meta name=\"author\" content=\"Brad Markle\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@InMotionHosting\" \/>\n<meta name=\"twitter:site\" content=\"@InMotionHosting\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Brad Markle\" \/>\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\/ssh\/how-to-open-a-port-in-your-firewall\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/server\/ssh\/how-to-open-a-port-in-your-firewall\/\"},\"author\":{\"name\":\"Brad Markle\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/5ae05d1210b0ef63c437ccedce2799bf\"},\"headline\":\"How to Open a Port in Your Firewall\",\"datePublished\":\"2013-05-17T12:16:38+00:00\",\"dateModified\":\"2023-01-27T23:22:29+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/server\/ssh\/how-to-open-a-port-in-your-firewall\/\"},\"wordCount\":336,\"commentCount\":11,\"publisher\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\"},\"articleSection\":[\"SSH and Root Access\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.inmotionhosting.com\/support\/server\/ssh\/how-to-open-a-port-in-your-firewall\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/server\/ssh\/how-to-open-a-port-in-your-firewall\/\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/server\/ssh\/how-to-open-a-port-in-your-firewall\/\",\"name\":\"How to Open a Port in Your Firewall | InMotion Hosting\",\"isPartOf\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#website\"},\"datePublished\":\"2013-05-17T12:16:38+00:00\",\"dateModified\":\"2023-01-27T23:22:29+00:00\",\"description\":\"Learn how to edit your APF configuration file and open additional ports on your server.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/server\/ssh\/how-to-open-a-port-in-your-firewall\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.inmotionhosting.com\/support\/server\/ssh\/how-to-open-a-port-in-your-firewall\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/server\/ssh\/how-to-open-a-port-in-your-firewall\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.inmotionhosting.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Open a Port in Your Firewall\"}]},{\"@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\/5ae05d1210b0ef63c437ccedce2799bf\",\"name\":\"Brad Markle\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/author\/bradm\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Open a Port in Your Firewall | InMotion Hosting","description":"Learn how to edit your APF configuration file and open additional ports on your server.","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\/ssh\/how-to-open-a-port-in-your-firewall\/","og_locale":"en_US","og_type":"article","og_title":"How to Open a Port in Your Firewall | InMotion Hosting","og_description":"Learn how to edit your APF configuration file and open additional ports on your server.","og_url":"https:\/\/www.inmotionhosting.com\/support\/server\/ssh\/how-to-open-a-port-in-your-firewall\/","og_site_name":"InMotion Hosting Support Center","article_publisher":"https:\/\/www.facebook.com\/inmotionhosting\/","article_published_time":"2013-05-17T12:16:38+00:00","article_modified_time":"2023-01-27T23:22:29+00:00","author":"Brad Markle","twitter_card":"summary_large_image","twitter_creator":"@InMotionHosting","twitter_site":"@InMotionHosting","twitter_misc":{"Written by":"Brad Markle","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.inmotionhosting.com\/support\/server\/ssh\/how-to-open-a-port-in-your-firewall\/#article","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/support\/server\/ssh\/how-to-open-a-port-in-your-firewall\/"},"author":{"name":"Brad Markle","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/5ae05d1210b0ef63c437ccedce2799bf"},"headline":"How to Open a Port in Your Firewall","datePublished":"2013-05-17T12:16:38+00:00","dateModified":"2023-01-27T23:22:29+00:00","mainEntityOfPage":{"@id":"https:\/\/www.inmotionhosting.com\/support\/server\/ssh\/how-to-open-a-port-in-your-firewall\/"},"wordCount":336,"commentCount":11,"publisher":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#organization"},"articleSection":["SSH and Root Access"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.inmotionhosting.com\/support\/server\/ssh\/how-to-open-a-port-in-your-firewall\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.inmotionhosting.com\/support\/server\/ssh\/how-to-open-a-port-in-your-firewall\/","url":"https:\/\/www.inmotionhosting.com\/support\/server\/ssh\/how-to-open-a-port-in-your-firewall\/","name":"How to Open a Port in Your Firewall | InMotion Hosting","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#website"},"datePublished":"2013-05-17T12:16:38+00:00","dateModified":"2023-01-27T23:22:29+00:00","description":"Learn how to edit your APF configuration file and open additional ports on your server.","breadcrumb":{"@id":"https:\/\/www.inmotionhosting.com\/support\/server\/ssh\/how-to-open-a-port-in-your-firewall\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.inmotionhosting.com\/support\/server\/ssh\/how-to-open-a-port-in-your-firewall\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.inmotionhosting.com\/support\/server\/ssh\/how-to-open-a-port-in-your-firewall\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.inmotionhosting.com\/support\/"},{"@type":"ListItem","position":2,"name":"How to Open a Port in Your Firewall"}]},{"@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\/5ae05d1210b0ef63c437ccedce2799bf","name":"Brad Markle","url":"https:\/\/www.inmotionhosting.com\/support\/author\/bradm\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"primary_category":{"id":4307,"name":"SSH and Root Access","slug":"ssh","link":"https:\/\/www.inmotionhosting.com\/support\/server\/ssh\/"},"_links":{"self":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/2722","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\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/comments?post=2722"}],"version-history":[{"count":5,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/2722\/revisions"}],"predecessor-version":[{"id":102712,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/2722\/revisions\/102712"}],"wp:attachment":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/media?parent=2722"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/categories?post=2722"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/tags?post=2722"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}