# \[solved\] Wireguard Firewall config

**URL:** <https://forum.openwrt.org/t/solved-wireguard-firewall-config/85682>\
**Category:** Network and Wireless Configuration\
**Created:** [January 17, 2021, 10:37am UTC](https://forum.openwrt.org/t/solved-wireguard-firewall-config/85682 "2021-01-17T10:37:14Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![ivamar](https://forum.openwrt.org/letter_avatar/ivamar/32/5_5575768a8748004e209b776fc1b2916d.png) [@ivamar](https://forum.openwrt.org/u/ivamar)\
**Post date:** [January 17, 2021, 12:21pm UTC](https://forum.openwrt.org/t/solved-wireguard-firewall-config/85682/5 "2021-01-17T12:21:39Z")

</div>

ok i read the wiregard docs again.

this is my config for laptop and mobilephone. its works now.

/etc/config/network

```
config interface 'vpn'
        option proto 'wireguard'
        option private_key 'xxx'
        option listen_port '51820'
        option delegate '0'
        list addresses '10.0.5.1/24'

config wireguard_vpn 'wireguard_laptop'
        option public_key 'xxx'
        option preshared_key 'xxx'
        list allowed_ips '10.0.5.2/32'
        option description 'laptop'
        option route_allowed_ips '1'
        option persistent_keepalive '25'

config wireguard_vpn 'wireguard_phone'
        option public_key 'xxx'
        option preshared_key 'xxx'
        list allowed_ips '10.0.5.3/32'
        option description 'phone'
        option route_allowed_ips '1'
        option persistent_keepalive '25'

```

/etc/config/firewall

```

config rule 'wg'
        option name 'Allow-WireGuard'
        option src 'wan'
        option dest_port '51820'
        option proto 'udp'
        option target 'ACCEPT'

config zone
        option name 'wireguard'
        option input 'ACCEPT'
        option output 'ACCEPT'
        option forward 'ACCEPT'
        option network 'vpn'

config forwarding
        option src 'wireguard'
        option dest 'lan'

config forwarding
        option src 'wireguard'
        option dest 'wan'

```

thank you

---

_[View the full topic](https://forum.openwrt.org/t/solved-wireguard-firewall-config/85682)._
