<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://kangtain.com/wiki/index.php?action=history&amp;feed=atom&amp;title=UFW%3AReordering_UFW_Firewall</id>
	<title>UFW:Reordering UFW Firewall - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://kangtain.com/wiki/index.php?action=history&amp;feed=atom&amp;title=UFW%3AReordering_UFW_Firewall"/>
	<link rel="alternate" type="text/html" href="https://kangtain.com/wiki/index.php?title=UFW:Reordering_UFW_Firewall&amp;action=history"/>
	<updated>2026-05-05T11:59:03Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://kangtain.com/wiki/index.php?title=UFW:Reordering_UFW_Firewall&amp;diff=7311&amp;oldid=prev</id>
		<title>Kangtain at 15:15, 23 November 2022</title>
		<link rel="alternate" type="text/html" href="https://kangtain.com/wiki/index.php?title=UFW:Reordering_UFW_Firewall&amp;diff=7311&amp;oldid=prev"/>
		<updated>2022-11-23T15:15:17Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 22:15, 23 November 2022&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l33&quot;&gt;Line 33:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 33:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Source==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Source==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*[https://serverfault.com/questions/484475/ufw-firewall-rules-ordering serverfault.com]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*[https://serverfault.com/questions/484475/ufw-firewall-rules-ordering serverfault.com]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Server]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Linux]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Tutorial]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Security]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Firewall]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Kangtain</name></author>
	</entry>
	<entry>
		<id>https://kangtain.com/wiki/index.php?title=UFW:Reordering_UFW_Firewall&amp;diff=7310&amp;oldid=prev</id>
		<title>Kangtain: Created page with &quot;If you&#039;re interested in reordering your UFW rules, this is one way to do it.  &lt;syntaxhighlight lang=&quot;bash&quot;&gt; sudo ufw status numbered &lt;/syntaxhighlight&gt;        To                         Action      From       --                         ------      ----  [ 1] 22                         ALLOW IN    Anywhere  [ 2] 80                         ALLOW IN    Anywhere  [ 3] 443                        ALLOW IN    Anywhere  [ 4] 22 (v6)                    ALLOW IN    Anywhere (v6)...&quot;</title>
		<link rel="alternate" type="text/html" href="https://kangtain.com/wiki/index.php?title=UFW:Reordering_UFW_Firewall&amp;diff=7310&amp;oldid=prev"/>
		<updated>2022-11-23T15:14:35Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;If you&amp;#039;re interested in reordering your UFW rules, this is one way to do it.  &amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt; sudo ufw status numbered &amp;lt;/syntaxhighlight&amp;gt;        To                         Action      From       --                         ------      ----  [ 1] 22                         ALLOW IN    Anywhere  [ 2] 80                         ALLOW IN    Anywhere  [ 3] 443                        ALLOW IN    Anywhere  [ 4] 22 (v6)                    ALLOW IN    Anywhere (v6)...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;If you&amp;#039;re interested in reordering your UFW rules, this is one way to do it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo ufw status numbered&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
      To                         Action      From&lt;br /&gt;
      --                         ------      ----&lt;br /&gt;
 [ 1] 22                         ALLOW IN    Anywhere&lt;br /&gt;
 [ 2] 80                         ALLOW IN    Anywhere&lt;br /&gt;
 [ 3] 443                        ALLOW IN    Anywhere&lt;br /&gt;
 [ 4] 22 (v6)                    ALLOW IN    Anywhere (v6)&lt;br /&gt;
 [ 5] 80 (v6)                    ALLOW IN    Anywhere (v6)&lt;br /&gt;
 [ 6] 443 (v6)                   ALLOW IN    Anywhere (v6)&lt;br /&gt;
 [ 7] Anywhere                   DENY IN     [ip-to-block]&lt;br /&gt;
&lt;br /&gt;
Say you accidentally added a rule to the end, but you wanted up top.&lt;br /&gt;
&lt;br /&gt;
First you will have remove it from the bottom (7) and add it back.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo ufw delete 7&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note, be careful of removing multiple rules one after another, their position can change!&lt;br /&gt;
&lt;br /&gt;
Add back your rule to the very top (1):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo ufw insert 1 deny from [ip-to-block] to any&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
*[https://serverfault.com/questions/484475/ufw-firewall-rules-ordering serverfault.com]&lt;/div&gt;</summary>
		<author><name>Kangtain</name></author>
	</entry>
</feed>