---
title: "Basic APF Commands"
description: "In this Dedicated Hosting tutorial we will cover basic APF commands. The basic commands include Allowing IP's, Blocking IP's, and Unblocking IP's. After explaining what the command does, we will show..."
url: https://www.inmotionhosting.com/support/server/linux/basic-apf-commands/
date: 2016-05-09
modified: 2022-12-15
author: "InMotion Hosting Contributor"
categories: ["Linux"]
type: post
lang: en
---

# Basic APF Commands

In this [Dedicated Hosting](https://www.inmotionhosting.com/dedicated-servers) tutorial we will cover **basic APF commands**. The basic commands include *Allowing IP’s*, *Blocking IP’s*, and *Unblocking IP’s*. After explaining what the command does, we will show you an example of the APF Command.

**Note:** You will need [root access](https://www.inmotionhosting.com/support/amp/obtain-root-access/) in order to use these commands.

- [Allowing IP Addresses in APF](#allow-ip)
- [Blocking IP Addresses in APF](#block-ip)
- [Unblocking IP Addresses in APF](#unblock-ip)

## Allowing IP Addresses in APF

1. [Log into your server via SSH](https://www.inmotionhosting.com/support/server/ssh/connect-ssh/).
2. Here is a breakdown of the the APF command for **allowing** IP’s in APF. Be sure to replace this example IP address with the actual IP you want to allow:apf -a 12.34.56.789You can also follow the IP address with a note regarding what you are allowing. Below is an example of the command (highlighted in red) in your shell instance:`*root@ded999 [~]*# **apf -a 123.456.789 Allowing Office IP**`

## Blocking IP Addresses in APF

1. [Log into your server via SSH](https://www.inmotionhosting.com/support/server/ssh/connect-ssh/).
2. Here is a breakdown of the the APF command for **blocking** IP’s in APF. Remember to replace this example IP address with the actual IP you want to block:apf -d 12.34.56.789Again, you can also follow the IP address with a note regarding what you are allowing. Below is an example of the command (highlighted in red) in your shell instance:`*root@ded999 [~]*# **apf -d 123.456.789 Blocking Office IP**`

## Unblocking IP Addresses in APF

1. [Log into your server via SSH](https://www.inmotionhosting.com/support/server/ssh/connect-ssh/).
2. Here is a breakdown of the the APF command for **unblocking** IP’s in APF. Don’t forget to replace this IP address with the one you want to unblock:apf -u 12.34.56.789Below is an example of the command (highlighted in red) in your shell instance:`*root@ded999 [~]*# **apf -u 123.456.789**`

---

Congratulations, now you are familiar with the basic APF including *Allowing IP’s*, *Blocking IP’s*, and *Unblocking IP’s*.
