Difference between revisions of "Firewalls"

1,274 bytes added ,  3 years ago
Added iptables
imported>Dalto
(Revamp page and content)
imported>Dalto
(Added iptables)
Line 107: Line 107:
It will now be available in the menu as '''Firewall Configuration''' or by running {{ic|gufw}} directly.
It will now be available in the menu as '''Firewall Configuration''' or by running {{ic|gufw}} directly.
<div style="clear: both"></div>
<div style="clear: both"></div>
=iptables=
iptables is included as part of the Linux kernel.  iptables is significantly more complicated than using a tool like UFW.  As a result, a full tutorial on iptables is beyond the scope of this wiki.  Using iptables on Manjaro should be the same for every distribution of Linux so there is plenty of available documentation.  Some of this is linked [[Firewalls#See_Also|below]].  Here are some basics to get you started.
To enable loading rules on startup you can use the command:
sudo systemctl enable iptables.service
This will load the rules from the file {{ic|/etc/iptables/iptables.rules}}.
To display the currently loaded rules:
sudo iptables -L
To save the current rules to a file
sudo sh -c "iptables-save > /etc/iptables/iptables.rules"
To load the rules from a file
  sudo sh -c "iptables-restore > /etc/iptables/iptables.rules"
To allow ssh connections
sudo iptables -A INPUT -p tcp --dport 22 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
sudo iptables -A OUTPUT -p tcp --sport 22 -m conntrack --ctstate ESTABLISHED -j ACCEPT




Line 113: Line 142:
* The [https://help.ubuntu.com/community/UFW UFW website]
* The [https://help.ubuntu.com/community/UFW UFW website]
* The [http://gufw.org/ GUFW website]
* The [http://gufw.org/ GUFW website]
* The [https://linux.die.net/man/8/iptables iptables man page]
* The Arch Wiki on [https://wiki.archlinux.org/index.php/iptables iptables]
* The Debian Wiki on [https://wiki.debian.org/iptables iptables]




[[Category:Contents Page]]
[[Category:Contents Page]]
Anonymous user