{"id":7403,"date":"2023-09-29T18:54:34","date_gmt":"2023-09-29T13:24:34","guid":{"rendered":"https:\/\/pheonixsolutions.com\/blog\/?p=7403"},"modified":"2023-09-29T18:54:41","modified_gmt":"2023-09-29T13:24:41","slug":"how-to-allow-any-tcp-port-via-firewall","status":"publish","type":"post","link":"https:\/\/pheonixsolutions.com\/blog\/how-to-allow-any-tcp-port-via-firewall\/","title":{"rendered":"How to allow any TCP port via Firewall?"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><strong>Introduction:<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Opening port TCP on CentOS 7 is a common task when you want to allow network traffic to reach a specific service or application running on your server. Port TCP is often used for web applications and web servers, including alternative HTTP ports or application-specific services. In this guide, we&#8217;ll walk you through the steps to open port TCP on CentOS 7 using the <code>firewalld<\/code> firewall management tool.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Step1:<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Before opening port TCP, it&#8217;s a good practice to check your server&#8217;s current firewall configuration to ensure you don&#8217;t disrupt existing rules.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>$ sudo firewall-cmd &#8211;list-all<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Step2:<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Use the <code>firewall-cmd<\/code> command to open port TCP. You will specify the zone where you want to add the rule (e.g., <code>public<\/code> for the default public zone) and use the <code>--add-port<\/code> option to specify the port and protocol (TCP in this case).<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>$sudo firewall-cmd &#8211;zone=public &#8211;add-port=8475\/tcp &#8211;permanent<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Step3: <\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Reload the firewall with the below command.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>$sudo firewall-cmd &#8211;reload<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Step4:<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Verify that the new rule for port 8475 is now active.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>$sudo firewall-cmd &#8211;list-all<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Conclusion:<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Successfully opened port TCP on your CentOS 7 server. This allows incoming network traffic on port TCP, which can be used for various purposes, such as hosting web applications or services. Ensure that you configure any applications or services listening on port TCP to handle incoming traffic appropriately and securely.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction: Opening port TCP on CentOS 7 is a common task when you want to allow network traffic to reach [&hellip;]<\/p>\n","protected":false},"author":496,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"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":"","ast-disable-related-posts":"","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":"default","ast-page-background-enabled":"default","ast-page-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":"","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-4)","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-4)","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-4)","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":""}},"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[1024],"tags":[],"class_list":["post-7403","post","type-post","status-publish","format-standard","hentry","category-security","psol-cat-security"],"jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/phns3A-1Vp","jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/7403","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/users\/496"}],"replies":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=7403"}],"version-history":[{"count":0,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/7403\/revisions"}],"wp:attachment":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=7403"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=7403"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=7403"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}