You can get the client IP using Request service:
$container->get('request')->getClientIp();
More Related Contents:
- Should everything really be a bundle in Symfony 2.x?
- Count Rows in Doctrine QueryBuilder
- How do I read configuration settings from Symfony2 config.yml?
- Using Relationships with Multiple Entity Managers
- symfony2: how to use group_concat in QueryBuilder
- How can I access a service outside of a controller with Symfony2?
- What is the new Symfony 3 directory structure?
- How can I run symfony 2 run command from controller
- Symfony2: how to log user out manually in controller?
- How to specify the scope of Google API to get the birthday
- Get current URL in Twig template?
- The EntityManager is closed
- There is no extension able to load the configuration for “facebookbundle” symfony2
- How can I deploy Symfony in a subdirectory?
- How does the login check_path route work without default controller/action?
- Symfony 2: Creating a service from a Repository
- How to get config parameters in Symfony2 Twig Templates
- How to check if a user is logged in Symfony2 inside a controller?
- The method name must start with either findBy or findOneBy. Undefined method Symfony?
- Symfony2 and Doctrine – Error: Invalid PathExpression. Must be a StateFieldPathExpression
- Doctrine – A new entity was found through the relationship
- Call PHP function from Twig template
- How to convert this to Doctrine 2 QueryBuilder format?
- Twig: render vs include
- How to configure naming strategy in Doctrine 2
- Get entityManager inside an Entity
- Primary key of owning side as a join column
- Adding Captcha to Symfony2 Login Page
- Symfony2 default locale in routing
- symfony2 chained selectors