Firewall: Difference between revisions
From Leo's Notes
This page was last edited on 14 June 2020, at 23:34.
m Added cateogry |
|||
| Line 25: | Line 25: | ||
# csf -r | # csf -r | ||
}} | }} | ||
{{Navbox Linux}}[[Category:Linux]] | |||
[[Category:Networking]] | |||
Revision as of 23:34, 14 June 2020
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