• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here:Home » Install, Configure Advanced Policy Firewall (AFP) On Ubuntu 16.04

By Abhishek Ghosh June 1, 2017 11:44 pm Updated on June 1, 2017

Install, Configure Advanced Policy Firewall (AFP) On Ubuntu 16.04

Advertisement

If you are a new user, you should not follow this guide for production sever but follow our basic server setup guide and IPTables guide to configure your firewall. New users can follow this guide with test/development servers. Advanced Policy Firewall is an iptables based firewall. Here is how to install, configure Advanced Policy Firewall (AFP) on Ubuntu 16.04.  It is essentially an interface to IPTables to configure a powerful firewall to secure servers. But it needs work experience with networking and resource monitoring. It can slightly delay the actions or suck resource more than written on official website. It is suggested more for dedicated servers, with at least 2 LAN cards and a modern server (read minimum 8GB physical RAM).

Install, Configure Advanced Policy Firewall (AFP) On Ubuntu 16-04

 

Install, Configure Advanced Policy Firewall (AFP) On Ubuntu 16.04

 

Here is official website with additional information :

Vim
1
https://www.rfxn.com/projects/advanced-policy-firewall/

First update server :

Advertisement

---

Vim
1
apt update

Then download package and extract :

Vim
1
2
3
4
5
wget http://www.rfxn.com/downloads/apf-current.tar.gz
tar -xzvf apf-current.tar.gz
cd apf-*
chmod +x install.sh
./install.sh

This will give this kind of output :

Vim
1
2
3
4
5
6
7
8
9
Installing APF x.y-z: Completed.
 
Installation Details:
  Install path:         /etc/apf/
  Config path:          /etc/apf/conf.apf
  Executable path:      /usr/local/sbin/apf
 
Other Details:
....

There is a configuration file at /etc/apf/conf.apf, which you should take a back and open :

Vim
1
nano /etc/apf/conf.apf

to have settings like this :

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
INSTALL_PATH="/etc/apf"
DEVEL_MODE="1"
SET_MONOKERN="0"
 
IFACE_IN="eth0"
IFACE_OUT="eth0"
IFACE_TRUSTED="eth0"
SET_VERBOSE="1"
 
IG_TCP_CPORTS="20,21,22,25,26,37,43,53,80,110,113,143,443,465,873,993,995,2077,2078,2082,2083,2086,2087,2095,2096,3306,6666"
IG_UDP_CPORTS="53,6277"
IG_ICMP_TYPES="3,5,11,30"
EG_TCP_CPORTS="21,25,37,53,80,110,113,#123,443,43,873,953,2089,2703"
EG_UDP_CPORTS="20,21,53,873,953,6277"
 
TCP_STOP="DROP"
UDP_STOP="DROP"
ALL_STOP="DROP"
BLK_PRVNET="0"

You can see the interface is named as eth0.

Start firewall :

Vim
1
apf -s

To stop firewall :

Vim
1
apf -f

Restart firewall :

Vim
1
apf -r

Status of firewall :

Vim
1
apf -st

There are are two files to list allow, deny :

Vim
1
2
/etc/apf/allow_hosts.rules
/etc/apf/deny_hosts.rules

Run this to add to allow list :

Vim
1
apf -a some.bad.i.p

Run this to add to deny list :

Vim
1
apf -d some.bad.i.p

In order to use on production server, you must read the official documents and other resources. We have only given a sane example to get started.

Tagged With advanced firewall ubuntu 2018
Facebook Twitter Pinterest

Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to Install, Configure Advanced Policy Firewall (AFP) On Ubuntu 16.04

  • Nginx WordPress Installation Guide (All Steps)

    This is a Full Nginx WordPress Installation Guide With All the Steps, Including Some Optimization and Setup Which is Compatible With WordPress DOT ORG Example Settings For Nginx.

  • WordPress & PHP : Different AdSense Units on Mobile Devices

    Here is How To Serve Different AdSense Units on Mobile Devices on WordPress With PHP. WordPress Has Function Which Can Be Used In Free Way.

  • Changing Data With cURL for OpenStack Swift (HP Cloud CDN)

    Changing Data With cURL For Object is Quite Easy in OpenStack Swift. Here Are Examples With HP Cloud CDN To Make it Clear. Official Examples Are Bad.

  • How Can a Firewall can Protect Your Company?

    A firewall is your first line of defence against online threats, and it’s an important feature of any cybersecurity strategy. As a business owner, you need to be aware of the damage that cyberattacks can have against your business and ensure the right measures are in place to stop them. Firewalls are a useful tool […]

performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

Get new posts by email:

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (24.3K Followers)
  • Twitter (5.8k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • Hybrid Multi-Cloud Environments Are Becoming UbiquitousJuly 12, 2023
  • Data Protection on the InternetJuly 12, 2023
  • Basics of BJT TransistorJuly 11, 2023
  • What is Confidential Computing?July 11, 2023
  • How a MOSFET WorksJuly 10, 2023
PC users can consult Corrine Chorney for Security.

Want to know more about us?

Read Notability and Mentions & Our Setup.

Copyright © 2023 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy