{"id":18109,"date":"2022-08-13T18:07:47","date_gmt":"2022-08-13T18:07:47","guid":{"rendered":"https:\/\/linuxways.net\/?p=18109"},"modified":"2022-08-17T03:06:05","modified_gmt":"2022-08-17T03:06:05","slug":"ufw-allow-port","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/ubuntu\/ufw-allow-port\/","title":{"rendered":"UFW Allow Port"},"content":{"rendered":"<p>You must have heard numerous times that a Firewall acts as the first line of defense against external threats and attacks. Now, we would like to discuss what it really means. It means that a Firewall prevents any unauthorized entity from creeping into your network. However, you can create Firewall rules to allow the access of the authorized entities to your network. This can be done by opening certain trusted ports. Therefore, in this article, we will teach you the method of allowing a UFW port.<\/p>\n<h2><strong>Examples of Allowing a Port on UFW<\/strong><\/h2>\n<p>To learn how you can allow a port on UFW, you can go through the following examples:<\/p>\n<h3><strong>Example # 1: Allowing a Port on Both TCP and UDP<\/strong><\/h3>\n<p>In this example, we will allow a port on UFW irrespective of the protocol, i.e., this port will be allowed both on TCP and UDP. For that, we have used the following command:<\/p>\n<pre>\r\n$ sudo ufw allow 53\r\n<\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"368\" height=\"24\" class=\"wp-image-18121\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/08\/word-image-18109-1.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/08\/word-image-18109-1.png 368w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/08\/word-image-18109-1-300x20.png 300w\" sizes=\"auto, (max-width: 368px) 100vw, 368px\" \/><\/strong><\/p>\n<p>This command will allow the opening of the port \u201c53\u201d on both TCP and UDP, as shown in the following image:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"378\" height=\"74\" class=\"wp-image-18123\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/08\/word-image-18109-2.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/08\/word-image-18109-2.png 378w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/08\/word-image-18109-2-300x59.png 300w\" sizes=\"auto, (max-width: 378px) 100vw, 378px\" \/><\/p>\n<h3><strong>Example # 2: Allowing a Port on a Specific Protocol<\/strong><\/h3>\n<p>In this example, we will be allowing a port on a specific protocol like TCP. For that, we have used the following command:<\/p>\n<pre>\r\n$ sudo ufw allow 80\/tcp\r\n<\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"398\" height=\"25\" class=\"wp-image-18125\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/08\/word-image-18109-3.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/08\/word-image-18109-3.png 398w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/08\/word-image-18109-3-300x19.png 300w\" sizes=\"auto, (max-width: 398px) 100vw, 398px\" \/><\/strong><\/p>\n<p>This command will open port \u201c80\u201d only for TCP, as shown in the following image:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"413\" height=\"79\" class=\"wp-image-18129\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/08\/word-image-18109-4.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/08\/word-image-18109-4.png 413w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/08\/word-image-18109-4-300x57.png 300w\" sizes=\"auto, (max-width: 413px) 100vw, 413px\" \/><\/p>\n<h2><strong>Conclusion<\/strong><\/h2>\n<p>With this quick tutorial, we wanted to enlighten you on the procedure of allowing a UFW port. Here, we have shared two different examples with you, wherein we have shared the methods of opening a port on both protocols, i.e., TCP and UDP, and opening a port on a specific protocol. Therefore, you can conveniently allow the opening of whichever ports you prefer using the Ubuntu Firewall.<\/p>","protected":false},"excerpt":{"rendered":"<p>A guide on how to allow a UFW port to open on both protocols, such as TCP and UDP, and open a port on a specific protocol using the Ubuntu Firewall.<\/p>","protected":false},"author":3,"featured_media":18158,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-18109","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ubuntu"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/18109","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=18109"}],"version-history":[{"count":0,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/18109\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/18158"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=18109"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=18109"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=18109"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}