HostOnNet.com Forum Index HostOnNet.com
Private Label Reseller Plan
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Advanced Policy Firewall APF Installation

 
Post new topic   Reply to topic    HostOnNet.com Forum Index -> Linux Server
View previous topic :: View next topic  
Author Message
admin
Site Admin


Joined: 23 Jan 2003
Posts: 256
Location: India

PostPosted: Thu Aug 04, 2005 7:43 am    Post subject: Advanced Policy Firewall APF Installation Reply with quote

Here we are going to install an awesome firewall onto your server - Advanced Policy Firewall

APF

APF is a policy based iptables firewall system designed for ease of use and configuration. It employs a subset of features to satisfy the veteran Linux user and the novice alike. Packaged in tar.gz format and RPM formats, make APF ideal for deployment in many server environments based on Linux.

Site: http://www.rfxnetworks.com/apf.php

Summary of features:

- simple & well commented configuration files
- layered firewall with independent ingress and egress filtering system
- uid based egress filtering via simple configuration variables
- global tcp/udp ports & icmp types configurtion
- configurable policies for each ip on the system with convenience vars
- prerouting rules for optimal network responce; TOS (type of service)
- icmp based rate limiting to prevent common icmp 'dos' abuses
- antidos subsystem to stop attacks before they become a significant threat
- dshield.org block list support to ban networks exhibiting suspicious activity
- advanced set of sysctl parameters for tcp/ip stack hardening
- advanced set of filter rules to remove undesired traffic
- advanced use of kernel features such as abort_on_overflow & tcp syncookies
- easy to use firewall managment script
- trust based rule files (allow/deny); with advanced syntax support
- 3rd party addon projects that compliment APF features
- and much more...

Installation

1. Make /usr/src the current working directory.

Quote:
cd /usr/src


2. Obtain the most curent verison of APF.

Quote:

wget http://rfxnetworks.com/downloads/apf-current.tar.gz


3. Expand the APF tar.gz file.

Quote:

tar -xvzf apf-current.tar.gz


4. Remove the tar.gz file.

Quote:

rm -f apf-current.tar.gz


5. Change to APF directory

Quote:

cd apf*


6. Run the APF install.

Quote:

sh ./install.sh


7. Make /etc/apf the current working directory.

Quote:

cd /etc/apf


8. Edit the conf.apf file as desired.

Quote:

vi conf.apf


In order for this firewall to work properly you have to edit/add/delete ports. These ports will allow services such as mail, ftp, and ssh to come in and out of the server. If you have changed any ports, please modify them below and add/remove as needed.

###############
# Common TCP Ports
TCP_CPORTS="20,21,22,25,53,80,110,143,443,2082,2083,2086,2087,2095"
please note that ports 2082 to port 2095 is mostly used by cpanel, and port 19638 is only use in
ensim.
# Common UDP Ports
UDP_CPORTS="53"
################

After you have finished editing the ports save the file and test APF.
Save and Exit vi editor with :wq command

Start APF by typing.
./apf -start
or
service apf start

If APF is functioning properly and you are not locked out edit the conf.apf again
vi conf.apf

Set the DEVM parameter to 0
DEVM="0"

Once done Exit and save the file.

:wq


Restart APF
service apf restart


Enabling Pings

Load the icmp rules file
pico -w /etc/apf/icmp.rules
You will see near the bottom of the page:
# Uncomment to enable pings
#$IPT -t filter -A INPUT -p icmp --icmp-type 8 -j ACCEPT
Remove the # from the beginning of this line so that it looks like:
# Uncomment to enable pings
$IPT -t filter -A INPUT -p icmp --icmp-type 8 -j ACCEPT
Restart APF and pings are enabled
service apf restart


Enabling connections for server monitoring.
Some service providers that offer monitoring need access to your server, and access without setting off alarms, firewalls etc. is a good thing. Just becareful which IP(s) you put in here.

To allow connections from xx.xx.xx.xx/24
pico -w /etc/apf/allow_hosts.rules
At the very end of the file add this line
xx.xx.xx.xx/24
Of course replace the xx.xx.xx.xx with the IP address provided to you.
_________________
HostOnNet.com - Reseller Hosting
Free Ads Forum, Promote your site
NetFreeHost.com - Free Web Hosting, phpBB Hosting
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    HostOnNet.com Forum Index -> Linux Server All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group. Hosted by phpBB.BizHat.com


For Support - http://forums.BizHat.com

Free Web Hosting | Free Forum Hosting | FlashWebHost.com | Image Hosting | Photo Gallery | FreeMarriage.com

Powered by PhpBBweb.com, setup your forum now!