[SOLVED] OpenWrt Project: WireGuard server

Hello,
I think there are typing inversions in the guides:

WireGuard server:
2. Key management

Client public key

WG_PUB = "$ (cat wgclient.pub)"
instead of

Server public key

WG_PUB = "$ (cat wgserver.pub)"

And in the guide

WireGuard client:
2. Key management

Server public key

WG_PUB = "$ (cat wgserver.pub)"
instead of

Client public key

WG_PUB = "$ (cat wgclient.pub)"

By the way, when I install WireGuard server, as a home server on my TP-Link router, Archer C7 AC1750 v4 firmware 19.07.4 all works.
When I install WireGuard client on my router, wireguard-vpn is displayed instead of vpn. In IPV4 vpn route disappeared, the Wiregard interface no longer has a public key.
In network, vpn interface, general parameters the IP address of the server 192.168.9.1/24 is replaced by the IP address of the client 192.168.9.2/24.
I followed these configurations to the letter. Maybe I shouldn't install WireGuard server and WireGuard client on the same router because it doesn't work.
What I want: to have WireGuard server as a home server to connect to the internet without an external VPN.
Thank you for being accommodating and have a nice day

1 Like

Please, read the description carefully:

2 Likes

You probably don't need two separate WG interfaces. Please copy the output of the following commands and post it here using the "Preformatted text </> " button:
grafik
Remember to redact passwords, MAC addresses and any public IP addresses you may have

ubus call system board; \
uci export network; uci export firewall; \
head -n -0 /etc/firewall.user; \
iptables-save -c; \
ip -4 addr; ip -4 ro li tab all; ip -4 ru; \
wg
2 Likes

In fact, I wanted to test the server wireguard and the client wireguard of the wiki which has changed. In client wireguard I put WG_SERV = 192.168.9.1
When you install wireguard client, the LuCI → Status → WireGuard Status menu displays "the interface does not have a public key"

For three months, I only installed wireguard server with its interface and the peer, without installing client wireguard, then I manually added my 6 devices in the peers, I have the handshakes. I installed the no-ip.com ddns. I configured the Fai modem and everything works. However, I cannot connect to my home server from the outside with my smartphone, there are no handshakes.

I will open a new post on this subject in the installation section.

1 Like

If you need a multi-client server, you can use this method:
[SOLVED] Exporting Client Configuration file for Wireguard

1 Like

Sorry I uninstalled everything and reset my configuration to default which works on one leg
I'll reinstall the problematic server wireguard and client wireguard and get back to you.
Have a good day

1 Like

Thanks, vgaetera

sirizha I will stay at my current setup which works and open a post in install for the ddns problem

1 Like

Hello

The server wireguard and client wireguard installation does not work. The client replaced the server in the vpn interface, so the interface does not have its public key. In this configuration, I have no internet connection. Internet connection with: route_allowed_ips = "0".

Whatever the configuration, when I activate wireguard on the PC, I do not have access to LuCi.

My question, if the server wireguard installation works with several clients, in which case do you install client wireguard?

By the way, if you wish, I can give you the same output for server wireguar that works

Have a nice day

root@OpenWrt:~# ubus call system board; \
>
{
        "kernel": "4.14.195",
        "hostname": "OpenWrt",
        "system": "Qualcomm Atheros QCA956X ver 1 rev 0",
        "model": "TP-Link Archer C7 v4",
        "board_name": "tplink,archer-c7-v4",
        "release": {
                "distribution": "OpenWrt",
                "version": "19.07.4",
                "revision": "r11208-ce6496d796",
                "target": "ath79/generic",
                "description": "OpenWrt 19.07.4 r11208-ce6496d796"
        }
}
root@OpenWrt:~#
-------------------------
root@OpenWrt:~# uci export network; uci export firewall; \
>
package network

config interface 'loopback'
        option ifname 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'

config globals 'globals'
        option ula_prefix 'fd35:04e2:3a67::/48'

config interface 'lan'
        option type 'bridge'
        option ifname 'eth0.1'
        option proto 'static'
        option ipaddr '192.168.1.1'
        option netmask '255.255.255.0'
        option ip6assign '60'

config interface 'wan'
        option ifname 'eth0.2'
        option proto 'dhcp'
        option metric '100'

config device 'wan_eth0_2_dev'
        option name 'eth0.2'
        option macaddr '50:c7:bf:fe:ae:b6'

config interface 'wan6'
        option ifname 'eth0.2'
        option proto 'dhcpv6'
        option metric '100'

config switch
        option name 'switch0'
        option reset '1'
        option enable_vlan '1'

config switch_vlan
        option device 'switch0'
        option vlan '1'
        option ports '2 3 4 5 0t'

config switch_vlan
        option device 'switch0'
        option vlan '2'
        option ports '1 0t'

config wireguard_vpn 'wgclient'
        option persistent_keepalive '25'
        option public_key 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxg0='
        option description 'Portable_Voyoi7'
        list allowed_ips '192.168.9.2/32'
        list allowed_ips 'fdf1:e8a1:8d3f:9::2/128'
        list allowed_ips '0.0.0.0/0'
        list allowed_ips '::/0'

config wireguard_vpn
        option persistent_keepalive '25'
        option public_key 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxb1Ac='
        option description 'Portable_Asus'
        list allowed_ips '192.168.9.3/32'
        list allowed_ips 'fdf1:e8a1:8d3f:9::3/128'
        list allowed_ips '0.0.0.0/0'
        list allowed_ips '::/0'

config wireguard_vpn
        option public_key 'xxxxxxxxxxxxxxxxxxxxxxxxxx85AE='
        option description 'BV9500Pro'
        list allowed_ips '192.168.9.4/32'
        list allowed_ips 'fdf1:e8a1:8d3f:9::4/128'
        list allowed_ips '0.0.0.0/0'
        list allowed_ips '::/0'
        option preshared_key 'xxxxxxxxxxxxxxxxxxxxxxxxxxeY='
        option persistent_keepalive '25'

config wireguard_vpn
        option public_key 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxw0='
        option description 'BV9000Pro'
        list allowed_ips '192.168.9.5/32'
        list allowed_ips 'fdf1:e8a1:8d3f:9::5/128'
        list allowed_ips '0.0.0.0/0'
        list allowed_ips '::/0'
        option preshared_key 'xxxxxxxxxxxxxxxxxxxxxxxxxxxTh8='
        option persistent_keepalive '25'

config wireguard_vpn
        option persistent_keepalive '25'
        option public_key 'xxxxxxxxxxxxxxxxxxxxxxxxAo='
        option description 'Tablette_AlldoCube'
        list allowed_ips '192.168.9.6/32'
        list allowed_ips 'fdf1:e8a1:8d3f:9::6/128'
        list allowed_ips '0.0.0.0/0'
        list allowed_ips '::/0'

config wireguard_vpn
        option persistent_keepalive '25'
        option public_key 'xxxxxxxxxxxxxxxxxxxxxxxxxxPfmk='
        option description 'Tablette_Voyoi8'
        list allowed_ips '192.168.9.7/32'
        list allowed_ips 'fdf1:e8a1:8d3f:9::7/128'
        list allowed_ips '0.0.0.0/0'
        list allowed_ips '::/0'

