ferdzo
April 28, 2023, 9:27am
1
Hello everybody,
After countless hours trying to setup Wiregurad VPN, so I could access it from the outside, I decided to write on the forum. So, I have a Wireguard server on my router and I can connect without a problem if the endpoint address is the local address of my router, but if I try to use my public IP address, nothing, the handshake wouldn't happen. I just get Handshake for peer 1 did not complete after x seconds. Sending handshake initiation to peer. I tried port forwarding the Wireguard port, but nothing happens. I am not behind a CGNAT, and other services can be accessed from the outside. What should I do next?
Please copy the output of the following commands and post it here using the "Preformatted text </>
" button:
Remember to redact passwords, MAC addresses and any public IP addresses you may have:
cat /etc/config/network
cat /etc/config/firewall
2 Likes
ferdzo
April 28, 2023, 7:08pm
3
/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 ula_prefix 'fde9:6d4a:e017::/48'
config device
option name 'br-lan'
option type 'bridge'
list ports 'eth0'
config device
option name 'eth0'
option macaddr '10:7b:44:eb:6a:e4'
config interface 'lan'
option device 'br-lan'
option proto 'static'
option ipaddr '192.168.1.1'
option netmask '255.255.255.0'
option ip6assign '60'
config device
option name 'eth1'
option macaddr '10:7b:44:eb:6a:e0'
config interface 'wan'
option device 'eth1'
option proto 'dhcp'
option peerdns '0'
list dns '8.8.8.8'
config interface 'wan6'
option device 'eth1'
option proto 'dhcpv6'
config switch
option name 'switch0'
option reset '1'
option enable_vlan '1'
config switch_vlan
option device 'switch0'
option vlan '1'
option ports '1 2 3 4 0'
config interface 'wg'
option proto 'wireguard'
option private_key 'xxxxxx'
list addresses '10.10.0.1/24'
config wireguard_wg
option description 'xxx'
option public_key xxxxxxxxxxxxxxxxxxxxxx
option persistent_keepalive '25'
list allowed_ips '10.10.0.2/32'
/etc/config/firewall
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 ula_prefix 'fde9:6d4a:e017::/48'
config device
option name 'br-lan'
option type 'bridge'
list ports 'eth0'
config device
option name 'eth0'
option macaddr '10:7b:44:eb:6a:e4'
config interface 'lan'
option device 'br-lan'
option proto 'static'
option ipaddr '192.168.1.1'
option netmask '255.255.255.0'
option ip6assign '60'
config device
option name 'eth1'
option macaddr '10:7b:44:eb:6a:e0'
config interface 'wan'
option device 'eth1'
option proto 'dhcp'
option peerdns '0'
list dns '8.8.8.8'
config interface 'wan6'
option device 'eth1'
option proto 'dhcpv6'
config switch
option name 'switch0'
option reset '1'
option enable_vlan '1'
config switch_vlan
option device 'switch0'
option vlan '1'
option ports '1 2 3 4 0'
config interface 'wg'
option proto 'wireguard'
option private_key 'aOLaUM2iALRQOw9SzDW296YWrSmxxo0qW0y/gsVsNE0='
list addresses '10.10.0.1/24'
config wireguard_wg
option description 'Andrej'
option public_key 'i8QriccQlX+PSenId8JMxIJ+59+1UnDfedAjedo5Vlg='
option persistent_keepalive '25'
list allowed_ips '10.10.0.2/32'
config defaults
option input 'ACCEPT'
option output 'ACCEPT'
option forward 'REJECT'
option synflood_protect '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 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 rule
option name 'Support-UDP-Traceroute'
option src 'wan'
option dest_port '33434:33689'
option proto 'udp'
option family 'ipv4'
option target 'REJECT'
option enabled 'false'
config include
option path '/etc/firewall.user'
config include 'miniupnpd'
option type 'script'
option path '/usr/share/miniupnpd/firewall.include'
option family 'any'
option reload '1'
config zone
option name 'wg'
option output 'ACCEPT'
option masq '1'
option mtu_fix '1'
list network 'wg'
option input 'REJECT'
option forward 'REJECT'
config forwarding
option src 'lan'
option dest 'wg'
config forwarding
option src 'wan'
option dest 'wg'
config redirect
option dest 'lan'
option target 'DNAT'
option name 'wg'
option src 'wan'
option src_dport '51014'
option dest_ip '192.168.1.1'
Your wg interface is missing a listen port. It should look like this:
config interface 'wg'
option proto 'wireguard'
option private_key 'xxxxxx'
list addresses '10.10.0.1/24'
option listen_port '51014'
remove the masquerading and mtu_fix from the wg firewall zone.
If the remote peer devices are fully trusted, you can make input = accept.
delete this:
This shoud be a rule, not a redirect.... delete this:
and then add a rule:
config rule
option name 'Allow-Wireguard-Inbound'
list proto 'udp'
option target 'ACCEPT'
option src 'wan'
option dest_port '51014'
1 Like
You may want to generate a new set of keys for your wireguard config, you have exposed your private key here.
If your problem is solved, please consider marking this topic as [Solved]. See How to mark a topic as [Solved] for a short how-to.
Thanks!
2 Likes