{"id":24943,"date":"2024-02-26T10:02:06","date_gmt":"2024-02-26T10:02:06","guid":{"rendered":"https:\/\/linuxways.net\/?p=24943"},"modified":"2024-02-26T10:02:06","modified_gmt":"2024-02-26T10:02:06","slug":"install-setup-firewall-kali-linux","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/kali-linux\/install-setup-firewall-kali-linux\/","title":{"rendered":"How to Install and Setup Firewall on Kali Linux"},"content":{"rendered":"<p><strong>Kali Linux <\/strong>is an open-source robust operating system that people widely use to perform tasks like penetration testing, reverse engineering, network troubleshooting and more.<strong> Kali Linux<\/strong>, like other Linux operating systems, is known to be resilient against the cyber threat. However, that doesn\u2019t mean the system privacy and security cannot be compromised. You should adopt precautionary measures to make it hard for an unauthorized user to enter your system.<\/p>\n<p><a id=\"post-24943-_4lahegj99mrc\"><\/a>To help you with that, there is a network security system called <strong>Firewall<\/strong> that is widely used for managing and monitoring the incoming and outgoing connections on your system. With<strong> Firewall<\/strong>, you can filter the incoming and outgoing traffic based on some predefined rules. It acts as a bridge between your trusted network and an untrusted network like the Internet, and allows and denies those connections that don\u2019t meet the requirement of a specified rule.<\/p>\n<p>In this guide, you will learn:<\/p>\n<ul>\n<li><a href=\"#post-24943-_5xfms5f2u3cc\"><strong>How to Install and Setup Firewall on Kali Linux<\/strong><\/a><\/li>\n<li><a href=\"#post-24943-_5i3mlz57gxtw\"><strong>How to Use Firewall on Kali Linux<\/strong><\/a><\/li>\n<li><a href=\"#post-24943-_z6k2ylpqv9sv\"><strong>How to Delete a Specific Firewall Rule on Kali Linux<\/strong><\/a><\/li>\n<li><a href=\"#post-24943-_bt2t1wyr7rh4\"><strong>How to Reset Firewall Settings and Rules on Kali Linux<\/strong><\/a><\/li>\n<li><a href=\"#post-24943-_za8syv1ous6c\"><strong>Bonus Method: How to Install Firewall GUI (GUFW) on Kali Linux<\/strong><\/a><\/li>\n<li><a href=\"#post-24943-_uyckm5a1g75u\"><strong>Conclusion<\/strong><\/a><\/li>\n<\/ul>\n<h2><a id=\"post-24943-_5xfms5f2u3cc\"><\/a>How to Install and Setup Firewall on Kali Linux<\/h2>\n<p>To set up <strong>Firewall<\/strong> on your Kali Linux system, you need to ensure it is installed on your system. By default, <strong>Firewall<\/strong> is not installed on the Kali Linux system, but with the apt repository, you can install the <strong>Firewall <\/strong>package called <strong>UFW<\/strong> on the system. To install and setup <strong>Firewall <\/strong>on Kali Linux, follow the below-given steps:<\/p>\n<h3>Step 1: Update Kali Linux Repository<\/h3>\n<p>Since, the <strong>Firewall<\/strong> package is installed from the apt repository, it is recommended to update your repository from the below-given command to ensure installing the up-to-date packages on Kali Linux:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> apt update <span class=\"sy0\">&amp;&amp;<\/span> <span class=\"kw2\">sudo<\/span> apt upgrade<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"773\" height=\"320\" class=\"wp-image-24968\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-1.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-1.png 773w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-1-300x124.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-1-768x318.png 768w\" sizes=\"auto, (max-width: 773px) 100vw, 773px\" \/><\/p>\n<h3>Step 2: Install Firewall on Kali Linux<\/h3>\n<p>After you updated the repository, you can use the following command to install<strong> Firewall (UFW) <\/strong>on your Kali Linux system:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> apt <span class=\"kw2\">install<\/span> ufw <span class=\"re5\">-y<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"774\" height=\"405\" class=\"wp-image-24974\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-2.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-2.png 774w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-2-300x157.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-2-768x402.png 768w\" sizes=\"auto, (max-width: 774px) 100vw, 774px\" \/><\/p>\n<h3>Step 3: Enable Firewall on Kali Linux<\/h3>\n<p>After installing the<strong> Firewall<\/strong>, you can enable it from the following command so that it will be automatically activated on the system startup:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> ufw <span class=\"kw3\">enable<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"772\" height=\"146\" class=\"wp-image-24979\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-3.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-3.png 772w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-3-300x57.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-3-768x145.png 768w\" sizes=\"auto, (max-width: 772px) 100vw, 772px\" \/><\/p>\n<h3>Step 4: Check Firewall Status on Kali Linux<\/h3>\n<p>If you want to check the <strong>Firewall <\/strong>status on Kali Linux system, you can use the provided command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> ufw status<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"770\" height=\"146\" class=\"wp-image-24984\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-4.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-4.png 770w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-4-300x57.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-4-768x146.png 768w\" sizes=\"auto, (max-width: 770px) 100vw, 770px\" \/><\/p>\n<h3>Step 5: Check Verbose Firewall Status<\/h3>\n<p>If you want to check for detailed information about<strong> Firewall<\/strong> status on Kali Linux, you can simply run the below-given command<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> ufw status verbose<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"774\" height=\"202\" class=\"wp-image-24992\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-5.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-5.png 774w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-5-300x78.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-5-768x200.png 768w\" sizes=\"auto, (max-width: 774px) 100vw, 774px\" \/><\/p>\n<p>From the above command, you will be able to see the connection, login, incoming and outgoing, and profile status of <strong>Firewall<\/strong>.<\/p>\n<h2><a id=\"post-24943-_5i3mlz57gxtw\"><\/a>How to Use Firewall on Kali Linux<\/h2>\n<p>There are different uses of <strong>Firewall <\/strong>on a system, some of the widely used one are to:<\/p>\n<ul>\n<li><a href=\"#post-24943-_izlgil7siwh6\"><strong>Allow and Deny Traffic <\/strong><\/a><\/li>\n<li><a href=\"#post-24943-_wnawy42x7ulc\"><strong>Create Custom Rules for Different Network Interfaces and IP Addresses<\/strong><\/a><\/li>\n<\/ul>\n<h3><a id=\"post-24943-_izlgil7siwh6\"><\/a><strong>How to Allow and Deny Traffic to Kali Linux System<\/strong><\/h3>\n<p>With <strong>Firewall <\/strong>installed on Kali Linux, you can allow and deny traffic to your system. It can be done in different ways, such as:<\/p>\n<ul>\n<li><a href=\"#post-24943-_c94jgeomv6xp\"><strong>Allow and Deny Traffic By Port Number<\/strong><\/a><\/li>\n<li><a href=\"#post-24943-_mvekju2v132y\"><strong>Allow and Deny Traffic By Service Name<\/strong><\/a><\/li>\n<li><a href=\"#post-24943-_ho59sjrc0tx5\"><strong>Allow and Deny Traffic By IP Address<\/strong><\/a><\/li>\n<\/ul>\n<h3><a id=\"post-24943-_c94jgeomv6xp\"><\/a><strong>How to Allow and Deny Traffic to Kali Linux By Port Number<\/strong><\/h3>\n<p>If you want to allow connection to Kali Linux system by port number, you can use the following syntax:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> ufw allow port_no<\/div><\/div>\n<p>Replace <strong>port_no <\/strong>with the port you choose for allowing the incoming connection to Kali Linux.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"772\" height=\"157\" class=\"wp-image-24995\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-6.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-6.png 772w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-6-300x61.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-6-768x156.png 768w\" sizes=\"auto, (max-width: 772px) 100vw, 772px\" \/><\/p>\n<p>To deny a connection from a specific port number on Kali Linux with <strong>Firewall<\/strong>, simply use the following syntax:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> ufw deny port_no<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"774\" height=\"164\" class=\"wp-image-25008\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-7.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-7.png 774w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-7-300x64.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-7-768x163.png 768w\" sizes=\"auto, (max-width: 774px) 100vw, 774px\" \/><\/p>\n<p>Besides assigning only the port number, it is recommended to use TCP or UDP protocol after the port number. The reason is different applications use different protocols for the same port number. So, if you specify the port number with the protocol, it will tell the <strong>Firewall <\/strong>to allow or deny connection for that port operating on a specific protocol.<\/p>\n<p>For example, the port 80 is commonly used for<strong> HTTP (TCP)<\/strong> and <strong>QUIC (UDP)<\/strong>, but if you want to allow only the port with HTTP (TCP) protocol, you can use <strong>80\/tcp <\/strong>instead of <strong>80<\/strong>:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> ufw deny <span class=\"nu0\">80<\/span><span class=\"sy0\">\/<\/span>tcp<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"775\" height=\"165\" class=\"wp-image-25013\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-8.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-8.png 775w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-8-300x64.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-8-768x164.png 768w\" sizes=\"auto, (max-width: 775px) 100vw, 775px\" \/><\/p>\n<p>To see the <strong>Firewall<\/strong> rule set by you on your system, you can use the following command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> ufw status numbered<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"772\" height=\"330\" class=\"wp-image-25023\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-9.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-9.png 772w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-9-300x128.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-9-768x328.png 768w\" sizes=\"auto, (max-width: 772px) 100vw, 772px\" \/><\/p>\n<p>Further, you can also allow or deny traffic for a certain range of ports on your Kali Linux system, it can be done by using the following syntax:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> ufw allow <span class=\"nu0\">40<\/span>:<span class=\"nu0\">80<\/span><span class=\"sy0\">\/<\/span>tcp<br \/>\n<br \/>\n<span class=\"kw2\">sudo<\/span> ufw deny <span class=\"nu0\">85<\/span>:<span class=\"nu0\">90<\/span><span class=\"sy0\">\/<\/span>tcp<\/div><\/div>\n<h3><a id=\"post-24943-_mvekju2v132y\"><\/a><strong>How to Allow and Deny Traffic By Service Name on Kali Linux<\/strong><\/h3>\n<p>Besides using the port number, you can also allow and deny traffic on the Kali Linux system by the service name. For example, to allow the traffic for SSH service on Kali Linux, you can use the below-given command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> ufw allow <span class=\"kw2\">ssh<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"766\" height=\"166\" class=\"wp-image-25029\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-10.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-10.png 766w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-10-300x65.png 300w\" sizes=\"auto, (max-width: 766px) 100vw, 766px\" \/><\/p>\n<p>For denying a specific service on Kali Linux using the service name, such as SSH, use the following command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> ufw deny <span class=\"kw2\">ssh<\/span><\/div><\/div>\n<h3><a id=\"post-24943-_ho59sjrc0tx5\"><\/a><strong>How to Allow and Deny Traffic By IP Address on Kali Linux<\/strong><\/h3>\n<p>If you want to allow traffic on Kali Linux system from a certain IP address, you can use the following syntax:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> ufw allow from IP_address<\/div><\/div>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"773\" height=\"149\" class=\"wp-image-25033\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-11.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-11.png 773w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-11-300x58.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-11-768x148.png 768w\" sizes=\"auto, (max-width: 773px) 100vw, 773px\" \/><\/strong><\/p>\n<p>To deny the traffic of a certain IP address on a system, use the below-given command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> ufw deny from IP_address<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"774\" height=\"145\" class=\"wp-image-25046\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-12.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-12.png 774w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-12-300x56.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-12-768x144.png 768w\" sizes=\"auto, (max-width: 774px) 100vw, 774px\" \/><\/p>\n<h3><a id=\"post-24943-_wnawy42x7ulc\"><\/a><strong>How to Create Custom Rules for Different Network Interfaces and IP Addresses on Kali Linux<\/strong><\/h3>\n<p>You can use <strong>Firewall<\/strong> on Kali Linux to create custom rules for different network interfaces and IP Addresses. For example, if you want to allow incoming SSH connection on interface<strong> eth0 <\/strong>with the default SSH port number 22, you can use the following command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> ufw allow <span class=\"kw1\">in<\/span> on eth0 to any port <span class=\"nu0\">22<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"773\" height=\"169\" class=\"wp-image-25053\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-13.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-13.png 773w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-13-300x66.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-13-768x168.png 768w\" sizes=\"auto, (max-width: 773px) 100vw, 773px\" \/><\/p>\n<p>To block the connection, use <strong>deny<\/strong> instead of<strong> allow<\/strong> in the above command.<\/p>\n<p>If you want to create a custom <strong>Firewall<\/strong> rule for a specific IP address, such as allowing the IP address to use the default port 22 for SSH, use the following syntax:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> ufw allow from IP_address to any port <span class=\"nu0\">22<\/span> proto tcp<\/div><\/div>\n<p><strong>Note:<\/strong> Ensure replacing the <strong>IP_address<\/strong>, <strong>port number<\/strong> and <strong>tcp<\/strong> protocol according to your choice.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"773\" height=\"166\" class=\"wp-image-25059\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-14.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-14.png 773w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-14-300x64.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-14-768x165.png 768w\" sizes=\"auto, (max-width: 773px) 100vw, 773px\" \/><\/p>\n<h2><a id=\"post-24943-_z6k2ylpqv9sv\"><\/a>How to Delete a Specific Firewall Rule on Kali Linux<\/h2>\n<p>If you have set up multiple<strong> Firewall<\/strong> rules and want to delete some of them, you can do it quite easily. For that purpose, first check for <strong>Firewall<\/strong> rules numbers using the following command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> ufw status numbered<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"773\" height=\"439\" class=\"wp-image-25070\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-15.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-15.png 773w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-15-300x170.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-15-768x436.png 768w\" sizes=\"auto, (max-width: 773px) 100vw, 773px\" \/><\/p>\n<p>Then use the following syntax to delete a specific<strong> Firewall<\/strong> rule from the list:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> ufw delete rule_no<\/div><\/div>\n<p>Here, I am deleting <strong>Firewall<\/strong> rule place at position 9. When you are going to delete the rule, it will ask for approval, do it by entering y in the option box:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"775\" height=\"127\" class=\"wp-image-25080\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-16.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-16.png 775w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-16-300x49.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-16-768x126.png 768w\" sizes=\"auto, (max-width: 775px) 100vw, 775px\" \/><\/p>\n<p>Once done, it will delete the specific <strong>Firewall<\/strong> rule from your system:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"785\" height=\"144\" class=\"wp-image-25091\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-17.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-17.png 785w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-17-300x55.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-17-768x141.png 768w\" sizes=\"auto, (max-width: 785px) 100vw, 785px\" \/><\/p>\n<h2><a id=\"post-24943-_bt2t1wyr7rh4\"><\/a>How to Reset Firewall Settings and Rules on Kali Linux<\/h2>\n<p>If you want to delete all the <strong>Firewall<\/strong> settings and rules you set on Kali Linux, you can use the below-given command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> ufw reset<\/div><\/div>\n<p>It will ask for approval, simply type <strong>y<\/strong> in the option box:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"767\" height=\"93\" class=\"wp-image-25096\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-18.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-18.png 767w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-18-300x36.png 300w\" sizes=\"auto, (max-width: 767px) 100vw, 767px\" \/><\/p>\n<p>This will delete all the <strong>Firewall<\/strong> settings and rules, keeping the <strong>Firewall<\/strong> to the default settings:<\/p>\n<p><strong>Note:<\/strong> After resetting the <strong>Firewall<\/strong>, you have to enable <strong>Firewall <\/strong>again on your system and then set rules according to your choice later on.<\/p>\n<h2><a id=\"post-24943-_za8syv1ous6c\"><\/a>Bonus Method: How to Install Firewall GUI (GUFW) on Kali Linux<\/h2>\n<p>The developers have also created a <strong>GUI interface <\/strong>of <strong>Firewall <\/strong>called <strong>GUFW<\/strong> to ease users in setting up the <strong>Firewall<\/strong> directly from the desktop. The <strong>GUFW <\/strong>package can be installed directly from the apt repository using the below-given command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> apt <span class=\"kw2\">install<\/span> gufw <span class=\"re5\">-y<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"770\" height=\"319\" class=\"wp-image-25107\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-20.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-20.png 770w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-20-300x124.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-20-768x318.png 768w\" sizes=\"auto, (max-width: 770px) 100vw, 770px\" \/><\/p>\n<p>After installing the <strong>Firewall <\/strong>GUI, you can open it from the terminal using the <strong>sudo<\/strong> <strong>gufw<\/strong> command or from the <strong>Application launcher <\/strong>by searching the app.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"802\" height=\"746\" class=\"wp-image-25119\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-21.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-21.png 802w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-21-300x279.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-21-768x714.png 768w\" sizes=\"auto, (max-width: 802px) 100vw, 802px\" \/><\/p>\n<p>This will open the <strong>Firewall GUI <\/strong>application on your Kali Linux system.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"907\" height=\"623\" class=\"wp-image-25128\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-22.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-22.png 907w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-22-300x206.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-24943-22-768x528.png 768w\" sizes=\"auto, (max-width: 907px) 100vw, 907px\" \/><\/p>\n<p>You can then enable the<strong> Firewall <\/strong>from the GUI using the toggle button and set incoming, outgoing connections as well as separately set rules for your connection.<\/p>\n<h2><a id=\"post-24943-_luvhc8iaed28\"><\/a>How to Remove UFW and GUFW from Kali Linux<\/h2>\n<p>If you want to remove <strong>UFW <\/strong>and<strong> GUFW<\/strong> from your Kali Linux system in case you no longer need them, simply use the below-given command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> apt remove ufw gufw <span class=\"re5\">-y<\/span><\/div><\/div>\n<h2><a id=\"post-24943-_uyckm5a1g75u\"><\/a>Conclusion<\/h2>\n<p>Setting up a <strong>Firewall<\/strong> is an important task since it will help manage your privacy by allowing or denying connections to your system. You can install and set up <strong>Firewall <\/strong>on Kali Linux by first installing the <strong>Firewall<\/strong> package<strong> (UFW)<\/strong> on your system from the apt command. Then, enable the <strong>Firewall<\/strong> service and use the <strong>ufw<\/strong> commands to allow or deny connections to your system.<\/p>\n<p>You can manage connections with <strong>Firewall <\/strong>using the port number, service name and IP address of the network. Besides that, you can also create custom rules for network interfaces and IP addresses with<strong> Firewall<\/strong>. Further, you can delete or reset <strong>Firewall<\/strong> rules or set them to the default in case you no longer have them. All these methods are already provided in the above sections of this guide. Follow them and improve your Kali Linux security from the cyber threat.<\/p>","protected":false},"excerpt":{"rendered":"<p>You can install Firewall on Kali Linux system directly from the apt repository using the apt install ufw command.<\/p>","protected":false},"author":116,"featured_media":25299,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1054],"tags":[],"class_list":["post-24943","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-kali-linux"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/24943","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\/116"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=24943"}],"version-history":[{"count":0,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/24943\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/25299"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=24943"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=24943"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=24943"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}