Hello everyone,
I've been using WireGuard on my Edge Router X (replacing my modem) for several months now and I'm very happy with it. Thanks again to all the contributors for this great project!
Recently my French operator switched me to CGNAT.
So I took a VPS from a hosting company with a dedicated public IPv4 and more than enough bandwidth (1Gbps up and down).
I've configured a WireGuard server on my VPS and I'm able to connect all my devices (phone, MacBook pro, etc.).
My long-term goal is to use this VPS for NAT and redirect the traffic arriving on it to my K8S cluster at home.
I've started configuring the WireGuard client on OpenWRT (identical to the configurations for my other devices) but obviously no handshake is happening (I checked the private/public keys).
After several hours of debugging and consulting this forum I still haven't managed to solve the problem.
Would some kind soul be willing to help me?
Thank you very much,
Louis
(sorry lot of config pollution due to my VLANs)
/etc/config/network
config interface 'loopback'
option device 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
config globals 'globals'
option packet_steering '1'
option ula_prefix 'fd42:703f:24b1::/48'
config device
option name 'br-lan'
option type 'bridge'
list ports 'eth1'
list ports 'eth2'
list ports 'eth3'
list ports 'eth4'
config interface 'lan'
option device 'br-lan'
option proto 'static'
list ipaddr '192.168.10.1/24'
option ip6assign '64'
list ip6class 'local'
list ip6class 'wan6'
list dns '1.1.1.1'
list dns '1.0.0.1'
list dns '2606:4700:4700::1111'
list dns '2606:4700:4700::1001'
config interface 'wan'
option device 'eth0'
option proto 'dhcp'
option peerdns '0'
option vendorid '(hidden)'
config interface 'wan6'
option device 'eth0'
option proto 'dhcpv6'
option reqaddress 'try'
option reqprefix 'auto'
option clientid '(hidden)'
option vendorclass '(hidden)'
option defaultreqopts '0'
option reqopts '23 25 26'
option noclientfqdn '1'
option noacceptreconfig '1'
option peerdns '0'
config device
option name 'eth0'
option macaddr '(hidden)'
config device
option type '8021q'
option ifname 'br-lan'
option vid '42'
option name 'mtb'
config interface 'mtb'
option proto 'static'
option device 'mtb'
option ipaddr '10.42.1.1'
option netmask '255.255.255.0'
option ip6assign '64'
list ip6class 'wan6'
list ip6class 'local'
list dns '1.1.1.1'
list dns '1.0.0.1'
list dns '2606:4700:4700::1111'
list dns '2606:4700:4700::1001'
config device
option type '8021q'
option ifname 'br-lan'
option vid '20'
option name 'main'
config interface 'main'
option proto 'static'
option device 'main'
option ipaddr '192.168.20.1'
option netmask '255.255.255.0'
list ip6class 'local'
list ip6class 'wan6'
option ip6assign '64'
list dns '1.1.1.1'
list dns '1.0.0.1'
list dns '2606:4700:4700::1111'
list dns '2606:4700:4700::1001'
config interface 'gateway'
option proto 'wireguard'
option private_key '(hidden)'
list addresses '10.50.1.42/32'
list dns '1.1.1.1'
list dns '1.0.0.1'
config wireguard_gateway
option description 'Gateway'
option public_key '(hidden)'
option endpoint_host '(hidden)'
list allowed_ips '10.50.1.42/32'
option route_allowed_ips '1'
/etc/config/firewall
config defaults
option input 'ACCEPT'
option output 'ACCEPT'
option forward 'REJECT'
option synflood_protect '1'
option flow_offloading '1'
option flow_offloading_hw '1'
config zone
option name 'lan'
option input 'ACCEPT'
option output 'ACCEPT'
option forward 'ACCEPT'
list network 'lan'
config zone
option name 'wan'
option input 'REJECT'
option output 'ACCEPT'
option forward 'REJECT'
option masq '1'
option mtu_fix '1'
list network 'wan'
list network 'wan6'
config forwarding
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 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 zone
option name 'mtb'
option input 'ACCEPT'
option output 'ACCEPT'
option forward 'ACCEPT'
list network 'mtb'
config forwarding
option src 'lan'
option dest 'mtb'
config forwarding
option src 'mtb'
option dest 'wan'
config zone
option name 'main'
option input 'ACCEPT'
option output 'ACCEPT'
option forward 'ACCEPT'
list network 'main'
config forwarding
option src 'main'
option dest 'lan'
config forwarding
option src 'main'
option dest 'mtb'
config forwarding
option src 'main'
option dest 'wan'
config forwarding
option src 'lan'
option dest 'main'
config zone
option name 'gateway'
option input 'ACCEPT'
option output 'ACCEPT'
option forward 'ACCEPT'
list network 'gateway'
config forwarding
option src 'gateway'
option dest 'mtb'
config forwarding
option src 'mtb'
option dest 'gateway'
config forwarding
option src 'gateway'
option dest 'wan'
config forwarding
option src 'gateway'
option dest 'lan'
config forwarding
option src 'lan'
option dest 'gateway'
config rule
option name 'Gateway'
list proto 'udp'
option src 'gateway'
option dest 'wan'
option dest_port '51820'
option target 'ACCEPT'
wg show (OpenWRT, client-side)
interface: gateway
public key: (hidden)
private key: (hidden)
listening port: 35296
peer: (hidden)
endpoint: 212.227.27.128:51820
allowed ips: 10.50.1.42/32
wg show (VPS, server-side)
interface: gateway
public key: (hidden)
private key: (hidden)
listening port: 51820
peer: (hidden)
allowed ips: 10.50.1.42/32, 10.42.0.0/16