• 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

This Article Has Been Shared 615 Times!

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

  • What is Load Average in GNU/Linux?

    If We Run Top Command, We Can See a Parameter Load Average. What is Load Average in GNU/Linux? Why we need to know this load average for a server?

  • List Of Anti Malware For GNU/Linux Server

    Anti Malware Is Not Fully Correct Phrase For Linux But The Meaning Is Obvious. Here Is An Usable List Of Anti Malware For GNU/Linux Server.

  • grep, cut Examples with unix pipe

    There are certain commonly used commands for managing Linux Servers. Here are some useful grep, cut examples with unix pipelining for SSH.

  • How to Disassemble .deb Package (Ubuntu and Debian Linux)

    Here is How to Disassemble .deb Package for Linux Distro Like Ubuntu or Debian if Source Code is Not Supplied. Need May Be To Remove Spyware.

  • Change Nginx Server Name in Header on Ubuntu Server

    Declaring the Server Name is a Security Risk, You Can Change the Server Name From Nginx to Apache2 or What You Want. It is Easier on Ubuntu.

Additionally, 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 (22.1K 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

  • Big Data in Sports May 20, 2022
  • FaaS Versus PaaS Deployment: What You Should Know May 18, 2022
  • What Is A Digital Media Consultancy? May 17, 2022
  • How Artificial Intelligence (AI) Is Changing The Way We Play Bingo May 16, 2022
  • Why You Need A Big Data Consultant May 15, 2022

About This Article

Cite this article as: Abhishek Ghosh, "Install, Configure Advanced Policy Firewall (AFP) On Ubuntu 16.04," in The Customize Windows, June 1, 2017, May 20, 2022, https://thecustomizewindows.com/2017/06/install-configure-advanced-policy-firewall-afp-on-ubuntu-16-04/.

Source:The Customize Windows, JiMA.in

This website uses cookies. If you do not want to allow us to use cookies and/or non-personalized Ads, kindly clear browser cookies after closing this webpage.

Read Privacy Policy.

PC users can consult Corrine Chorney for Security.

Want to know more about us? Read Notability and Mentions & Our Setup.

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

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