{"id":907,"date":"2012-11-15T23:13:25","date_gmt":"2012-11-16T05:13:25","guid":{"rendered":"http:\/\/blog.supportpro.com\/?p=907"},"modified":"2026-03-26T23:46:09","modified_gmt":"2026-03-27T05:46:09","slug":"open-a-port-number-in-iptables-linux","status":"publish","type":"post","link":"https:\/\/www.supportpro.com\/blog\/open-a-port-number-in-iptables-linux\/","title":{"rendered":"How to Open a Port in IPTABLES on Linux Server"},"content":{"rendered":"\n<p>IPTABLES is a powerful firewall utility used in Linux servers to control incoming and outgoing network traffic. It stores firewall configuration rules in the file <strong>\/etc\/sysconfig\/iptables<\/strong>.<\/p>\n\n\n\n<p>To open a specific port, root privileges are required because firewall rules directly affect system security.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step-by-Step: Open a Port Using IPTABLES<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">1. Edit the IPTABLES Configuration File<\/h4>\n\n\n\n<p>Open the configuration file using a text editor:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>vi \/etc\/sysconfig\/iptables<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">2. Add a Rule to Allow the Port<\/h4>\n\n\n\n<p>Append the following rule to allow incoming traffic on a specific TCP port:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>-A INPUT -m state --state NEW -m tcp -p tcp --dport &#91;port_number] -j ACCEPT<\/code><\/pre>\n\n\n\n<p>Replace <strong>[port_number]<\/strong> with the required port number (for example: 8088 or 8090).<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">3. Restart IPTABLES Service<\/h4>\n\n\n\n<p>After saving the file, restart the firewall service to apply changes:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/etc\/init.d\/iptables restart<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">4. Verify the Open Port<\/h4>\n\n\n\n<p>Confirm that the port is successfully opened:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>netstat -tulpn | less<\/code><\/pre>\n\n\n\n<p>If the port appears in the list, the configuration has been applied correctly.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Conclusion<\/h3>\n\n\n\n<p>Managing firewall rules using IPTABLES allows administrators to securely control server access. Always verify firewall changes carefully to avoid blocking essential services.<\/p>\n\n\n\n<p>If you require help, <a href=\"https:\/\/www.supportpro.com\/requestquote.php\">contact SupportPRO Server Admin<\/a><\/p>\n\n\n\n<p class=\"has-text-align-center\"><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\"><a href=\"https:\/\/cta-redirect.hubspot.com\/cta\/redirect\/2725694\/9d590242-d641-4383-94b4-8cfd62f0af6b\"><\/a><\/span><\/span><\/p>\n\n\n\n<div class=\"wp-block-media-text alignwide has-media-on-the-right is-stacked-on-mobile is-vertically-aligned-center has-white-background-color has-background\"><div class=\"wp-block-media-text__content\">\n<p class=\"has-large-font-size\">Facing issues? <\/p>\n\n\n\n<p class=\"has-large-font-size\">Our technical support<br>engineers can solve it. <\/p>\n\n\n\n<!--HubSpot Call-to-Action Code --><span class=\"hs-cta-wrapper\" id=\"hs-cta-wrapper-3350a795-db50-482f-9911-301930d1b1be\"><span class=\"hs-cta-node hs-cta-3350a795-db50-482f-9911-301930d1b1be\" id=\"hs-cta-3350a795-db50-482f-9911-301930d1b1be\"><!--[if lte IE 8]><div id=\"hs-cta-ie-element\"><\/div><![endif]--><a href=\"https:\/\/cta-redirect.hubspot.com\/cta\/redirect\/2725694\/3350a795-db50-482f-9911-301930d1b1be\" ><img decoding=\"async\" class=\"hs-cta-img\" id=\"hs-cta-img-3350a795-db50-482f-9911-301930d1b1be\" style=\"border-width:0px;\" src=\"https:\/\/no-cache.hubspot.com\/cta\/default\/2725694\/3350a795-db50-482f-9911-301930d1b1be.png\"  alt=\"Contact Us today!\"\/><\/a><\/span><script charset=\"utf-8\" src=\"https:\/\/js.hscta.net\/cta\/current.js\"><\/script><script type=\"text\/javascript\"> hbspt.cta.load(2725694, '3350a795-db50-482f-9911-301930d1b1be', {\"useNewLoader\":\"true\",\"region\":\"na1\"}); <\/script><\/span><!-- end HubSpot Call-to-Action Code -->\n<\/div><figure class=\"wp-block-media-text__media\"><img fetchpriority=\"high\" decoding=\"async\" width=\"904\" height=\"931\" src=\"https:\/\/www.supportpro.com\/blog\/wp-content\/uploads\/2022\/09\/Free-server-checkup.png\" alt=\"guy server checkup\" class=\"wp-image-12943 size-full\" srcset=\"https:\/\/www.supportpro.com\/blog\/wp-content\/uploads\/2022\/09\/Free-server-checkup.png 904w, https:\/\/www.supportpro.com\/blog\/wp-content\/uploads\/2022\/09\/Free-server-checkup-291x300.png 291w, https:\/\/www.supportpro.com\/blog\/wp-content\/uploads\/2022\/09\/Free-server-checkup-768x791.png 768w, https:\/\/www.supportpro.com\/blog\/wp-content\/uploads\/2022\/09\/Free-server-checkup-585x602.png 585w\" sizes=\"(max-width: 904px) 100vw, 904px\" \/><\/figure><\/div>\n","protected":false},"excerpt":{"rendered":"<p>IPTABLES is a powerful firewall utility used in Linux servers to control incoming and outgoing network traffic. It stores firewall configuration rules in the file \/etc\/sysconfig\/iptables. To open a specific&hellip;<\/p>\n","protected":false},"author":4,"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-907","post","type-post","status-publish","format-standard","hentry","category-linux-basics"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts\/907","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\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/comments?post=907"}],"version-history":[{"count":5,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts\/907\/revisions"}],"predecessor-version":[{"id":16735,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts\/907\/revisions\/16735"}],"wp:attachment":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/media?parent=907"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/categories?post=907"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/tags?post=907"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}