config interface 'vpn'
        option proto 'wireguard'
        option private_key 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx='
        list addresses '192.168.9.2/24'
        list addresses 'fdf1:7610:d152:3a9c::2/64'

config wireguard_vpn 'wgserver'
        option public_key 'xxxxxxxxxxxxxxxxxxxxxxxxx0Y='
        option endpoint_port '51820'
        option persistent_keepalive '25'
        list allowed_ips '0.0.0.0/0'
        list allowed_ips '::/0'
        option endpoint_host '192.168.9.1'

package firewall

config defaults
        option syn_flood '1'
        option input 'ACCEPT'
        option output 'ACCEPT'
        option forward 'REJECT'

config zone 'lan'
        option name 'lan'
        list network 'lan'
        list network 'vpn'
        option input 'ACCEPT'
        option output 'ACCEPT'
        option forward 'ACCEPT'

config zone 'wan'
        option name 'wan'
        list network 'wan'
        list network 'wan6'
        list network 'vpn'
        option input 'REJECT'
        option output 'ACCEPT'
        option forward 'REJECT'
        option masq '1'
        option mtu_fix '1'

config forwarding 'lan_wan'
        option src 'lan'
        option dest 'wan'

config rule
        option name 'Allow-DHCP-Renew'
        option src 'wan'
        option proto 'udp'
        option dest_port '68'
        option target 'ACCEPT'
        option family 'ipv4'

config rule
        option name 'Allow-Ping'
        option src 'wan'
        option proto 'icmp'
        option icmp_type 'echo-request'
        option family 'ipv4'
        option target 'ACCEPT'

config rule
        option name 'Allow-IGMP'
        option src 'wan'
        option proto 'igmp'
        option family 'ipv4'
        option target 'ACCEPT'

config rule
        option name 'Allow-DHCPv6'
        option src 'wan'
        option proto 'udp'
        option src_ip 'fc00::/6'
        option dest_ip 'fc00::/6'
        option dest_port '546'
        option family 'ipv6'
        option target 'ACCEPT'

config rule
        option name 'Allow-MLD'
        option src 'wan'
        option proto 'icmp'
        option src_ip 'fe80::/10'
        list icmp_type '130/0'
        list icmp_type '131/0'
        list icmp_type '132/0'
        list icmp_type '143/0'
        option family 'ipv6'
        option target 'ACCEPT'

config rule
        option name 'Allow-ICMPv6-Input'
        option src 'wan'
        option proto 'icmp'
        list icmp_type 'echo-request'
        list icmp_type 'echo-reply'
        list icmp_type 'destination-unreachable'
        list icmp_type 'packet-too-big'
        list icmp_type 'time-exceeded'
        list icmp_type 'bad-header'
        list icmp_type 'unknown-header-type'
        list icmp_type 'router-solicitation'
        list icmp_type 'neighbour-solicitation'
        list icmp_type 'router-advertisement'
        list icmp_type 'neighbour-advertisement'
        option limit '1000/sec'
        option family 'ipv6'
        option target 'ACCEPT'

config rule
        option name 'Allow-ICMPv6-Forward'
        option src 'wan'
        option dest '*'
        option proto 'icmp'
        list icmp_type 'echo-request'
        list icmp_type 'echo-reply'
        list icmp_type 'destination-unreachable'
        list icmp_type 'packet-too-big'
        list icmp_type 'time-exceeded'
        list icmp_type 'bad-header'
        list icmp_type 'unknown-header-type'
        option limit '1000/sec'
        option family 'ipv6'
        option target 'ACCEPT'

config rule
        option name 'Allow-IPSec-ESP'
        option src 'wan'
        option dest 'lan'
        option proto 'esp'
        option target 'ACCEPT'

config rule
        option name 'Allow-ISAKMP'
        option src 'wan'
        option dest 'lan'
        option dest_port '500'
        option proto 'udp'
        option target 'ACCEPT'

config include
        option path '/etc/firewall.user'

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

root@OpenWrt:~#
------------------------
root@OpenWrt:~# head -n -0 /etc/firewall.user; \
>
# This file is interpreted as shell script.
# Put your custom iptables rules here, they will
# be executed with each firewall (re-)start.

