PHPackages                             spomky-labs/ip-filter-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Search &amp; Filtering](/categories/search)
4. /
5. spomky-labs/ip-filter-bundle

AbandonedArchivedSymfony-bundle[Search &amp; Filtering](/categories/search)

spomky-labs/ip-filter-bundle
============================

Symfony2 Ip Filter Bundle

1.2.6(12y ago)5571[1 PRs](https://github.com/Spomky-Labs/IpFilterBundle/pulls)MITPHPPHP &gt;=5.3.3

Since Nov 28Pushed 6y ago1 watchersCompare

[ Source](https://github.com/Spomky-Labs/IpFilterBundle)[ Packagist](https://packagist.org/packages/spomky-labs/ip-filter-bundle)[ Docs](https://github.com/Spomky/SpomkyIpFilterBundle)[ RSS](/packages/spomky-labs-ip-filter-bundle/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (13)Versions (10)Used By (0)

Ip Filter Bundle
================

[](#ip-filter-bundle)

[![Build Status](https://camo.githubusercontent.com/6239ad83e89196db78cc440dedd5ccdffe6c38aa243fde24260b4137e260da86/68747470733a2f2f7472617669732d63692e6f72672f53706f6d6b792d4c6162732f497046696c74657242756e646c652e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/Spomky-Labs/IpFilterBundle)[![Scrutinizer Quality Score](https://camo.githubusercontent.com/7d449c9bef692e434b8a4ed98e10afc3b0eb5b71ce2d1a76d48d60d510316773/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f53706f6d6b792d4c6162732f497046696c74657242756e646c652f6261646765732f7175616c6974792d73636f72652e706e673f733d38303166396166653936326132656639363266613133653562626135356432653537616136386638)](https://scrutinizer-ci.com/g/Spomky-Labs/IpFilterBundle/)[![HHVM Status](https://camo.githubusercontent.com/b7aa71725c512236b25502844301c28d22339e116a2bc6dfbf03b1bbd3dc43cb/687474703a2f2f6868766d2e683463632e64652f62616467652f73706f6d6b792d6c6162732f69702d66696c7465722d62756e646c652e706e67)](http://hhvm.h4cc.de/package/spomky-labs/ip-filter-bundle)

[![SensioLabsInsight](https://camo.githubusercontent.com/a34d09138ddbf664d1c7ba503bb27a1843c47ae0e906bbae9dd94a342065147e/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f61396338646163612d373039622d343739382d393866382d3961346164633539326334652f6269672e706e67)](https://insight.sensiolabs.com/projects/a9c8daca-709b-4798-98f8-9a4adc592c4e)

[![Latest Stable Version](https://camo.githubusercontent.com/09b8afd4e4035a2f8ff8fd8f0ced220deda8634bdd8808ad4adb3a6dfe235fde/68747470733a2f2f706f7365722e707567782e6f72672f73706f6d6b792d6c6162732f69702d66696c7465722d62756e646c652f762f737461626c652e706e67)](https://packagist.org/packages/spomky-labs/ip-filter-bundle)[![Total Downloads](https://camo.githubusercontent.com/2e83fd97dcbaed4c57e819ce6599f3117d653e1401835d775f6c23fa3b52be11/68747470733a2f2f706f7365722e707567782e6f72672f73706f6d6b792d6c6162732f69702d66696c7465722d62756e646c652f646f776e6c6f6164732e706e67)](https://packagist.org/packages/spomky-labs/ip-filter-bundle)[![Latest Unstable Version](https://camo.githubusercontent.com/c2f58f255b6e2a87d0da730e1433a299a7587cea5ea23af3295bf85525708bf4/68747470733a2f2f706f7365722e707567782e6f72672f73706f6d6b792d6c6162732f69702d66696c7465722d62756e646c652f762f756e737461626c652e706e67)](https://packagist.org/packages/spomky-labs/ip-filter-bundle)[![License](https://camo.githubusercontent.com/85403e1fd23b667ac23ec3697f4614d186f00df17958d87bffc931f1ba5a8298/68747470733a2f2f706f7365722e707567782e6f72672f73706f6d6b792d6c6162732f69702d66696c7465722d62756e646c652f6c6963656e73652e706e67)](https://packagist.org/packages/spomky-labs/ip-filter-bundle)

This bundle will help you to restrict access of your application using `IP addresses` and `ranges of IP addresses`.

It supports both `IPv4` and `IPv6` addresses and multiple environments.

For example, you can grant access of a range of addresses from `192.168.1.1` to `192.168.1.100` on `dev` and `test` environments and deny all others.

**Please note that this bundle has bad results in term of performance compared to similar functionality offered by a `.htaccess` file for example.**

Prerequisites
=============

[](#prerequisites)

This version of the bundle requires at least `Symfony 2.3`. It requires `Doctrine`. `Doctrine ORM` is supported, but it may be easy to use `Doctrine ODM` for example.

At has been tested using `PHP 5.3` to `PHP 5.6` and `HHVM` using `Symfony 2.3` to `Symfony 2.6)`.

Policy
======

[](#policy)

Please note that authorized IPs have a higher priority than unauthorized ones. For example, if range `192.168.1.10` to `192.168.1.100` is **unauthorized** and `192.168.1.20` is **authorized**, then `192.168.1.20` will be granted.

Installation
============

[](#installation)

Installation is a quick 4 steps process:

- Download the bundle`
- Enable the Bundle
- Create your model class
- Configure the application

\##Step 1: Install the bundle##

The preferred way to install this bundle is to rely on Composer:

```
composer require "spomky-labs/ip-filter-bundle" "~2.0"
```

\##Step 2: Enable the bundle##

Enable the bundle in the kernel:

```
