<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.alpinelinux.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Tpk</id>
	<title>Alpine Linux - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.alpinelinux.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Tpk"/>
	<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/wiki/Special:Contributions/Tpk"/>
	<updated>2026-04-30T00:12:32Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Uncomplicated_Firewall&amp;diff=19988</id>
		<title>Uncomplicated Firewall</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Uncomplicated_Firewall&amp;diff=19988"/>
		<updated>2021-07-30T21:06:22Z</updated>

		<summary type="html">&lt;p&gt;Tpk: /* Installation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;UFW stands for [https://launchpad.net/ufw Uncomplicated Firewall], and is a program for managing a netfilter firewall. It provides a command line interface and aims to be uncomplicated and easy to use.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
UFW can be found in the community repository.  Read [[Alpine_Linux_package_management#Repository_pinning]] to enable the community repository.&lt;br /&gt;
&lt;br /&gt;
Once the community repository has been enabled, UFW can be installed by issuing the following command:&lt;br /&gt;
{{cmd| apk add ip6tables ufw}}&lt;br /&gt;
&lt;br /&gt;
== Basic configuration ==&lt;br /&gt;
&lt;br /&gt;
The following is a simple configuration that will deny all incoming and outgoing data communication by default and allow incoming SSH, outgoing DNS and NTP traffic: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ufw default deny incoming&lt;br /&gt;
ufw default deny outgoing&lt;br /&gt;
ufw limit SSH         # open SSH port and protect against brute-force login attacks&lt;br /&gt;
ufw allow out 123/udp # allow outgoing NTP (Network Time Protocol)&lt;br /&gt;
&lt;br /&gt;
# The following instructions will allow apk to work:&lt;br /&gt;
ufw allow out DNS     # allow outgoing DNS&lt;br /&gt;
ufw allow out 80/tcp  # allow outgoing HTTP traffic&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following lines are only needed the first time you install the package:&lt;br /&gt;
{{cmd|ufw enable     # enable the firewall&lt;br /&gt;
rc-update add ufw    # add UFW init scripts}}&lt;br /&gt;
&lt;br /&gt;
Check the status of UFW:&lt;br /&gt;
{{cmd|ufw status}}&lt;br /&gt;
&lt;br /&gt;
== Diskless mode ==&lt;br /&gt;
&lt;br /&gt;
If you have installed Alpine Linux as [[Installation#Installation_Handbook|diskless]] then you need to use [[Alpine local backup|Alpine Local Backup (lbu)]] to save your UFW configuration.  UFW data is stored in &amp;lt;code&amp;gt;/usr/lib/ufw&amp;lt;/code&amp;gt;, therefore use the following commands to save the UFW configuration:&lt;br /&gt;
{{cmd|lbu add /usr/lib/ufw&lt;br /&gt;
lbu commit}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Networking]]&lt;br /&gt;
[[Category:Security]]&lt;/div&gt;</summary>
		<author><name>Tpk</name></author>
	</entry>
</feed>