# Internal uci firewall chains are flushed and recreated on reload, so
# put custom rules into the root chains e.g. INPUT or FORWARD or into the
# special user chains, e.g. input_wan_rule or postrouting_lan_rule.
root@OpenWrt:~#
---------------------------
root@OpenWrt:~# iptables-save -c; \
>
# Generated by iptables-save v1.8.3 on Wed Oct 14 13:40:09 2020
*nat
:PREROUTING ACCEPT [474:71201]
:INPUT ACCEPT [106:6575]
:OUTPUT ACCEPT [290:20992]
:POSTROUTING ACCEPT [34:2688]
:postrouting_lan_rule - [0:0]
:postrouting_rule - [0:0]
:postrouting_wan_rule - [0:0]
:prerouting_lan_rule - [0:0]
:prerouting_rule - [0:0]
:prerouting_wan_rule - [0:0]
:zone_lan_postrouting - [0:0]
:zone_lan_prerouting - [0:0]
:zone_wan_postrouting - [0:0]
:zone_wan_prerouting - [0:0]
[474:71201] -A PREROUTING -m comment --comment "!fw3: Custom prerouting rule chain" -j prerouting_rule
[414:54652] -A PREROUTING -i br-lan -m comment --comment "!fw3" -j zone_lan_prerouting
[0:0] -A PREROUTING -i vpn -m comment --comment "!fw3" -j zone_lan_prerouting
[60:16549] -A PREROUTING -i eth0.2 -m comment --comment "!fw3" -j zone_wan_prerouting
[0:0] -A PREROUTING -i vpn -m comment --comment "!fw3" -j zone_wan_prerouting
[447:43128] -A POSTROUTING -m comment --comment "!fw3: Custom postrouting rule chain" -j postrouting_rule
[4:752] -A POSTROUTING -o br-lan -m comment --comment "!fw3" -j zone_lan_postrouting
[5:880] -A POSTROUTING -o vpn -m comment --comment "!fw3" -j zone_lan_postrouting
[408:39560] -A POSTROUTING -o eth0.2 -m comment --comment "!fw3" -j zone_wan_postrouting
[5:880] -A POSTROUTING -o vpn -m comment --comment "!fw3" -j zone_wan_postrouting
[9:1632] -A zone_lan_postrouting -m comment --comment "!fw3: Custom lan postrouting rule chain" -j postrouting_lan_rule
[414:54652] -A zone_lan_prerouting -m comment --comment "!fw3: Custom lan prerouting rule chain" -j prerouting_lan_rule
[413:40440] -A zone_wan_postrouting -m comment --comment "!fw3: Custom wan postrouting rule chain" -j postrouting_wan_rule
[413:40440] -A zone_wan_postrouting -m comment --comment "!fw3" -j MASQUERADE
[60:16549] -A zone_wan_prerouting -m comment --comment "!fw3: Custom wan prerouting rule chain" -j prerouting_wan_rule
COMMIT
# Completed on Wed Oct 14 13:40:09 2020
# Generated by iptables-save v1.8.3 on Wed Oct 14 13:40:09 2020
*mangle
:PREROUTING ACCEPT [4687:838278]
:INPUT ACCEPT [1908:217996]
:FORWARD ACCEPT [2598:579617]
:OUTPUT ACCEPT [2343:771648]
:POSTROUTING ACCEPT [4934:1350985]
[328:17232] -A FORWARD -o eth0.2 -p tcp -m tcp --tcp-flags SYN,RST SYN -m comment --comment "!fw3: Zone wan MTU fixing" -j TCPMSS --clamp-mss-to-pmtu
[83:4492] -A FORWARD -i eth0.2 -p tcp -m tcp --tcp-flags SYN,RST SYN -m comment --comment "!fw3: Zone wan MTU fixing" -j TCPMSS --clamp-mss-to-pmtu
[0:0] -A FORWARD -o vpn -p tcp -m tcp --tcp-flags SYN,RST SYN -m comment --comment "!fw3: Zone wan MTU fixing" -j TCPMSS --clamp-mss-to-pmtu
[0:0] -A FORWARD -i vpn -p tcp -m tcp --tcp-flags SYN,RST SYN -m comment --comment "!fw3: Zone wan MTU fixing" -j TCPMSS --clamp-mss-to-pmtu
COMMIT
# Completed on Wed Oct 14 13:40:09 2020
# Generated by iptables-save v1.8.3 on Wed Oct 14 13:40:09 2020
*filter
:INPUT ACCEPT [0:0]
:FORWARD DROP [0:0]
:OUTPUT ACCEPT [0:0]
:forwarding_lan_rule - [0:0]
:forwarding_rule - [0:0]
:forwarding_wan_rule - [0:0]
:input_lan_rule - [0:0]
:input_rule - [0:0]
:input_wan_rule - [0:0]
:output_lan_rule - [0:0]
:output_rule - [0:0]
:output_wan_rule - [0:0]
:reject - [0:0]
:syn_flood - [0:0]
:zone_lan_dest_ACCEPT - [0:0]
:zone_lan_forward - [0:0]
:zone_lan_input - [0:0]
:zone_lan_output - [0:0]
:zone_lan_src_ACCEPT - [0:0]
:zone_wan_dest_ACCEPT - [0:0]
:zone_wan_dest_REJECT - [0:0]
:zone_wan_forward - [0:0]
:zone_wan_input - [0:0]
:zone_wan_output - [0:0]
:zone_wan_src_REJECT - [0:0]
[186:15437] -A INPUT -i lo -m comment --comment "!fw3" -j ACCEPT
[1725:202679] -A INPUT -m comment --comment "!fw3: Custom input rule chain" -j input_rule
[1483:184147] -A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -m comment --comment "!fw3" -j ACCEPT
[56:2912] -A INPUT -p tcp -m tcp --tcp-flags FIN,SYN,RST,ACK SYN -m comment --comment "!fw3" -j syn_flood
[190:14583] -A INPUT -i br-lan -m comment --comment "!fw3" -j zone_lan_input
[0:0] -A INPUT -i vpn -m comment --comment "!fw3" -j zone_lan_input
[52:3949] -A INPUT -i eth0.2 -m comment --comment "!fw3" -j zone_wan_input
[0:0] -A INPUT -i vpn -m comment --comment "!fw3" -j zone_wan_input
[2598:579617] -A FORWARD -m comment --comment "!fw3: Custom forwarding rule chain" -j forwarding_rule
[2241:543619] -A FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -m comment --comment "!fw3" -j ACCEPT
[357:35998] -A FORWARD -i br-lan -m comment --comment "!fw3" -j zone_lan_forward
[0:0] -A FORWARD -i vpn -m comment --comment "!fw3" -j zone_lan_forward
[0:0] -A FORWARD -i eth0.2 -m comment --comment "!fw3" -j zone_wan_forward
[0:0] -A FORWARD -i vpn -m comment --comment "!fw3" -j zone_wan_forward
[0:0] -A FORWARD -m comment --comment "!fw3" -j reject
[431:35037] -A OUTPUT -o lo -m comment --comment "!fw3" -j ACCEPT
[1917:737979] -A OUTPUT -m comment --comment "!fw3: Custom output rule chain" -j output_rule
[1569:711914] -A OUTPUT -m conntrack --ctstate RELATED,ESTABLISHED -m comment --comment "!fw3" -j ACCEPT
[8:2064] -A OUTPUT -o br-lan -m comment --comment "!fw3" -j zone_lan_output
[0:0] -A OUTPUT -o vpn -m comment --comment "!fw3" -j zone_lan_output
[340:24001] -A OUTPUT -o eth0.2 -m comment --comment "!fw3" -j zone_wan_output
[0:0] -A OUTPUT -o vpn -m comment --comment "!fw3" -j zone_wan_output
[17:1142] -A reject -p tcp -m comment --comment "!fw3" -j REJECT --reject-with tcp-reset
[35:2807] -A reject -m comment --comment "!fw3" -j REJECT --reject-with icmp-port-unreachable
[56:2912] -A syn_flood -p tcp -m tcp --tcp-flags FIN,SYN,RST,ACK SYN -m limit --limit 25/sec --limit-burst 50 -m comment --comment "!fw3" -j RETURN
[0:0] -A syn_flood -m comment --comment "!fw3" -j DROP
[8:2064] -A zone_lan_dest_ACCEPT -o br-lan -m comment --comment "!fw3" -j ACCEPT
[0:0] -A zone_lan_dest_ACCEPT -o vpn -m comment --comment "!fw3" -j ACCEPT
[357:35998] -A zone_lan_forward -m comment --comment "!fw3: Custom lan forwarding rule chain" -j forwarding_lan_rule
[357:35998] -A zone_lan_forward -m comment --comment "!fw3: Zone lan to wan forwarding policy" -j zone_wan_dest_ACCEPT
[0:0] -A zone_lan_forward -m conntrack --ctstate DNAT -m comment --comment "!fw3: Accept port forwards" -j ACCEPT
[0:0] -A zone_lan_forward -m comment --comment "!fw3" -j zone_lan_dest_ACCEPT
[190:14583] -A zone_lan_input -m comment --comment "!fw3: Custom lan input rule chain" -j input_lan_rule
[0:0] -A zone_lan_input -m conntrack --ctstate DNAT -m comment --comment "!fw3: Accept port redirections" -j ACCEPT
[190:14583] -A zone_lan_input -m comment --comment "!fw3" -j zone_lan_src_ACCEPT
[8:2064] -A zone_lan_output -m comment --comment "!fw3: Custom lan output rule chain" -j output_lan_rule
[8:2064] -A zone_lan_output -m comment --comment "!fw3" -j zone_lan_dest_ACCEPT
[190:14583] -A zone_lan_src_ACCEPT -i br-lan -m conntrack --ctstate NEW,UNTRACKED -m comment --comment "!fw3" -j ACCEPT
[0:0] -A zone_lan_src_ACCEPT -i vpn -m conntrack --ctstate NEW,UNTRACKED -m comment --comment "!fw3" -j ACCEPT
[7:280] -A zone_wan_dest_ACCEPT -o eth0.2 -m conntrack --ctstate INVALID -m comment --comment "!fw3: Prevent NAT leakage" -j DROP
[677:57431] -A zone_wan_dest_ACCEPT -o eth0.2 -m comment --comment "!fw3" -j ACCEPT
[0:0] -A zone_wan_dest_ACCEPT -o vpn -m conntrack --ctstate INVALID -m comment --comment "!fw3: Prevent NAT leakage" -j DROP
[13:2288] -A zone_wan_dest_ACCEPT -o vpn -m comment --comment "!fw3" -j ACCEPT
[0:0] -A zone_wan_dest_REJECT -o eth0.2 -m comment --comment "!fw3" -j reject
[0:0] -A zone_wan_dest_REJECT -o vpn -m comment --comment "!fw3" -j reject
[0:0] -A zone_wan_forward -m comment --comment "!fw3: Custom wan forwarding rule chain" -j forwarding_wan_rule
[0:0] -A zone_wan_forward -p esp -m comment --comment "!fw3: Allow-IPSec-ESP" -j zone_lan_dest_ACCEPT
[0:0] -A zone_wan_forward -p udp -m udp --dport 500 -m comment --comment "!fw3: Allow-ISAKMP" -j zone_lan_dest_ACCEPT
[0:0] -A zone_wan_forward -m conntrack --ctstate DNAT -m comment --comment "!fw3: Accept port forwards" -j ACCEPT
[0:0] -A zone_wan_forward -m comment --comment "!fw3" -j zone_wan_dest_REJECT
[52:3949] -A zone_wan_input -m comment --comment "!fw3: Custom wan input rule chain" -j input_wan_rule
[0:0] -A zone_wan_input -p udp -m udp --dport 68 -m comment --comment "!fw3: Allow-DHCP-Renew" -j ACCEPT
[0:0] -A zone_wan_input -p icmp -m icmp --icmp-type 8 -m comment --comment "!fw3: Allow-Ping" -j ACCEPT
[0:0] -A zone_wan_input -p igmp -m comment --comment "!fw3: Allow-IGMP" -j ACCEPT
[0:0] -A zone_wan_input -p udp -m udp --dport 51820 -m comment --comment "!fw3: Allow-WireGuard" -j ACCEPT
[0:0] -A zone_wan_input -m conntrack --ctstate DNAT -m comment --comment "!fw3: Accept port redirections" -j ACCEPT
[52:3949] -A zone_wan_input -m comment --comment "!fw3" -j zone_wan_src_REJECT
[340:24001] -A zone_wan_output -m comment --comment "!fw3: Custom wan output rule chain" -j output_wan_rule
[340:24001] -A zone_wan_output -m comment --comment "!fw3" -j zone_wan_dest_ACCEPT
[52:3949] -A zone_wan_src_REJECT -i eth0.2 -m comment --comment "!fw3" -j reject
[0:0] -A zone_wan_src_REJECT -i vpn -m comment --comment "!fw3" -j reject
COMMIT
# Completed on Wed Oct 14 13:40:09 2020
root@OpenWrt:~#
--------------------------
root@OpenWrt:~# ip -4 addr; ip -4 ro li tab all; ip -4 ru; \
>
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
6: br-lan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    inet 192.168.1.1/24 brd 192.168.1.255 scope global br-lan
       valid_lft forever preferred_lft forever
