• 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 186 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 (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

  • What is Voice User Interface (VUI) January 31, 2023
  • Proxy Server: Design Pattern in Programming January 30, 2023
  • Cyberpunk Aesthetics: What’s in it Special January 27, 2023
  • How to Do Electrical Layout Plan for Adding Smart Switches January 26, 2023
  • What is a Data Mesh? January 25, 2023

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, February 1, 2023, https://thecustomizewindows.com/2017/06/install-configure-advanced-policy-firewall-afp-on-ubuntu-16-04/.

Source:The Customize Windows, JiMA.in

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

We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies.
Do not sell my personal information.
Cookie SettingsAccept
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
CookieDurationDescription
cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytics
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Others
Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
SAVE & ACCEPT