Firewall: Difference between revisions

From Leo's Notes
This page was last edited on 9 October 2019, at 20:04.
Created page with "== Linux == Linux typically uses IPTables for its firewall. On most modern Linux distributions, IPTables is controlled through another program or manager such as firewalld, or..."
 
Line 3: Line 3:


=== Opening a Port ===
=== Opening a Port ===
To allow a specific port access to your machine, you will (most likely) need to make IPTables ACCEPT traffic meeting the port criteria on the INPUT chain.
To allow a specific port access to your machine, you will (most likely) need to make IPTables {{code|ACCEPT}} traffic meeting the port criteria on the {{code|INPUT}} chain.


Simple IPTables:
Simple IPTables:

Revision as of 20:04, 9 October 2019

Linux

Linux typically uses IPTables for its firewall. On most modern Linux distributions, IPTables is controlled through another program or manager such as firewalld, or CSF.

Opening a Port

To allow a specific port access to your machine, you will (most likely) need to make IPTables ACCEPT traffic meeting the port criteria on the INPUT chain.

Simple IPTables:

# iptables -A INPUT -p tcp --dport 80 -j ACCEPT

If using Red Hat's firewalld:

# firewall-cmd --permanent --add-port=80/tcp
# firewall-cmd --permanent --add-service=x
## Reload firewall rules
# firewall-cmd --reload

If using CSF:

# vi /etc/csf/csf.conf
## Edit 'TCP_IN' to include any TCP traffic IN, or TCP_OUT for traffic out.
## Reload CSF
# csf -r