8: eth0.2@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    inet 192.168.8.102/24 brd 192.168.8.255 scope global eth0.2
       valid_lft forever preferred_lft forever
9: vpn: <POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1420 qdisc noqueue state UNKNOWN group default qlen 1000
    inet 192.168.9.2/24 brd 192.168.9.255 scope global vpn
       valid_lft forever preferred_lft forever
default via 192.168.8.1 dev eth0.2 proto static src 192.168.8.102 metric 100
192.168.1.0/24 dev br-lan proto kernel scope link src 192.168.1.1
192.168.8.0/24 dev eth0.2 proto static scope link metric 100
192.168.9.0/24 dev vpn proto kernel scope link src 192.168.9.2
broadcast 127.0.0.0 dev lo table local proto kernel scope link src 127.0.0.1
local 127.0.0.0/8 dev lo table local proto kernel scope host src 127.0.0.1
local 127.0.0.1 dev lo table local proto kernel scope host src 127.0.0.1
broadcast 127.255.255.255 dev lo table local proto kernel scope link src 127.0.0.1
broadcast 192.168.1.0 dev br-lan table local proto kernel scope link src 192.168.1.1
local 192.168.1.1 dev br-lan table local proto kernel scope host src 192.168.1.1
broadcast 192.168.1.255 dev br-lan table local proto kernel scope link src 192.168.1.1
broadcast 192.168.8.0 dev eth0.2 table local proto kernel scope link src 192.168.8.102
local 192.168.8.102 dev eth0.2 table local proto kernel scope host src 192.168.8.102
broadcast 192.168.8.255 dev eth0.2 table local proto kernel scope link src 192.168.8.102
broadcast 192.168.9.0 dev vpn table local proto kernel scope link src 192.168.9.2
local 192.168.9.2 dev vpn table local proto kernel scope host src 192.168.9.2
broadcast 192.168.9.255 dev vpn table local proto kernel scope link src 192.168.9.2
0:      from all lookup local
32766:  from all lookup main
32767:  from all lookup default
root@OpenWrt:~#
---------------------
root@OpenWrt:~# wg
interface: vpn
  public key: xxxxxxxxxxxxxxxxxxxxxxxxxxxs6Bs0Y=
  private key: (hidden)
  listening port: 54695

peer: xxxxxxxxxxxxxxxxxxxxxxxxxxg0=
  allowed ips: 192.168.9.2/32, fdf1:e8a1:8d3f:9::2/128
  persistent keepalive: every 25 seconds

peer: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxhmb1Ac=
  allowed ips: 192.168.9.3/32, fdf1:e8a1:8d3f:9::3/128
  persistent keepalive: every 25 seconds

peer: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxAE=
  preshared key: (hidden)
  allowed ips: 192.168.9.4/32, fdf1:e8a1:8d3f:9::4/128
  persistent keepalive: every 25 seconds

peer: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxw0=
  preshared key: (hidden)
  allowed ips: 192.168.9.5/32, fdf1:e8a1:8d3f:9::5/128
  persistent keepalive: every 25 seconds

peer: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxaAo=
  allowed ips: 192.168.9.6/32, fdf1:e8a1:8d3f:9::6/128
  persistent keepalive: every 25 seconds

peer: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxfmk=
  allowed ips: 192.168.9.7/32, fdf1:e8a1:8d3f:9::7/128, 0.0.0.0/0, ::/0
  persistent keepalive: every 25 seconds
root@OpenWrt:~#

There really is no such thing as 'server' or 'client' when it comes to wireguard. It's a peer to peer system. Can you post your other setup which works?

What exactly are you trying to achieve as an end result? Are you wanting to connect from your router to an external VPN provider? Or connect external devices to your LAN? If it's the latter do you want them to be able to access the internet via your router as well?

Thank you for answering,

I don't want to connect to an external provider
I have my no-ip.com domain and I am connected to my Fai via a Huawei 4G LTE box
I want to connect to my home router when I travel in order to access the internet (this is not currently working)

I live in Martinique and I want my children who live in mainland France to be able to connect to my local network in order to have access to my data (under study because I have not yet succeeded in connecting my hard drives to the router, but this is not the subject of the current topic).

I attach my configuration or I installed wireguard server (this configuration has been saved because it is not active at the moment). Eventually I can restore it if you wish.
It is a configuration that I test before the arrival of version 20.xx (because the wiki has been modified). If you help me solve this problem, I will just have to integrate it into my working configuration.

