<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
    <title>Vivek Shukla - Ufw</title>
    <subtitle>I am a Software Engineer from India. I am currently building Daestro. I work in Rust, Javascript and Python.</subtitle>
    <link rel="self" type="application/atom+xml" href="https://vshukla.com/tags/ufw/atom.xml"/>
    <link rel="alternate" type="text/html" href="https://vshukla.com/tags/ufw/"/>
    <generator uri="https://www.getzola.org/">Zola</generator>
    <updated>2025-09-09T00:00:00+00:00</updated>
    <id>https://vshukla.com/tags/ufw/atom.xml</id>
    <entry xml:lang="en">
        <title>UFW Cheat Sheet</title>
        <published>2025-09-09T00:00:00+00:00</published>
        <updated>2025-09-09T00:00:00+00:00</updated>
        <author>
          <name>Vivek Shukla</name>
        </author>
        <link rel="alternate" type="text/html" href="https://vshukla.com/snippets/ufw-cheat-sheet/"/>
        <id>https://vshukla.com/snippets/ufw-cheat-sheet/</id>
        <summary type="html">UFW stands Uncomplicated Firewall which provides simple interface over iptables to create host based firewall for IPv4 or IPv6</summary>
        <content type="html" xml:base="https://vshukla.com/snippets/ufw-cheat-sheet/">&lt;h2 id=&quot;check-status&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#check-status&quot; aria-label=&quot;Anchor link for: check-status&quot;&gt;🔗&lt;&#x2F;a&gt;Check status&lt;&#x2F;h2&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; ufw status&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-comment&quot;&gt;# or&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; ufw status verbose&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-comment&quot;&gt;# or&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; ufw status numbered&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;delete-value-based-on-number&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#delete-value-based-on-number&quot; aria-label=&quot;Anchor link for: delete-value-based-on-number&quot;&gt;🔗&lt;&#x2F;a&gt;Delete value based on number:&lt;&#x2F;h2&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; ufw delete&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-numeric&quot;&gt; 5&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;allow-port&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#allow-port&quot; aria-label=&quot;Anchor link for: allow-port&quot;&gt;🔗&lt;&#x2F;a&gt;Allow port&lt;&#x2F;h2&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; ufw allow 22&#x2F;tcp&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;deny-port&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#deny-port&quot; aria-label=&quot;Anchor link for: deny-port&quot;&gt;🔗&lt;&#x2F;a&gt;Deny port&lt;&#x2F;h2&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; ufw deny 80&#x2F;tcp&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;allow-from-ip-address-or-subnet&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#allow-from-ip-address-or-subnet&quot; aria-label=&quot;Anchor link for: allow-from-ip-address-or-subnet&quot;&gt;🔗&lt;&#x2F;a&gt;Allow from ip address or subnet&lt;&#x2F;h2&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; ufw allow from 10.22.96.0&#x2F;20&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;allow-from-ip-address-to-specific-port&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#allow-from-ip-address-to-specific-port&quot; aria-label=&quot;Anchor link for: allow-from-ip-address-to-specific-port&quot;&gt;🔗&lt;&#x2F;a&gt;Allow from ip address to specific port&lt;&#x2F;h2&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; ufw allow from 10.22.96.0&#x2F;20 proto tcp to any port&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-numeric&quot;&gt; 5432&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;disable-ufw&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#disable-ufw&quot; aria-label=&quot;Anchor link for: disable-ufw&quot;&gt;🔗&lt;&#x2F;a&gt;Disable ufw&lt;&#x2F;h2&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; ufw disable&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;block-an-ip-address-or-subnet&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#block-an-ip-address-or-subnet&quot; aria-label=&quot;Anchor link for: block-an-ip-address-or-subnet&quot;&gt;🔗&lt;&#x2F;a&gt;Block an ip address or subnet&lt;&#x2F;h2&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; ufw deny from&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-numeric&quot;&gt; 203.0.113.100&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;delete-a-rule&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#delete-a-rule&quot; aria-label=&quot;Anchor link for: delete-a-rule&quot;&gt;🔗&lt;&#x2F;a&gt;Delete a rule&lt;&#x2F;h2&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; ufw delete allow from&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-numeric&quot;&gt; 203.0.113.101&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;allow-incoming-connection-to-a-network-interface&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#allow-incoming-connection-to-a-network-interface&quot; aria-label=&quot;Anchor link for: allow-incoming-connection-to-a-network-interface&quot;&gt;🔗&lt;&#x2F;a&gt;Allow incoming connection to a network interface&lt;&#x2F;h2&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; ufw allow in on eth0 from&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant z-numeric&quot;&gt; 203.0.113.102&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;</content>
    </entry>
</feed>
