photo lineviral_1.png

Config Server Firewall – Csf Cheat Sheet

Config Server Firewall (CSF) is a costless as well as advanced firewall for near Linux distributions as well as Linux based VPS. In add-on to the basic functionality of a firewall – filtering packets – CSF includes other safety features, such every bit login/intrusion/flood detections. CSF includes UI integration for cPanel, DirectAdmin as well as Webmin, merely this tutorial alone covers the ascendancy describe of piece of work usage. CSF is able to recognize many attacks, such every bit port scans, SYN floods, as well as login creature forcefulness attacks on many services. It is configured to temporarily block clients who are detected to move attacking the cloud server.  is a costless as well as advanced firewall for near Linux distributions as well as Linux based VPS Config Server Firewall – CSF cheat sheet


The amount listing of supported operating systems as well as features tin move works life on ConfigServer’s website.


Following is a CSF cheat canvas amongst I created from it’s assistance menu. Out of the commands, I occupation to a greater extent than or less to a greater extent than extensively as well as they are listed on transcend of this table.





























































































































































































































CommandExtended CommandDescriptionExample
csf -h–helpShow this messageroot@server[ ]#csf -h
csf -r–restartRestart firewall rulesroot@server[ ]#csf -r
csf -d [IP.add.re.ss] [comment]–deny ipDeny an IP as well as add together to /etc/csf.denyroot@server[ ]#csf -d 11.22.33.44 Blocked This Guy
csf -dr [IP.add.re.ss]–denyrm ipUnblock an IP as well as take away from /etc/csf.denyroot@server[ ]#csf -dr 22.33.44.55
csf -df–denyfRemove as well as unblock all entries inwards /etc/csf.denyroot@server[ ]#csf -df
csf -tr [IP.add.re.ss]–temprm ipRemove an IP from the temporary IP ban or allow list.root@server[ ]#csf -tr 55.66.77.88
csf -td–tempdeny ip ttl [-p port] [-d direction]Add an IP to the temp IP ban list. ttl is how long to blocks for (default:seconds, tin occupation 1 suffix of h/m/d).root@server[ ]#csf -t
csf -a [IP.add.re.ss] [comment]–add ipAllow an IP as well as add together to /etc/csf.allowroot@server[ ]#csf -a 33.44.55.66 Home IP Address
csf -tf–tempfFlush all IPs from the temporary IP entriesroot@server[ ]#csf -tf
csf -g [IP.add.re.ss]–grep ipSearch the iptables rules for an IP agree (incl. CIDR)root@server[ ]#csf -g 44.55.66.77
csf -v–versionShow csf versionroot@server[ ]#csf -v
csf -u–updateCheck for updates to csf as well as upgrade if availableroot@server[ ]#csf -u
csf -l–statusList/Show iptables configuration
csf -l6–status6List/Show ip6tables configuration
csf -s–startStart firewall rules
csf -f–stopFlush/Stop firewall rules (Note: lfd may restart csf)
csf -q–startqQuick restart (csf restarted yesteryear lfd)
csf -sf–startfForce CLI restart regardless of LFDSTART setting
csf -ar–addrm ipRemove an IP from /etc/csf.allow as well as delete rule
csf -t–tempDisplays the electrical flow listing of temp IP entries as well as their TTLOptional port. Optional management of block tin move 1 of: in, out or inout (default:in)
csf -ta–tempallow ip, ttl [-p port] [-d direction]Add an IP to the temp IP allow listing (default:inout)
csf -cp–cpingPING all members inwards an lfd Cluster
csf -cd–cdeny ipDeny an IP inwards a Cluster as well as add together to /etc/csf.deny
csf -ca–callow ipAllow an IP inwards a Cluster as well as add together to /etc/csf.allow
csf -cr–crm ipUnblock an IP inwards a Cluster as well as take away from /etc/csf.deny
csf -cc–cconfig [name] [value]Change configuration selection [name] to [value] inwards a Cluster
csf -cf–cfile [file]Send [file] inwards a Cluster to /etc/csf/
csf -crs–crestartCluster restart csf as well as lfd
csf -w–watch ipLog SYN packets for an IP across iptables chains
csf -m–mail [addr}Display Server Check inwards HTML or electronic mail to [addr] if present
csf -lr–logrunInitiate Log Scanner study via lfd
csf -c–checkCheck for updates to csf merely produce non upgrade
csf -ufForce an update of csf
csf -x–disableDisable csf as well as lfd
csf -e–enableEnable csf as well as lfd if previously disabled

Whitelisting IP Address / Subnet


In companionship to forestall specific IP from beingness blocked, fifty-fifty for a temporary deny, you lot ask to listing their IP address inwards the csf.allow file. For example:


###############################################################################
# Copyright 2006-2016, Way to the Web Limited
# URL: http://www.configserver.com
# Email: sales@waytotheweb.com
###############################################################################
# The next IP addresses volition move allowed through iptables.
# One IP address per line.
# CIDR addressing allowed amongst a quaded IP (e.g. 192.168.254.0/24).
# Only listing IP addresses, non domain names (they volition move ignored)
#
# Advanced port+ip filtering allowed amongst the next format
# tcp/udp|in/out|s/d=port|s/d=ip
# See readme.txt for to a greater extent than information
#
# Note: IP addressess listed inwards this file volition NOT move ignored yesteryear lfd, as well as hence they
# tin notwithstanding move blocked. If you lot produce non desire lfd to block an IP address you lot must
# add together it to csf.ignore
77.88.99.0/21 # Manually allowed - Monday April 03 21:24:45 2016
66.55.44.0/20 # Manually allowed - Monday Jun xvi 21:24:45 2014
44.33.22.11/32 # Home IP
11.22.33.44/24 # Local ISP

Save file as well as restart csf as well as lfd.


Buat lebih berguna, kongsi:
close