It does not reflect my working configuration which is more secure and includes among others (Public key authentication, dnscrypt-proxy2 from the LuCi 2.0.44-1 package, etc.).

Thank you for your availability

root@OpenWrt:~# ubus call system board; \
>
{
        "kernel": "4.14.195",
        "hostname": "OpenWrt",
        "system": "Qualcomm Atheros QCA956X ver 1 rev 0",
        "model": "TP-Link Archer C7 v4",
        "board_name": "tplink,archer-c7-v4",
        "release": {
                "distribution": "OpenWrt",
                "version": "19.07.4",
                "revision": "r11208-ce6496d796",
                "target": "ath79/generic",
                "description": "OpenWrt 19.07.4 r11208-ce6496d796"
        }
}

-------------------------
root@OpenWrt:~# uci export network; uci export firewall; \
>
package network

config interface 'loopback'
        option ifname 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'

config globals 'globals'
        option ula_prefix 'fd35:04e2:3a67::/48'

config interface 'lan'
        option type 'bridge'
        option ifname 'eth0.1'
        option proto 'static'
        option ipaddr '192.168.1.1'
        option netmask '255.255.255.0'
        option ip6assign '60'

config interface 'wan'
        option ifname 'eth0.2'
        option proto 'dhcp'
        option metric '100'

config device 'wan_eth0_2_dev'
        option name 'eth0.2'
        option macaddr '50:c7:bf:fe:ae:b6'

config interface 'wan6'
        option ifname 'eth0.2'
        option proto 'dhcpv6'
        option metric '100'

config switch
        option name 'switch0'
        option reset '1'
        option enable_vlan '1'

config switch_vlan
        option device 'switch0'
        option vlan '1'
        option ports '2 3 4 5 0t'

config switch_vlan
        option device 'switch0'
        option vlan '2'
        option ports '1 0t'

config interface 'vpn'
        option proto 'wireguard'
        option listen_port '51820'
        list addresses '192.168.9.1/24'
        list addresses 'fdf1:e8a1:8d3f:9::1/64'
        option private_key 'xxxxxxxxxxxxxxxxxxxxxxxxxo='

config wireguard_vpn 'wgclient'
        option persistent_keepalive '25'
        option public_key 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx0='
        option description 'Portable_Voyoi7'
        list allowed_ips '192.168.9.2/32'
        list allowed_ips 'fdf1:e8a1:8d3f:9::2/128'
        list allowed_ips '0.0.0.0/0'
        list allowed_ips '::/0'

config wireguard_vpn
        option persistent_keepalive '25'
        option public_key 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx1Ac='
        option description 'Portable_Asus'
        list allowed_ips '192.168.9.3/32'
        list allowed_ips 'fdf1:e8a1:8d3f:9::3/128'
        list allowed_ips '0.0.0.0/0'
        list allowed_ips '::/0'

config wireguard_vpn
        option public_key 'xxxxxxxxxxxxxxxxxxxxxxxxxxxx5AE='
        option description 'BV9500Pro'
        list allowed_ips '192.168.9.4/32'
        list allowed_ips 'fdf1:e8a1:8d3f:9::4/128'
        list allowed_ips '0.0.0.0/0'
        list allowed_ips '::/0'
        option preshared_key 'xxxxxxxxxxxxxxxxxxxxxxxxxxxx/eY='
        option persistent_keepalive '25'

config wireguard_vpn
        option public_key 'xxxxxxxxxxxxxxxxxxxxxxxxxxxw0='
        option description 'BV9000Pro'
        list allowed_ips '192.168.9.5/32'
        list allowed_ips 'fdf1:e8a1:8d3f:9::5/128'
        list allowed_ips '0.0.0.0/0'
        list allowed_ips '::/0'
        option preshared_key 'xxxxxxxxxxxxxxxxxxxxxxxxxTh8='
        option persistent_keepalive '25'

config wireguard_vpn
        option persistent_keepalive '25'
        option public_key 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxaAo='
        option description 'Tablette_AlldoCube'
        list allowed_ips '192.168.9.6/32'
        list allowed_ips 'fdf1:e8a1:8d3f:9::6/128'
        list allowed_ips '0.0.0.0/0'
        list allowed_ips '::/0'

config wireguard_vpn
        option persistent_keepalive '25'
        option public_key 'xxxxxxxxxxxxxxxxxxxxxxxxxxfmk='
        option description 'Tablette_Voyoi8'
        list allowed_ips '192.168.9.7/32'
        list allowed_ips 'fdf1:e8a1:8d3f:9::7/128'
        list allowed_ips '0.0.0.0/0'
        list allowed_ips '::/0'

package firewall

config defaults
        option syn_flood '1'
        option input 'ACCEPT'
        option output 'ACCEPT'
        option forward 'REJECT'

config zone 'lan'
        option name 'lan'
        list network 'lan'
        list network 'vpn'
        option input 'ACCEPT'
        option output 'ACCEPT'
        option forward 'ACCEPT'

config zone 'wan'
        option name 'wan'
        list network 'wan'
        list network 'wan6'
        option input 'REJECT'
        option output 'ACCEPT'
        option forward 'REJECT'
        option masq '1'
        option mtu_fix '1'

config forwarding 'lan_wan'
        option src 'lan'
        option dest 'wan'

config rule
        option name 'Allow-DHCP-Renew'
        option src 'wan'
        option proto 'udp'
        option dest_port '68'
        option target 'ACCEPT'
        option family 'ipv4'

config rule
        option name 'Allow-Ping'
        option src 'wan'
        option proto 'icmp'
        option icmp_type 'echo-request'
        option family 'ipv4'
        option target 'ACCEPT'

config rule
        option name 'Allow-IGMP'
        option src 'wan'
        option proto 'igmp'
        option family 'ipv4'
        option target 'ACCEPT'

config rule
        option name 'Allow-DHCPv6'
        option src 'wan'
        option proto 'udp'
        option src_ip 'fc00::/6'
        option dest_ip 'fc00::/6'
        option dest_port '546'
        option family 'ipv6'
        option target 'ACCEPT'

config rule
        option name 'Allow-MLD'
        option src 'wan'
        option proto 'icmp'
        option src_ip 'fe80::/10'
        list icmp_type '130/0'
        list icmp_type '131/0'
        list icmp_type '132/0'
        list icmp_type '143/0'
        option family 'ipv6'
        option target 'ACCEPT'

config rule
        option name 'Allow-ICMPv6-Input'
        option src 'wan'
        option proto 'icmp'
        list icmp_type 'echo-request'
        list icmp_type 'echo-reply'
        list icmp_type 'destination-unreachable'
        list icmp_type 'packet-too-big'
        list icmp_type 'time-exceeded'
        list icmp_type 'bad-header'
        list icmp_type 'unknown-header-type'
        list icmp_type 'router-solicitation'
        list icmp_type 'neighbour-solicitation'
        list icmp_type 'router-advertisement'
        list icmp_type 'neighbour-advertisement'
        option limit '1000/sec'
        option family 'ipv6'
        option target 'ACCEPT'

