PHPackages                             dimkinthepro/wireguard-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. dimkinthepro/wireguard-bundle

ActiveSymfony-bundle[Utility &amp; Helpers](/categories/utility)

dimkinthepro/wireguard-bundle
=============================

Wireguard bundle for Symfony

1.0.0(2y ago)18MITPHPPHP &gt;=8.2

Since Jan 12Pushed 2y ago1 watchersCompare

[ Source](https://github.com/dimkinthepro/wireguard-bundle)[ Packagist](https://packagist.org/packages/dimkinthepro/wireguard-bundle)[ Docs](https://github.com/dimkinthepro/wireguard-bundle)[ RSS](/packages/dimkinthepro-wireguard-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (9)Versions (2)Used By (0)

Wireguard bundle for Symfony
============================

[](#wireguard-bundle-for-symfony)

### 1. Create wireguard bundle configuration:

[](#1-create-wireguard-bundle-configuration)

```
# config/packages/dimkinthepro_wireguard.yaml

dimkinthepro_wireguard:
    wg_interface: 'wg0'
    server_interface: 'eth0' # External interface of the server
    server_external_ip: '93.88.75.12' # External IP of the server
    server_internal_ip: '10.0.0.1/8' # Will be used for wireguard users
    peer_allowed_ips: '0.0.0.0/0' # Can be separated by comma: '192.168.1.0/24, 192.168.2.0/24'
    dns: '8.8.8.8,8.8.4.4'
    port: '51999'
```

### 2. Installation:

[](#2-installation)

```
composer require dimkinthepro/wireguard-bundle
```

### 3. Check bundles config:

[](#3-check-bundles-config)

```
# config/bundles.php

return [
#...
    Dimkinthepro\Wireguard\DimkintheproWireguardBundle::class => ['all' => true],
];
```

### 4. Grand access to wireguard config for php

[](#4-grand-access-to-wireguard-config-for-php)

```
chown "www-data:www-data" /etc/wireguard
```

### 5. Grand access for php

[](#5-grand-access-for-php)

```
echo 'www-data ALL=(ALL) NOPASSWD: ALL' >>  /etc/sudoers
```

### 6. Usage example

[](#6-usage-example)

```
# src/Infrastructure/Service/VpnService.php