config rule
        option name 'Allow-ICMPv6-Forward'
        option src 'wan'
        option dest '*'
        option proto 'icmp'
        list icmp_type 'echo-request'
        list icmp_type 'echo-reply'
        list icmp_type 'destination-unreachable'
        list icmp_type 'packet-too-big'
        list icmp_type 'time-exceeded'
        list icmp_type 'bad-header'
        list icmp_type 'unknown-header-type'
        option limit '1000/sec'
        option family 'ipv6'
        option target 'ACCEPT'

config rule
        option name 'Allow-IPSec-ESP'
        option src 'wan'
        option dest 'lan'
        option proto 'esp'
        option target 'ACCEPT'

config rule
        option name 'Allow-ISAKMP'
        option src 'wan'
        option dest 'lan'
        option dest_port '500'
        option proto 'udp'
        option target 'ACCEPT'

config include
        option path '/etc/firewall.user'

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


------------------------
root@OpenWrt:~# head -n -0 /etc/firewall.user; \
>
# This file is interpreted as shell script.
# Put your custom iptables rules here, they will
# be executed with each firewall (re-)start.

# Internal uci firewall chains are flushed and recreated on reload, so
# put custom rules into the root chains e.g. INPUT or FORWARD or into the
# special user chains, e.g. input_wan_rule or postrouting_lan_rule.

------------------------
root@OpenWrt:~# iptables-save -c; \
>
# Generated by iptables-save v1.8.3 on Wed Oct 14 13:57:25 2020
*nat
:PREROUTING ACCEPT [666:66721]
:INPUT ACCEPT [300:19364]
:OUTPUT ACCEPT [220:15832]
:POSTROUTING ACCEPT [22:2273]
:postrouting_lan_rule - [0:0]
:postrouting_rule - [0:0]
:postrouting_wan_rule - [0:0]
:prerouting_lan_rule - [0:0]
:prerouting_rule - [0:0]
:prerouting_wan_rule - [0:0]
:zone_lan_postrouting - [0:0]
:zone_lan_prerouting - [0:0]
:zone_wan_postrouting - [0:0]
:zone_wan_prerouting - [0:0]
[666:66721] -A PREROUTING -m comment --comment "!fw3: Custom prerouting rule chain" -j prerouting_rule
[216:29055] -A PREROUTING -i br-lan -m comment --comment "!fw3" -j zone_lan_prerouting
[403:26189] -A PREROUTING -i vpn -m comment --comment "!fw3" -j zone_lan_prerouting
[47:11477] -A PREROUTING -i eth0.2 -m comment --comment "!fw3" -j zone_wan_prerouting
[507:34571] -A POSTROUTING -m comment --comment "!fw3: Custom postrouting rule chain" -j postrouting_rule
[7:1280] -A POSTROUTING -o br-lan -m comment --comment "!fw3" -j zone_lan_postrouting
[0:0] -A POSTROUTING -o vpn -m comment --comment "!fw3" -j zone_lan_postrouting
[485:32298] -A POSTROUTING -o eth0.2 -m comment --comment "!fw3" -j zone_wan_postrouting
[7:1280] -A zone_lan_postrouting -m comment --comment "!fw3: Custom lan postrouting rule chain" -j postrouting_lan_rule
[619:55244] -A zone_lan_prerouting -m comment --comment "!fw3: Custom lan prerouting rule chain" -j prerouting_lan_rule
[485:32298] -A zone_wan_postrouting -m comment --comment "!fw3: Custom wan postrouting rule chain" -j postrouting_wan_rule
[485:32298] -A zone_wan_postrouting -m comment --comment "!fw3" -j MASQUERADE
[47:11477] -A zone_wan_prerouting -m comment --comment "!fw3: Custom wan prerouting rule chain" -j prerouting_wan_rule
COMMIT
# Completed on Wed Oct 14 13:57:25 2020
# Generated by iptables-save v1.8.3 on Wed Oct 14 13:57:25 2020
*mangle
:PREROUTING ACCEPT [5099:688469]
:INPUT ACCEPT [3133:351560]
:FORWARD ACCEPT [1903:309512]
:OUTPUT ACCEPT [2936:1100625]
:POSTROUTING ACCEPT [4830:1409777]
[156:8360] -A FORWARD -o eth0.2 -p tcp -m tcp --tcp-flags SYN,RST SYN -m comment --comment "!fw3: Zone wan MTU fixing" -j TCPMSS --clamp-mss-to-pmtu
[60:3240] -A FORWARD -i eth0.2 -p tcp -m tcp --tcp-flags SYN,RST SYN -m comment --comment "!fw3: Zone wan MTU fixing" -j TCPMSS --clamp-mss-to-pmtu
COMMIT
# Completed on Wed Oct 14 13:57:25 2020
# Generated by iptables-save v1.8.3 on Wed Oct 14 13:57:25 2020
*filter
:INPUT ACCEPT [0:0]
:FORWARD DROP [0:0]
:OUTPUT ACCEPT [0:0]
:forwarding_lan_rule - [0:0]
:forwarding_rule - [0:0]
:forwarding_wan_rule - [0:0]
:input_lan_rule - [0:0]
:input_rule - [0:0]
:input_wan_rule - [0:0]
:output_lan_rule - [0:0]
:output_rule - [0:0]
:output_wan_rule - [0:0]
:reject - [0:0]
:syn_flood - [0:0]
:zone_lan_dest_ACCEPT - [0:0]
:zone_lan_forward - [0:0]
:zone_lan_input - [0:0]
:zone_lan_output - [0:0]
:zone_lan_src_ACCEPT - [0:0]
:zone_wan_dest_ACCEPT - [0:0]
:zone_wan_dest_REJECT - [0:0]
:zone_wan_forward - [0:0]
:zone_wan_input - [0:0]
:zone_wan_output - [0:0]
:zone_wan_src_REJECT - [0:0]
[144:12497] -A INPUT -i lo -m comment --comment "!fw3" -j ACCEPT
[2991:339143] -A INPUT -m comment --comment "!fw3: Custom input rule chain" -j input_rule
[2407:298787] -A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -m comment --comment "!fw3" -j ACCEPT
[52:2704] -A INPUT -p tcp -m tcp --tcp-flags FIN,SYN,RST,ACK SYN -m comment --comment "!fw3" -j syn_flood
[141:11048] -A INPUT -i br-lan -m comment --comment "!fw3" -j zone_lan_input
[391:25379] -A INPUT -i vpn -m comment --comment "!fw3" -j zone_lan_input
[52:3929] -A INPUT -i eth0.2 -m comment --comment "!fw3" -j zone_wan_input
[1903:309512] -A FORWARD -m comment --comment "!fw3: Custom forwarding rule chain" -j forwarding_rule
[1374:275521] -A FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -m comment --comment "!fw3" -j ACCEPT
[133:8298] -A FORWARD -i br-lan -m comment --comment "!fw3" -j zone_lan_forward
[396:25693] -A FORWARD -i vpn -m comment --comment "!fw3" -j zone_lan_forward
[0:0] -A FORWARD -i eth0.2 -m comment --comment "!fw3" -j zone_wan_forward
[0:0] -A FORWARD -m comment --comment "!fw3" -j reject
[224:18897] -A OUTPUT -o lo -m comment --comment "!fw3" -j ACCEPT
[2716:1082944] -A OUTPUT -m comment --comment "!fw3: Custom output rule chain" -j output_rule
[2423:1061151] -A OUTPUT -m conntrack --ctstate RELATED,ESTABLISHED -m comment --comment "!fw3" -j ACCEPT
[13:3096] -A OUTPUT -o br-lan -m comment --comment "!fw3" -j zone_lan_output
[0:0] -A OUTPUT -o vpn -m comment --comment "!fw3" -j zone_lan_output
[280:18697] -A OUTPUT -o eth0.2 -m comment --comment "!fw3" -j zone_wan_output
[31:1710] -A reject -p tcp -m comment --comment "!fw3" -j REJECT --reject-with tcp-reset
[21:2219] -A reject -m comment --comment "!fw3" -j REJECT --reject-with icmp-port-unreachable
[52:2704] -A syn_flood -p tcp -m tcp --tcp-flags FIN,SYN,RST,ACK SYN -m limit --limit 25/sec --limit-burst 50 -m comment --comment "!fw3" -j RETURN
[0:0] -A syn_flood -m comment --comment "!fw3" -j DROP
[13:3096] -A zone_lan_dest_ACCEPT -o br-lan -m comment --comment "!fw3" -j ACCEPT
[0:0] -A zone_lan_dest_ACCEPT -o vpn -m comment --comment "!fw3" -j ACCEPT
[529:33991] -A zone_lan_forward -m comment --comment "!fw3: Custom lan forwarding rule chain" -j forwarding_lan_rule
[529:33991] -A zone_lan_forward -m comment --comment "!fw3: Zone lan to wan forwarding policy" -j zone_wan_dest_ACCEPT
[0:0] -A zone_lan_forward -m conntrack --ctstate DNAT -m comment --comment "!fw3: Accept port forwards" -j ACCEPT
[0:0] -A zone_lan_forward -m comment --comment "!fw3" -j zone_lan_dest_ACCEPT
[532:36427] -A zone_lan_input -m comment --comment "!fw3: Custom lan input rule chain" -j input_lan_rule
[0:0] -A zone_lan_input -m conntrack --ctstate DNAT -m comment --comment "!fw3: Accept port redirections" -j ACCEPT
[532:36427] -A zone_lan_input -m comment --comment "!fw3" -j zone_lan_src_ACCEPT
[13:3096] -A zone_lan_output -m comment --comment "!fw3: Custom lan output rule chain" -j output_lan_rule
[13:3096] -A zone_lan_output -m comment --comment "!fw3" -j zone_lan_dest_ACCEPT
[141:11048] -A zone_lan_src_ACCEPT -i br-lan -m conntrack --ctstate NEW,UNTRACKED -m comment --comment "!fw3" -j ACCEPT
[391:25379] -A zone_lan_src_ACCEPT -i vpn -m conntrack --ctstate NEW,UNTRACKED -m comment --comment "!fw3" -j ACCEPT
[9:360] -A zone_wan_dest_ACCEPT -o eth0.2 -m conntrack --ctstate INVALID -m comment --comment "!fw3: Prevent NAT leakage" -j DROP
[800:52328] -A zone_wan_dest_ACCEPT -o eth0.2 -m comment --comment "!fw3" -j ACCEPT
[0:0] -A zone_wan_dest_REJECT -o eth0.2 -m comment --comment "!fw3" -j reject
[0:0] -A zone_wan_forward -m comment --comment "!fw3: Custom wan forwarding rule chain" -j forwarding_wan_rule
[0:0] -A zone_wan_forward -p esp -m comment --comment "!fw3: Allow-IPSec-ESP" -j zone_lan_dest_ACCEPT
[0:0] -A zone_wan_forward -p udp -m udp --dport 500 -m comment --comment "!fw3: Allow-ISAKMP" -j zone_lan_dest_ACCEPT
[0:0] -A zone_wan_forward -m conntrack --ctstate DNAT -m comment --comment "!fw3: Accept port forwards" -j ACCEPT
[0:0] -A zone_wan_forward -m comment --comment "!fw3" -j zone_wan_dest_REJECT
[52:3929] -A zone_wan_input -m comment --comment "!fw3: Custom wan input rule chain" -j input_wan_rule
[0:0] -A zone_wan_input -p udp -m udp --dport 68 -m comment --comment "!fw3: Allow-DHCP-Renew" -j ACCEPT
[0:0] -A zone_wan_input -p icmp -m icmp --icmp-type 8 -m comment --comment "!fw3: Allow-Ping" -j ACCEPT
[0:0] -A zone_wan_input -p igmp -m comment --comment "!fw3: Allow-IGMP" -j ACCEPT
[0:0] -A zone_wan_input -p udp -m udp --dport 51820 -m comment --comment "!fw3: Allow-WireGuard" -j ACCEPT
[0:0] -A zone_wan_input -m conntrack --ctstate DNAT -m comment --comment "!fw3: Accept port redirections" -j ACCEPT
[52:3929] -A zone_wan_input -m comment --comment "!fw3" -j zone_wan_src_REJECT
[280:18697] -A zone_wan_output -m comment --comment "!fw3: Custom wan output rule chain" -j output_wan_rule
[280:18697] -A zone_wan_output -m comment --comment "!fw3" -j zone_wan_dest_ACCEPT
[52:3929] -A zone_wan_src_REJECT -i eth0.2 -m comment --comment "!fw3" -j reject
COMMIT
# Completed on Wed Oct 14 13:57:25 2020

--------------------------
root@OpenWrt:~# ip -4 addr; ip -4 ro li tab all; ip -4 ru; \
>
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
6: br-lan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    inet 192.168.1.1/24 brd 192.168.1.255 scope global br-lan
       valid_lft forever preferred_lft forever
8: eth0.2@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    inet 192.168.8.102/24 brd 192.168.8.255 scope global eth0.2
       valid_lft forever preferred_lft forever
9: vpn: <POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1420 qdisc noqueue state UNKNOWN group default qlen 1000
    inet 192.168.9.1/24 brd 192.168.9.255 scope global vpn
       valid_lft forever preferred_lft forever
default via 192.168.8.1 dev eth0.2 proto static src 192.168.8.102 metric 100
192.168.1.0/24 dev br-lan proto kernel scope link src 192.168.1.1
192.168.8.0/24 dev eth0.2 proto static scope link metric 100
192.168.9.0/24 dev vpn proto kernel scope link src 192.168.9.1
broadcast 127.0.0.0 dev lo table local proto kernel scope link src 127.0.0.1
local 127.0.0.0/8 dev lo table local proto kernel scope host src 127.0.0.1
local 127.0.0.1 dev lo table local proto kernel scope host src 127.0.0.1
broadcast 127.255.255.255 dev lo table local proto kernel scope link src 127.0.0.1
broadcast 192.168.1.0 dev br-lan table local proto kernel scope link src 192.168.1.1
local 192.168.1.1 dev br-lan table local proto kernel scope host src 192.168.1.1
broadcast 192.168.1.255 dev br-lan table local proto kernel scope link src 192.168.1.1
broadcast 192.168.8.0 dev eth0.2 table local proto kernel scope link src 192.168.8.102
local 192.168.8.102 dev eth0.2 table local proto kernel scope host src 192.168.8.102
broadcast 192.168.8.255 dev eth0.2 table local proto kernel scope link src 192.168.8.102
broadcast 192.168.9.0 dev vpn table local proto kernel scope link src 192.168.9.1
local 192.168.9.1 dev vpn table local proto kernel scope host src 192.168.9.1
broadcast 192.168.9.255 dev vpn table local proto kernel scope link src 192.168.9.1
0:      from all lookup local
32766:  from all lookup main
32767:  from all lookup default

------------------------
root@OpenWrt:~# wg
interface: vpn
  public key: xxxxxxxxxxxxxxxxxxxxxxxxxDx4=
  private key: (hidden)
  listening port: 51820

peer: xxxxxxxxxxxxxxxxxxxxxxYw0=
  preshared key: (hidden)
  endpoint: 192.168.1.220:54485
  allowed ips: 192.168.9.5/32, fdf1:e8a1:8d3f:9::5/128
  latest handshake: 35 seconds ago
  transfer: 88.29 KiB received, 87.36 KiB sent
  persistent keepalive: every 25 seconds

peer: xxxxxxxxxxxxxxxxxxxxxxxxxx85AE=
  preshared key: (hidden)
  endpoint: 192.168.1.159:59432
  allowed ips: 192.168.9.4/32, fdf1:e8a1:8d3f:9::4/128
  latest handshake: 1 minute, 10 seconds ago
  transfer: 7.54 KiB received, 7.46 KiB sent
  persistent keepalive: every 25 seconds

peer: xxxxxxxxxxxxxxxmb1Ac=
  allowed ips: 192.168.9.3/32, fdf1:e8a1:8d3f:9::3/128
  persistent keepalive: every 25 seconds

peer: xxxxxxxxxxxxEYYg0=
  allowed ips: 192.168.9.2/32, fdf1:e8a1:8d3f:9::2/128
  persistent keepalive: every 25 seconds

peer: xxxxxxxxxxxxxxxxxxxxxxxxxxo=
  allowed ips: 192.168.9.6/32, fdf1:e8a1:8d3f:9::6/128
  persistent keepalive: every 25 seconds

peer: xxxxxxxxxxxxxxxxxxxxxx=
  allowed ips: 192.168.9.7/32, fdf1:e8a1:8d3f:9::7/128, 0.0.0.0/0, ::/0
  persistent keepalive: every 25 seconds
root@OpenWrt:~#

The server and client wiki how-tos are supposed to be run on different hosts.

Then you don't need to run the client on your home router.
You need only the server how-to and optionally multi-client extras.
Then you can distribute the generated client profiles *.conf to all your clients.

Make sure to set up DDNS beforehand, so the scripts can fetch your domain name when generating the client profiles.

Ok, on the latest setup you've posted the wireguard config looks mostly right. You need to remove

        list allowed_ips '0.0.0.0/0'
        list allowed_ips '::/0'

from all the peers though.

What's the config you have on remote devices?

1 Like

Thank you for these clear and precise instructions. You are right. It is a lack of thought and logic on my part. Indeed, we are supposed to connect to an external vpn server as a client. You have put an end to my doubts about my working configuration. Because by typing "My Ip", I saw my real IPv4 and not an IP as returned by an external server.
I will check my setup for the outside connection problem with my domain.
Thank you for your availability and your precious advice

Have a nice day

1 Like

When I try to connect from the outside to my routeur with the bv9500 smartphone, I replace

Endpoint = 192.168.9.1:51820 per domain name: 51820 and I don't have a handshake.

My question should I also modify Endpoint Host: domainname and Endpoint Port: 51820

Voyoi7 Portable Configuration

[Interface]
PrivateKey = xxxxxxxxxxxxxxxxxxxxxeE8=
Address = 192.168.9.2/32
DNS = 192.168.9.1

[Peer]
PublicKey = xxxxxxxxxxxxxxxxxxxxxx4=
AllowedIPs = 0.0.0.0/0, ::/0
Endpoint = 192.168.9.1:51820

------------------------
Portable Asus Configuration 

[Interface]
PrivateKey = xxxxxxxxxxxxxxxxxxxxxxxxXXY=
Address = 192.168.9.3/32
DNS = 192.168.9.1

[Peer]
PublicKey = xxxxxxxxxxxxxxxxxxxxxxDx4=
AllowedIPs = 0.0.0.0/0, ::/0
Endpoint = 192.168.9.1:51820

---------------------
Smartphone bv9500 Configuration 

[Interface]
Address = 192.168.9.4/32
DNS = 192.168.9.1
PrivateKey = xxxxxxxxxxxxxxxxxxxxZkY=

[Peer]
AllowedIPs = 0.0.0.0/0, ::/0
Endpoint = 192.168.9.1:51820
PersistentKeepalive = 25
PreSharedKey = xxxxxxxxxxxxxxxxxxxxxxxxxC/eY=
PublicKey = xxxxxxxxxxxxxxxxxxxxxxxxDx4=

----------------------
Smartphone bv9000 Configuration 

[Interface]
Address = 192.168.9.5/32
DNS = 192.168.9.1
PrivateKey = xxxxxxxxxxxxxxxxxxxxxxxxK0w=

[Peer]
AllowedIPs = 0.0.0.0/0, ::/0
Endpoint = 192.168.9.1:51820
PersistentKeepalive = 25
PreSharedKey = xxxxxxxxxxxxxxxxxxxxx+p6Th8=
PublicKey = xxxxxxxxxxxxxxxxxxxxx75xDx4=

--------------------
Tablette_AlldoCube Configuration 

[Interface]
Address = 192.168.9.6/32
DNS = 192.168.9.1
PrivateKey = xxxxxxxxxxxxxxxxxxxxxxx3Ww=

[Peer]
AllowedIPs = 0.0.0.0/0, ::/0
Endpoint = 192.168.9.1:51820
PersistentKeepalive = 25
PublicKey = xxxxxxxxxxxxxxxxx75xDx4=

----------
Tablette_Voyoi8 Configuration 

[Interface]
Address = 192.168.9.7/32
DNS = 192.168.9.1
PrivateKey = xxxxxxxxxxxxxxxxxxxxxxblw=

[Peer]
AllowedIPs = 0.0.0.0/0, ::/0
Endpoint = 192.168.9.1:51820
PersistentKeepalive = 25
PublicKey = xxxxxxxxxxxxxxxxxxxxxxxx5xDx4=

Looks like your WAN interface has a private IP address.
You cannot connect to a private IP address from the internet.

You need to specify the public IP address of your upstream router.
And configure the port forwarding on the upstream router.

1 Like

The WAN interface with the private IP address is that of the Fai 4G LTE Box
My linux knowledge is very limited.
Can you explain to me how to configure port forwarding on the upstream router by example?

This is your home router with the WireGuard server:

How is it connected to the internet?

My response time is long because I use a translator.

My router is connected in RJ45 (WAN socket) to the WAN socket of the Huawei 4G LTE SFR Box to connect to the Internet. I do not see my public IP in the configuration of this box

1 Like

Try to open its admin web interface:
http://192.168.8.1/

In which config to put:
default via 192.168.8.1 dev eth0.2

Box Huawei Device information, there is a WAN IP address: 172.1x.xxx.x which corresponds to the public address of SFR. This address is dynamic

This SFR public IP is different from my public IP address returned to me by whatismyip.com

1 Like